# root-variables

> Future-proof native CSS variables in your :root

Latest version **1.1.2** (published 2021-07-02) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install root-variables
pnpm add root-variables
yarn add root-variables
bun add root-variables
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2021-07-02 |
| First published | 2019-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 34.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Tunghsiao Liu |
| Maintainers | sparanoid |
| Keywords | css |

## Links

- npm: https://www.npmjs.com/package/root-variables
- Repository: https://sparanoid@github.com/sparanoid/root-variables
- Homepage: https://github.com/sparanoid/root-variables#readme
- Issues: https://github.com/sparanoid/root-variables/issues
- npm.io page: https://npm.io/package/root-variables

## 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.1.2 (latest) — 2021-07-02
- 1.1.1 — 2021-07-02
- 1.1.0 — 2021-07-02
- 1.0.10 — 2021-06-29
- 1.0.9 — 2020-12-05
- 1.0.8 — 2020-07-24
- 1.0.6 — 2019-10-13
- 1.0.5 — 2019-04-03
- 1.0.4 — 2019-04-03
- 1.0.2 — 2019-03-23
- 1.0.3 — 2019-03-23
- 1.0.1 — 2019-03-23
- 1.0.0 — 2019-03-23

## README

# Root Variables

Minimal, future-proof native CSS variables (CSS Custom Properties) framework in `:root` designed with the following features:

- Minimal variables defined: colors, typography, and layout helpers.
- HSL colors: all colors are HSL-based for more straightforward manipulation (before we have [CSS Color Module Level 4](https://drafts.csswg.org/css-color/) in hands).
- Easy to migrate: no *magic* variables for flex, or grid layout. You can continue to use your existing layout system.
- Flexible to extend: all variables can be overridden later in `:root` or in specific scopes.
- Dark mode ready: extend your existing app with `prefers-color-scheme: dark`, tweak colors with HSL, and you're ready to go.

## Installation

### unpkg

```html
<link rel="stylesheet" href="https://unpkg.com/root-variables">
```

### jsDelivr

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/root-variables/root-variables.css">
<!-- OR latest on GitHub -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sparanoid/root-variables/root-variables.css">
```

### Yarn

```shell
yarn add root-variables
```

### npm

```shell
npm i -S root-variables
```

## Usage

### Direct CSS

See `app.css` for example.

### Import `node_modules` in Webpack

```css
@import '~root-variables';

body {
  color: var(--text-color);
}
```

### Import in JavaScript

```js
import 'root-variables'

// styled-components example
const Component = styled.div`
  color: var(--text-color);
`
```

## License

MIT

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