andywer / postcss-theme

PostCSS plugin to enable versatile theming.
MIT License
87 stars 2 forks source link

Allow generic @imports #9

Open pierluigi opened 8 years ago

pierluigi commented 8 years ago

Wouldn't it make sense to simply allow something like @import theme(colors)? We rely on postcss-css-variables and we don't need postcss-modules-values, so we'd simply like this plugin to inject the correct theme folder path.

This is the error

Error:
@import 'theme(colors)';
^
      File to import not found or unreadable: theme(colors)

Any thoughts?

andywer commented 8 years ago

Hi @pierlo-upitup. I think the problem is only related to the apostrophes.

Have you tried @import theme(colors);?

pierluigi commented 8 years ago
Error:
@import theme(colors);
^
      @import directive requires a url or quoted path
pierluigi commented 8 years ago

I believe the problem is postcss-theme is run after sass in my case. I will double-check.

andywer commented 8 years ago

Yeah, that would explain the issue 😉

Worst case: You need to run PostCSS before and after SASS.

andywer commented 7 years ago

@pierlo-upitup Any updates on this?