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

https://github.com/viktor-yakubiv/every-color

A utility class library, letting you write semantically correct and concise sentences in the class attribute.
https://github.com/viktor-yakubiv/every-color

color css design library utility

Last synced: 3 months ago
JSON representation

A utility class library, letting you write semantically correct and concise sentences in the class attribute.

Awesome Lists containing this project

README

        

[![
Russia invaded Ukraine,
killing tens of thousands of civilians and displacing millions more.
It's a genocide.
Please help us defend freedom, democracy and Ukraine's right to exist.
](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://vshymanskyy.github.io/StandWithUkraine)

# Every Color

_Write language, not code._

A utility class library,
letting you write semantically correct and concise sentences
in the `class` attribute.

Grammar derives from the common design slang.

## API

The library supports the following list of classes
that could be used simultaneously.

Object classes are nouns and have a controlling role.
All others are adjectives and meant to be modifiers.

### Object

* `content` — applies text and icons color on the current background
* `surface` — applies block background and defines text and icons colors
that are suitable for the background

### Accent

The color accent could be applied either to _content_ or _surface_.
If applied to the content,
it updates the text color, relatively to the current surface.
If applied to the surface,
it sets the surface background and the surface controls the text color
based on the other modifiers.

If used with neither `.content` nor `.surface`,
it assumes to be applied to content, i.e. text and icons.

* `default`
* `primary`
* `info`
* `positive`
* `warning`
* `danger`

### Contrast

The contrast schema, relative to the current theme.

* `neutral` — blends into the background
* `vibrant` — contrasts with the background

### Emphasis

Emphasis applies to _content_ only
but for convenience could be used without `.content`.

* `major` — high emphasis
* `minor` — medium emphasis

## Examples

Examples below assume the following:

* `.box` applies some padding to make the element look nicer
* `.stack` applies vertical spacing between children
* `.a`, `.with`, `.&` are not and will never be defined

### Alert

```html


404 Not Found


The resource you are looking for was removed or never existed.



```

### Button

```html
OK
```

### Details list


Update date

yesterday

### Simple text

```html

15 KiB


```

```html

Mb


```

## Playground

[Try it out](https://codepen.io/yakubiv/pen/BadQgZw?editors=1000) on CodePen.

## License

[MIT](./LICENSE)