Search code examples
cssrubyjekylljekyll-extensionsautoprefixer

How to include autoprefixer for Jekyll


New to Jekyll and new to Ruby I tried to include autoprefixer-rails for my (s)css files directly into Jekyll. So once the page is generated by Jekyll autoprefixer would run over my generated css files. Unfortunately, I haven't managed to set things up properly and autoprefixer doesn't seem to even touch my files.

Following my Gemfile:

source "https://rubygems.org"

gem 'jekyll'
gem 'jekyll-assets'
gem 'autoprefixer-rails'

And parts of my Jekyll configuration file:

...
gems: ['jekyll-assets', 'autoprefixer-rails']
...

Which settings are missing to make it work? Any help is appreciated!


Solution

  • autoprefixer-rails is a Rails plugin, it has nothing to do with Jekyll and can't be used in Jekyll.

    If you need a similar feature in Jekyll, you currently have no other options than develop it yourself. You can grab part of the code from the Rails plugin, but the way Jekyll plugins work is significantly different.