# css-variables-loader

> Load CSS variables with Webpack

Latest version **2.0.2** (published 2016-12-19) · ISC license · 0 weekly downloads

## Install

```sh
npm install css-variables-loader
pnpm add css-variables-loader
yarn add css-variables-loader
bun add css-variables-loader
```

## 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 | 2.0.2 |
| Published | 2016-12-19 |
| First published | 2016-03-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Denis Sokolov |
| Maintainers | denis-sokolov, tregagnon |

## Links

- npm: https://www.npmjs.com/package/css-variables-loader
- Repository: https://github.com/Dashlane/css-variables-loader
- Homepage: https://github.com/Dashlane/css-variables-loader#readme
- Issues: https://github.com/Dashlane/css-variables-loader/issues
- npm.io page: https://npm.io/package/css-variables-loader

## Dependencies (1)

- [css](https://npm.io/package/css.md) ^2.2.1

## Recent versions

- 2.0.2 (latest) — 2016-12-19
- 2.0.1 — 2016-10-20
- 2.0.0 — 2016-03-29

## README

# CSS variable loader

[![npm](https://img.shields.io/npm/v/css-variables-loader.svg)](https://www.npmjs.com/package/css-variables-loader)
[![Build Status](https://travis-ci.org/Dashlane/css-variables-loader.svg?branch=master)](https://travis-ci.org/Dashlane/css-variables-loader)
[![Dependency Status](https://gemnasium.com/Dashlane/css-variables-loader.svg)](https://gemnasium.com/Dashlane/css-variables-loader)

Import your CSS variables into JavaScript.

## Assumptions

This project assumes you use [W3C custom properties](https://www.w3.org/TR/css-variables/) for CSS variables. This is how they look:

```css
:root {
    --my-theme-color: hsl(121, 90%, 90%);
    --my-accent-color: hsl(60, 90%, 90%);
    --my-font-size: 18px;
}
```

Only the custom properties on the `:root` selector are currently supported.

This project also assumes you have a Webpack-like setup for building your application.

## Usage

Install the loader into your project with `npm install --save css-variables-loader`.

In your JavaScript, use `var variables = require('!css-variables!../path/to/variables.css')`.

Now `variables` is a map of variable names to values as strings.

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