Jekyll + Tailwind2 + Netlify

Here’s the new solution for your Ruby Flavored Jamstack. Yes, really!

Typography in traditional printing
Photo by Hannes Wolf on Unsplash

Why Jekyll + Tailwind?

The problem to solve: background

Let’s do it

  • Add packages
//first create a package.json
% yarn init -y
//then add the packages% yarn add -D tailwindcss@latest postcss@latest autoprefixer@latest postcss-cli
  • Add the new gem postcss gem
#in Gemfilegroup :jekyll_plugins do
gem 'jekyll-postcss-v2'
end
  • Add the css
  • Add config files
% yarn tailwindcss init -p 
% yarn add -D @tailwindcss/typography
module.exports = {
...
plugins: [
require('@tailwindcss/typography'),
],
}
# in _/layouts/default.html...
<div class="prose prose-yellow prose-sm">

{{ content }}
</div>
...
% yarn add @fontsource/inter
// In tailwind.config.js
const defaultTheme = require('tailwindcss/defaultTheme')

module.exports = {
//...
theme: {
extend: {
fontFamily: {
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
},

},
},
// ...
}
# in tailwind.config.jsmodule.exports = {
purge: [
'./**/*.html'
],
//...
}
% NODE_ENV=production jekyll build

And ready!

Conclusion

--

--

Ruby and Rails developer, creator of www.strippenkaart.nl (in Dutch)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store