postcss-theme icon indicating copy to clipboard operation
postcss-theme copied to clipboard

Allow generic @imports

Open pierluigi opened this issue 9 years ago • 5 comments

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?

pierluigi avatar Oct 19 '16 15:10 pierluigi

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

Have you tried @import theme(colors);?

andywer avatar Oct 19 '16 15:10 andywer

Error:
@import theme(colors);
^
      @import directive requires a url or quoted path

pierluigi avatar Oct 19 '16 15:10 pierluigi

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

pierluigi avatar Oct 19 '16 16:10 pierluigi

Yeah, that would explain the issue 😉

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

andywer avatar Oct 19 '16 17:10 andywer

@pierlo-upitup Any updates on this?

andywer avatar Dec 06 '16 10:12 andywer