# css-houdini-lines

> CSS Houdini Background Lines

Latest version **1.0.4** (published 2020-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install css-houdini-lines
pnpm add css-houdini-lines
yarn add css-houdini-lines
bun add css-houdini-lines
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2020-12-02 |
| First published | 2020-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36 |
| Author | Joan León |
| Maintainers | nucliweb |
| Keywords | houdini, css, css-houdini, PaintWorklet, paint, worklet |

## Links

- npm: https://www.npmjs.com/package/css-houdini-lines
- Repository: https://github.com/CSSHoudini/css-houdini
- Homepage: https://github.com/CSSHoudini/css-houdini/tree/main/src/lines
- Issues: https://github.com/CSSHoudini/css-houdini/issues
- npm.io page: https://npm.io/package/css-houdini-lines

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2020-12-02
- 1.0.3 — 2020-11-29
- 1.0.2 — 2020-11-29
- 1.0.1 — 2020-11-29

## README

# CSS Houdini Lines

A CSS Houdini Worklet to show connected nodes.

![CSS Houdini Lines](https://rawcdn.githack.com/CSSHoudini/css-houdini/37db32100d05d0231d0adb11b128229a8b737d55/src/lines/assets/lines.png)

## Getting started

### 1. Load the worklet

Using CDN is the easiest way to add the library:

```js
if ('paintWorklet' in CSS) {
  CSS.paintWorklet.addModule('https://rawcdn.githack.com/CSSHoudini/css-houdini/74a3e2482adf18b41882de48f601a5fc18fd9d5c/src/lines/dist/lines.js');
}
```

Or, download the latest [lines Worklet](https://github.com/CSSHoudini/css-houdini/tree/main/src/lines/dist) and import it to your web page:

```js
if ('paintWorklet' in CSS) {
  CSS.paintWorklet.addModule('path/to/lines.js');
}
```

#### You can use the polyfill

To add support for all moder browsers, you can load the worklet with [css-paint-polyfill](https://github.com/GoogleChromeLabs/css-paint-polyfill) fallback.

```html
<script>
  ;(async function() {
    if (CSS['paintWorklet'] === undefined)
      await import('https://unpkg.com/css-paint-polyfill')

    CSS.paintWorklet.addModule('./lines.js')
  })()
</script>
```

### 3. Ready to use it in your CSS!

To use **Lines** worlet you need define some custom properties with values and add the value `paint(lines)` on `background-image` property.

> The worklet has default values if you don't define these

```css
.element {
  --lines-colors: #f94144, #f3722c, #f8961e, #f9844a;
  --lines-widths: 10, 2, 3, 8;
  --lines-gaps: 20, 4, 3, 7;
  --lines-rotate: 0; /* In degrees */

  background-image: paint(lines);
}
```

| property | description | default value |
| -------- | ----------- | ------------- |
| --lines-colors | **Color lines**, you can define one or more hexadecimal colors comma separated | `#71a7ee, #7940c1` |
| --lines-widths | **Width lines**, you can define one or more line widths comma separated | `6, 2` |
| --lines-gaps | **Gap lines**, you can define one or more gaps comma separated | `8` |
| --lines-rotate | **Rotation lines**, with an interger | `0` |

## License

MIT License

Copyright (c) 2020 CSS Houdini

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