5

With Polymer I can include my CSS styles in the element definition simply by adding a <style> tag. What I would like to do though is to add a preprocessor to those styles. Something like https://autoprefixer.github.io/ would be great.

Is there a way to do so without an external CSS file?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Gio Polvara
  • 23,416
  • 10
  • 66
  • 62

1 Answers1

2

Use a build step to extract inline resources to separate files - something like gulp-html-extract.

Once you have the source extracted, you can process it separately.

You would then use a tool like Vulcanize to re-inline your styles back into your main component.

Chad Killingsworth
  • 14,360
  • 2
  • 34
  • 57
  • Can you elaborate on this? I read through https://www.npmjs.com/package/crisper and didn't see anything about CSS. It appears to just be for JavaScript. Maybe I'm missing something? – Nick Apr 14 '16 at 14:35
  • @nick Looks like you are correct. Process is the same though - you'll just need a different tool. – Chad Killingsworth Apr 14 '16 at 17:21