css-to-lit-js
v0.8.0
Published
Convert CSS to lit JavaScript file
Downloads
21
Readme
css-to-lit-js
Convert CSS to lit JavaScript file
Installation
npm i css-to-lit-js -g
Usage
Given a CSS file like:
body {
background-color: #ededed;
}
Run css-to-lit-js
:
css-to-lit-js a.css
It generates a a.css.js
:
import { css } from 'lit';
export default css`
body {
background-color: #ededed;
}
`;
Options
--ext
sets the extension for the output file, defaults tojs
, e.g.css-to-lit-js a.css --ext ts
.
API
Install css-to-lit-js
locally:
npm add css-to-lit-js
import convert from 'css-to-lit-js';
convert(`
body {
background-color: #ededed;
}`);
/*
Returns the following string:
import { css } from 'lit';
export default css`
body {
background-color: #ededed;
}
`;
*/