# tailwindcss-hsl

> tailwindcss plugin

Latest version **0.4.0** (published 2022-05-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install tailwindcss-hsl
pnpm add tailwindcss-hsl
yarn add tailwindcss-hsl
bun add tailwindcss-hsl
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2022-05-03 |
| First published | 2021-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | fireloong |
| Maintainers | fireloong |
| Keywords | tailwindcss, hsl, color, plugin |

## Links

- npm: https://www.npmjs.com/package/tailwindcss-hsl
- Repository: https://gitee.com/fireloong/tailwindcss-hsl
- npm.io page: https://npm.io/package/tailwindcss-hsl

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 0.4.0 (latest) — 2022-05-03
- 0.3.2 — 2021-12-17
- 0.3.1 — 2021-12-17
- 0.2.1 — 2021-12-16
- 0.2.0 — 2021-12-16
- 0.1.0 — 2021-12-16

## README

# tailwindcss-hsl

A tailwindcss plugin

## Installation

Install the plugin from npm:

```sh
# Using npm
npm install tailwindcss-hsl

# Using Yarn
yarn add tailwindcss-hsl
```


Then add the plugin to your `tailwind.config.js` file:

```js
// tailwind.config.js
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require('tailwindcss-hsl'),
    // ...
  ],
}
```

## Usage
 
Use the `bg-{h}-{s}-{l}` utilities to specify how many lines of text should be visible before truncating::

```html
<button class="bg-primary-100-50 border border-success-60-30" type="button">Button</button>
<button class="bg-primary-100-50/60" type="button">Button</button>
```

Utilities are for clamping text up to 6 lines are generated by default:

| Class | CSS |
| --- | --- |
| `bg-primary-10-10` | `background-color: hsl(var(--tw-primary-hue) 10% 10% / var(--tw-bg-opacity));` |
| `bg-success-20-50` | `background-color: hsl(var(--tw-success-hue) 20% 50% / var(--tw-bg-opacity));` |
| `bg-danger-100-50/60` | `background-color: hsl(var(--tw-danger-hue) 20% 50% / 0.6);` |
| `border-warning-70-80` | `border-color: hsl(var(--tw-warning-hue) 70% 80%);` |
| …… | …… |

## Attribute color

- [x] text
- [x] bg
- [x] border
- [x] decoration
- [x] divide
- [x] outline
- [x] shadow


```js
// Default

hslColors: {
  h: {
    primary: '216',
    success: '152',
    danger: '354',
    warning: '45',
    info: '190',
    secondary: '210'
  },
  s: {
    10: '10%',
    20: '20%',
    30: '30%',
    40: '40%',
    50: '50%',
    60: '60%',
    70: '70%',
    80: '80%',
    90: '90%',
    100: '100%',
  },
  l: {
    10: '10%',
    20: '20%',
    30: '30%',
    40: '40%',
    50: '50%',
    60: '60%',
    70: '70%',
    80: '80%',
    90: '90%',
  }
}
```

## Configuration

You can configure which values and variants are generated by this plugin under the `hslColors` key in your `tailwind.config.js` file:

```js
// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      hslColors: {
        h: {
          error: '0' // 0~360
        },
        s: {
          15: '15%',
          25: '25%',
          35: '35%'
        },
        l: {
          15: '15%',
          25: '25%',
        }
      }
    }
  },
  variants: {
    hslColors: ['responsive', 'hover']
  }
}
```

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