# css-to-lit-js

> Convert CSS to lit JavaScript file

Latest version **0.8.0** (published 2021-06-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install css-to-lit-js
pnpm add css-to-lit-js
yarn add css-to-lit-js
bun add css-to-lit-js
```

Provides the command `css-to-lit-js`.

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.0 |
| Published | 2021-06-25 |
| First published | 2019-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=14.0.0 |
| Dependencies | 3 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mgenware |
| Maintainers | mgenware |

## Links

- npm: https://www.npmjs.com/package/css-to-lit-js
- Repository: https://github.com/mgenware/css-to-lit-js
- Issues: https://github.com/mgenware/css-to-lit-js/issues
- npm.io page: https://npm.io/package/css-to-lit-js

## Dependencies (3)

- [m-fs](https://npm.io/package/m-fs.md) ^5.0.0
- [meow](https://npm.io/package/meow.md) ^10.0.1
- [string-to-template-literal](https://npm.io/package/string-to-template-literal.md) ^2.0.0

## Recent versions

- 0.8.0 (latest) — 2021-06-25
- 0.7.0 — 2021-06-25
- 0.6.0 — 2020-05-27
- 0.5.1 — 2020-02-08
- 0.5.0 — 2020-01-01
- 0.4.2 — 2019-12-29
- 0.4.1 — 2019-08-24
- 0.4.0 — 2019-08-24
- 0.3.0 — 2019-08-24
- 0.2.0 — 2019-08-21
- 0.1.1 — 2019-08-21
- 0.1.0 — 2019-08-21

## README

# css-to-lit-js

[![Build Status](https://github.com/mgenware/css-to-lit-js/workflows/Build/badge.svg)](https://github.com/mgenware/css-to-lit-js/actions)
[![MEAN Module](https://img.shields.io/badge/MEAN%20Module-TypeScript-blue.svg?style=flat-square)](https://github.com/mgenware/MEAN-Module)
[![npm version](https://img.shields.io/npm/v/css-to-lit-js.svg?style=flat-square)](https://npmjs.com/package/css-to-lit-js)
[![Node.js Version](http://img.shields.io/node/v/css-to-lit-js.svg?style=flat-square)](https://nodejs.org/en/)

Convert CSS to lit JavaScript file

## Installation

```sh
npm i css-to-lit-js -g
```

## Usage

Given a CSS file like:

```css
body {
  background-color: #ededed;
}
```

Run `css-to-lit-js`:

```sh
css-to-lit-js a.css
```

It generates a `a.css.js`:

```js
import { css } from 'lit';
export default css`
  body {
    background-color: #ededed;
  }
`;
```

### Options

- `--ext` sets the extension for the output file, defaults to `js`, e.g. `css-to-lit-js a.css --ext ts`.

### API

Install `css-to-lit-js` locally:

```sh
npm add css-to-lit-js
```

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

*/
```

---
_Source: https://npm.io/package/css-to-lit-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
