Description
lit-css is a set of build plugins that import CSS files as JavaScript tagged-template literal objects. The name stands for literal. The plugins are for projects that use lit-element, @microsoft/fast-element or other libraries that accept CSS as template literals. Each plugin is an optional package, and the README lists the build tools they work with: esbuild, TypeScript, Rollup, Webpack, Vite and Parcel, plus a shared logic package. The README is open about the trade-off. It says you do not need these packages, because you can write styles in styles.css.js modules, and that approach may be preferred. The plugins exist to make it easier to keep CSS in CSS files while importing it into component code. The author expects the packages to become obsolete if the CSS Modules proposal, or something like it, is accepted and implemented. The project is public on GitHub.…
Highlights
- Imports CSS files as tagged-template literals
- Works with lit-element and FAST element
- Plugins for esbuild, Rollup, Webpack, Vite and Parcel
- Optional packages, not required
Ratings & Reviews
No ratings yet
Be the first to rate @pwrs/lit-css.
People also visit

@vertical-insure/web-components
Vertical Insure Web Components using Lit and Open Web Standards
@pwrs/lit-css FAQ
What does lit-css do?
It builds plugins that import CSS files as JavaScript tagged-template literal objects.
Who needs it?
Developers using Lit, FAST element or similar libraries who want their CSS kept in separate .css files.
Do I have to use it?
No. The README says these are optional, and writing styles in styles.css.js modules may be preferred.
Which build tools work with it?
The README lists esbuild, TypeScript, Rollup, Webpack, Vite and Parcel.
Will it stay necessary?
The README expects it to become obsolete if the CSS Modules proposal or something similar is accepted and implemented.
What are the best @pwrs/lit-css alternatives?
Popular alternatives to @pwrs/lit-css include @iyulab/components, shipstyles and @webcomponents/shadycss. See all @pwrs/lit-css alternatives













