0.10.1 • Published 3 years ago

@improv/theme v0.10.1

Weekly downloads
1
License
ISC
Repository
github
Last release
3 years ago

@improv/theme

SizeBadge SizeBadge SizeBadge

Tiny theming utilities.

Try it on codesandbox.io.

API

Utilities

  • getDefaultTheme()
    • Returns the default theme.
  • getExtendedTheme(partialTheme, theme?)
    • Deep merge the partial theme with another them, or the default them if the theme argument is omitted.
  • getBindings(options)

Theming

Theme values are always strings, and are always nested 3 objects deep.

const theme = getDefaultTheme();
const baseColor = theme.color.base.front;

Categories

The root theme object contains keys for "categories". The color and size categories are always present, because they are part of the default theme.

Scopes

Each theme category is an object with keys for "scopes". The color category will always have base, passive, and active scopes, and the size category will always have a base scope, because they are part of the default theme.

Values

Each theme scope is a map of string "values".

In all color category scopes, the following values are required:

  • front
  • trim
  • back

In the size category base scope, the following values are always available, because they are part of the default theme.

  • miniscule
  • tiny
  • smaller
  • small
  • medium
  • large
  • larger
  • huge
  • gigantic
0.10.1

3 years ago

0.10.0

3 years ago

0.9.18

3 years ago

0.9.17

3 years ago

0.9.12

3 years ago

0.9.8

3 years ago

0.9.13

3 years ago

0.9.7

3 years ago

0.9.6-next.0

3 years ago

0.9.14

3 years ago

0.9.15

3 years ago

0.9.9

3 years ago

0.9.4

3 years ago

0.9.3

3 years ago

0.9.10

3 years ago

0.9.11

3 years ago

0.9.5

3 years ago

0.9.16

3 years ago

0.9.7-alpha.2

3 years ago

0.9.7-alpha.1

3 years ago

0.9.6-alpha.0

3 years ago

0.9.7-alpha.0

3 years ago

0.9.2

3 years ago

0.9.1

3 years ago

0.9.0

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.7.5

3 years ago

0.7.4

3 years ago

0.7.3

3 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.0

3 years ago