0

I've just started using Jekyll and the stylus plugin provided here: https://gist.github.com/adamjspooner/988201

I have some import statements in my stylus files like the following:

@import 'normalize.css'

The stylus plugin converts the stylus files correctly to css, but keeps the import statements in the generated css file. I would like to have the import statement to include the content of the css file when the css is generated. When using the command line for compiling stylus you can use the --include-css option to perform this task. How would one go about doing this when using the stylus plugin in Jekyll?

Derek
  • 520
  • 1
  • 5
  • 19
  • Based on the code in the gist, and the `stylus` gem https://github.com/lucasmazza/ruby-stylus/blob/master/lib/stylus.rb, seems like you can't use this option. – Panya Mar 06 '15 at 08:47
  • @Panya I had looked at the docs for the stylus gem and didn't see any support, but thought I may be overlooking something. – Derek Mar 06 '15 at 11:58
  • 1
    You can try to add `options` object with 'include css' key to the `compile` method, but I'm not sure that it will work. Stylus.compile content, { 'include css' => true } – Panya Mar 06 '15 at 12:12
  • @Panya That works! Minification occurs before the importing, so only the content from styl files are being minified, but I will look into that... If you like, you can copy and paste your answer below and I will mark it as accepted. Thanks! – Derek Mar 06 '15 at 16:56

1 Answers1

0

You can try to add options object with 'include css' key to the compile method, but I'm not sure that it will work:

Stylus.compile content, { 'include css' => true }

Panya
  • 2,679
  • 2
  • 18
  • 17