TrySound / postcss-easy-import

PostCSS plugin to inline @import rules content with extra features
MIT License
201 stars 25 forks source link

feature request: import into selector #31

Closed gjhltn closed 5 years ago

gjhltn commented 5 years ago

Given a file some.css containing

a {color: red}

It would be most useful to be able to do

.foo {
   @import `some.css`;
}

and get

.foo a {
    color: red
}

This isn't behaviour it's easy to simulate in any other way afaict

[Motivation:

Image your app has multiple themes. you put your styles in a file which uses variables and do

.theme-red {
  --colour: red;
  @import `some.css`;
}

.theme-green {
  --colour: green;
  @import `some.css`;
}

]