UNPKG

styled-components

Version:

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅

31 lines (21 loc) • 923 B
'use strict'; exports.__esModule = true; var _stylis = require('stylis'); var _stylis2 = _interopRequireDefault(_stylis); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var babelPluginFlowReactPropTypes_proptype_Interpolation = require('../types').babelPluginFlowReactPropTypes_proptype_Interpolation || require('prop-types').any; var stylis = new _stylis2.default({ global: false, cascade: true, keyframe: false, prefix: true, compress: false, semicolon: true }); var stringifyRules = function stringifyRules(rules, selector, prefix) { var flatCSS = rules.join('').replace(/^\s*\/\/.*$/gm, ''); // replace JS comments var cssStr = selector && prefix ? prefix + ' ' + selector + ' { ' + flatCSS + ' }' : flatCSS; return stylis(prefix || !selector ? '' : selector, cssStr); }; exports.default = stringifyRules; module.exports = exports['default'];