@gannochenko/ui.styled-components
Version:
<!-- PROJECT SHIELDS --> <!-- *** Reference links are enclosed in brackets [ ] instead of parentheses ( ). *** See the bottom of this document for the declaration of the reference variables *** for contributors-url, forks-url, etc. This is an optional, co
15 lines • 517 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStyleFor = void 0;
const getValue = (value, theme) => {
if (typeof value === 'string') {
return value;
}
if (theme && typeof theme.spacing === 'function') {
return theme.spacing(value);
}
return value;
};
const getStyleFor = (property, value, theme) => (value !== undefined ? `${property}: ${getValue(value, theme)};` : '');
exports.getStyleFor = getStyleFor;
//# sourceMappingURL=utils.js.map