UNPKG

@chakra-v2/styled-system

Version:

Style function for css-in-js building component libraries

40 lines (36 loc) 756 B
'use strict'; var utils = require('@chakra-v2/utils'); const tokens = [ "colors", "borders", "borderWidths", "borderStyles", "fonts", "fontSizes", "fontWeights", "gradients", "letterSpacings", "lineHeights", "radii", "space", "shadows", "sizes", "zIndices", "transition", "blur", "breakpoints" ]; function extractTokens(theme) { const _tokens = tokens; return utils.pick(theme, _tokens); } function extractSemanticTokens(theme) { return theme.semanticTokens; } function omitVars(rawTheme) { const { __cssMap, __cssVars, __breakpoints, ...cleanTheme } = rawTheme; return cleanTheme; } exports.extractSemanticTokens = extractSemanticTokens; exports.extractTokens = extractTokens; exports.omitVars = omitVars;