UNPKG

fractal-core

Version:

A minimalist and well crafted app, content or component is our conviction

26 lines 907 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const assign = require("object-assign"); const forOwn = require("lodash.forown"); const escape = require("lodash.escape"); const kebabCase = require("lodash.kebabcase"); // data.style module.exports = function styleModule(vnode, attributes) { var values = []; var style = vnode.data.style || {}; // merge in `delayed` properties if (style.delayed) { assign(style, style.delayed); } forOwn(style, function (value, key) { // omit hook objects if (typeof value === 'string' || typeof value === 'number') { var kebabKey = kebabCase(key); values.push((key.match(/^--.*/) ? '--' + kebabKey : kebabKey) + ': ' + escape(value)); } }); if (values.length) { attributes.set('style', values.join('; ')); } }; //# sourceMappingURL=style.js.map