css-modules / postcss-icss-values

Pass arbitrary constants between your module files
MIT License
203 stars 18 forks source link

Support interpolation #89

Open marcfallows opened 7 years ago

marcfallows commented 7 years ago

It would be helpful for some edge cases of components to be able to interpolate or build up the class name to create some more specific rules:

@value alert from 'alert.css';

.link {
  /* link styling */
}

alert .link {
  /* some link styling that is specific to alerts */
}

postcss-simple-vars has this.

I know it's slightly against the principal of modules but rather than have some snowflake AlertLink component that you have to know to use when being put inside an alert, it would be great if the small number of cases could be handled in CSS.