43081j / postcss-lit

PostCSS syntax for extracting CSS from template literals inside JS/TS files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for `/*css*/` flags

RobertAKARobin opened this issue · comments

Thanks for all the work on this! We just added it to our project and it's working great so far.

There are some situations where we use Lit-style templates without using the actual lit template function, like when we're really concerned about performance and don't expect to need to reevaluate the template. For example:

const mycss = /*css*/`
div {
  color: red;
}
`;

There are several VSCode plugins that provide syntax highlighting for this syntax (example). However to my knowledge there isn't yet a Postcss custom syntax defined for this.

Since the syntax is almost exactly the same, it would be great if this custom syntax supported /*css*/ as well as css. It may be technically outside the scope of a plugin intended for Lit, but there is surely a lot of overlap between the groups that use /*css*/ and css, and it should be a trivial amount of work.