Skip to content
This repository has been archived by the owner on Jul 4, 2019. It is now read-only.

jxnblk/thema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thema

Schema validation for design system theme objects. Intended for use with styled-system

npm i thema
import { isValid } from 'thema'
import theme from './theme'

isValid(theme)
// returns true for valid theme objects

Schema

This schema is based on the theme structure used in styled-system, but can be used for other purposes as well, where a standardize theme shape can help with interoperability.

Theme {
  space: NumberOrStringArray,
  fontSizes: NumberOrStringArray,
  lineHeights: NumberOrStringObject,
  fontWeights: NumberOrStringObject,
  letterSpacings: NumberOrStringObject,
  colors: Object,
  maxWidths: NumberOrStringObject,
  minWidths: NumberOrStringObject,
  heights: NumberOrStringObject,
  maxHeights: NumberOrStringObject,
  minHeights: NumberOrStringObject,
  radii: NumberOrStringObject,
  borders: ArrayOrObject,
  shadows: ArrayOrObject,
  textStyles: NestedObject,
  colorStyles: NestedObject,
  buttons: NestedObject
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published