@chakra-v2/styled-system
Version:
Style function for css-in-js building component libraries
52 lines (48 loc) • 1.84 kB
JavaScript
;
var createTransform = require('./create-transform.cjs');
var propConfig = require('./prop-config.cjs');
var transformFunctions = require('./transform-functions.cjs');
const t = {
borderWidths: propConfig.toConfig("borderWidths"),
borderStyles: propConfig.toConfig("borderStyles"),
colors: propConfig.toConfig("colors"),
borders: propConfig.toConfig("borders"),
gradients: propConfig.toConfig("gradients", transformFunctions.transformFunctions.gradient),
radii: propConfig.toConfig("radii", transformFunctions.transformFunctions.px),
space: propConfig.toConfig(
"space",
(value, theme) => transformFunctions.transformFunctions.px(transformFunctions.transformFunctions.vh(value, theme))
),
spaceT: propConfig.toConfig(
"space",
(value, theme) => transformFunctions.transformFunctions.px(transformFunctions.transformFunctions.vh(value, theme))
),
degreeT(property) {
return { property, transform: transformFunctions.transformFunctions.degree };
},
prop(property, scale, transform) {
return {
property,
scale,
...scale && {
transform: createTransform.createTransform({ scale, transform })
}
};
},
propT(property, transform) {
return { property, transform };
},
sizes: propConfig.toConfig(
"sizes",
(value, theme) => transformFunctions.transformFunctions.px(transformFunctions.transformFunctions.vh(value, theme))
),
sizesT: propConfig.toConfig(
"sizes",
(value, theme) => transformFunctions.transformFunctions.fraction(transformFunctions.transformFunctions.vh(value, theme))
),
shadows: propConfig.toConfig("shadows"),
logical: propConfig.logical,
blur: propConfig.toConfig("blur", transformFunctions.transformFunctions.blur)
};
exports.transforms = transformFunctions.transformFunctions;
exports.t = t;