UNPKG

jobiqo-cl

Version:

[![CircleCI](https://circleci.com/gh/jobiqo/jobiqo-cl.svg?style=svg&circle-token=5a24efa5b8bbc4879276123e77d0d3f35ca7144c)](https://circleci.com/gh/jobiqo/jobiqo-cl)

51 lines (43 loc) 1.27 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var index_esm = require('../../core/dist/index.esm.js'); var index_esm$1 = require('../../css/dist/index.esm.js'); var variant = function variant(_ref) { var _config; var scale = _ref.scale, _ref$prop = _ref.prop, prop = _ref$prop === void 0 ? 'variant' : _ref$prop, _ref$variants = _ref.variants, variants = _ref$variants === void 0 ? {} : _ref$variants, key = _ref.key; var sx; if (Object.keys(variants).length) { sx = function sx(value, scale, props) { return index_esm$1.default(index_esm.get(scale, value, null))(props.theme); }; } else { sx = function sx(value, scale) { return index_esm.get(scale, value, null); }; } sx.scale = scale || key; sx.defaults = variants; var config = (_config = {}, _config[prop] = sx, _config); var parser = index_esm.createParser(config); return parser; }; var buttonStyle = variant({ key: 'buttons' }); var textStyle = variant({ key: 'textStyles', prop: 'textStyle' }); var colorStyle = variant({ key: 'colorStyles', prop: 'colors' }); exports.buttonStyle = buttonStyle; exports.colorStyle = colorStyle; exports.textStyle = textStyle; exports.variant = variant;