We are in a situation where we have to ship some of the global styles written with Lit tagged templates as plain css files.
Basically converting the following:
// global.ts
import { css, unsafeCSS } from 'lit';
import * as tokens from 'xyz-design-tokens';
export default css`
h1 {
font-size: ${unsafeCSS(tokens.h1FontSize)};
}
`;
to
/* global.css */
h1 {
font-size: 3rem;
}
I'v tried to use postcss-cli and postcss-lit but it just ends up outputting the same content of the global.ts
file. Is there any way to extract CSS out of the tagged templates and output as css files?