# fbjs-css-vars

> This package exports a few of the CSS variables that we use in Facebook projects. This is not the full list we have internally but focused on making available the minimum set needed by our open source projects.

Latest version **1.0.2** (published 2018-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install fbjs-css-vars
pnpm add fbjs-css-vars
yarn add fbjs-css-vars
bun add fbjs-css-vars
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-12-17 |
| First published | 2016-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1960 |
| Maintainers | fb, zpao |

## Links

- npm: https://www.npmjs.com/package/fbjs-css-vars
- Repository: https://github.com/facebook/fbjs
- Homepage: https://github.com/facebook/fbjs#readme
- Issues: https://github.com/facebook/fbjs/issues
- npm.io page: https://npm.io/package/fbjs-css-vars

## Recent versions

- 1.0.2 (latest) — 2018-12-17
- 1.0.1 — 2017-07-18
- 1.0.0 — 2016-07-14

## README

# fbjs-css-vars

This package exports a few of the CSS variables that we use in Facebook projects. This is not the full list we have internally but focused on making available the minimum set needed by our open source projects.

## Usage

There are almost no use cases where a product will use this module. It will primarily be consumed by one of the following:

### `cssVar`

This is a module that will read from the list we have here and return the corresponding value. Internally we transform this statically but we don't currently do that in our open source projects.

```js
React.render(
  <div style={{backgroundColor: cssVar('fbui-white')}} />,
  containerNode
);
```

### CSS

In order to directly sync out our internal CSS and have it parsed by browser, we need to apply some transforms like we do internally. One of those transforms will insert the variables we have available here. In the future we may make use of [CSS Variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables).

```css
.class {
  background-color: var(fbui-white);
}
```

### Direct Usage

We're just exporting a JS Object so usage is straightforward.

```js
var fbCSSVars = require('fbjs-css-vars')

console.log(fbCSSVars['fbui-white']);
```

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