shuhei / material-colors

Colors of Google's Material Design made available to coders
https://shuheikagawa.com/material-colors/
ISC License
270 stars 41 forks source link

Trying to inline import a css file in SASS #26

Open thealjey opened 5 years ago

thealjey commented 5 years ago

The root cause is the same as in #7. I want to inline import the colors.css file, and there're two problems with that.

  1. all files are named colors, so if the file extension is omitted the name becomes ambiguous and sass throws an error
  2. if the file name is included, however, according to sass language specification, imports that end in .css are not inlined and a normal css @import url(...); is outputted instead

As is stands right now, the only solution that works (kinda) is to rename the file before compiling.

So, the question is, could we possibly have more unique file names?

shuhei commented 5 years ago

Thanks for reporting this issue. If I understand correctly, your requirement is to import and inline the CSS classes with Sass. The problem is caused by two factors:

  1. colors.scss/colors.sass export only variables while colors.css exports CSS classes.
  2. Sass requires import without extension to inline .css files.

Your suggestion is to address the factor 2, but changing file names breaks existing libraries and applications that depend on this library, which I'd like to avoid.

How about addressing the factor 1 by creating another .scss file like color-classes.scss with the same content as colors.css)?