linkedin / css-blocks

High performance, maintainable stylesheets.
http://css-blocks.com/
BSD 2-Clause "Simplified" License
6.34k stars 152 forks source link

Log error when `compose`-ing on a pseudo element. #300

Open amiller-gh opened 5 years ago

amiller-gh commented 5 years ago

CSS Blocks should throw an error when trying to use compose in a pseudo element.

/* Src Block */
.other-thing { color: red }
/* In another file */
.my-class::before {
  composes: "other-thing";
}

This doesn't make sense since we will try to apply a class to a pseudo element – which can not receive classes.

Alternative: Inject a new selector that will apply the same code block for pseudos. For example, the above could output:

.other-thing, .my-class::before { color: red; }