An open API service indexing awesome lists of open source software.

https://github.com/srcery-colors/srcery-palette

Srcery palette tracked here, exposed as an npm package
https://github.com/srcery-colors/srcery-palette

colors colorscheme json npm-package palette srcery theme

Last synced: 4 months ago
JSON representation

Srcery palette tracked here, exposed as an npm package

Awesome Lists containing this project

README

          













Srcery Palette

Srcery colors exposed as an [npm
package](https://www.npmjs.com/package/@srcery-colors/srcery-palette), intended
as a _single source of truth_ for the [Srcery colors](https://github.com/srcery-colors), regardless of implementation.

## Installation

Using git:
```sh
git clone https://github.com/srcery-colors/srcery-palette.git
```

Using npm:
```sh
npm i @srcery-colors/srcery-palette
```

## Usage

You can clone or download and use the `palette.json` however you like:

```sh
jq < palette.json '.primary.red.hex'
```
Or you can use the [npm package](https://www.npmjs.com/package/@srcery-colors/srcery-palette), which
exports `palette.json` as a JavaScript object:

```javascript
const palette = require("@srcery-colors/srcery-palette");
console.log(palette.primary.red.hex);
```
```mjs
import palette from "@srcery-colors/srcery-palette";
console.log(palette.primary.red.hex);
```

The package also exports CSS variables that can be imported

```css
@import "@srcery-colors/srcery-palette";
background: var(--srcery-palette-primary-black);
```

See `palette.json` for a full list of variable names, but it follows the same structure as demonstrated.