css-blocks icon indicating copy to clipboard operation
css-blocks copied to clipboard

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

Open amiller-gh opened this issue 6 years ago • 0 comments

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; }

amiller-gh avatar Jul 25 '19 16:07 amiller-gh