suomifi-ui-components
Version:
Suomi.fi UI component library
32 lines (29 loc) • 1.67 kB
JavaScript
import { __makeTemplateObject } from 'tslib';
import { css } from 'styled-components';
import { normalize } from './normalize.js';
var common = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n font: 100% inherit;\n line-height: 1;\n text-align: left;\n text-decoration: none;\n vertical-align: baseline;\n color: inherit;\n background: none;\n cursor: inherit;\n\n ::before,\n ::after {\n box-sizing: border-box;\n }\n"], ["\n margin: 0;\n padding: 0;\n border: 0;\n box-sizing: border-box;\n font: 100% inherit;\n line-height: 1;\n text-align: left;\n text-decoration: none;\n vertical-align: baseline;\n color: inherit;\n background: none;\n cursor: inherit;\n\n ::before,\n ::after {\n box-sizing: border-box;\n }\n"])));
var resets = {
normalize: normalize,
common: common
};
var selectorDeclaration = function selectorDeclaration(selector, styles) {
return "&".concat(selector, " {\n ").concat(styles, "\n }");
};
var selectorsAndCss = function selectorsAndCss(selector) {
var styles = !!normalize && normalize[selector];
return !!styles ? selectorDeclaration(selector, styles) : '';
};
var resetWithSelectors = function resetWithSelectors(selectors) {
if (Array.isArray(selectors) && selectors.length > 0) {
return "\n ".concat(selectors.map(function (s) {
return selectorsAndCss(s);
}).join(''), "\n ");
}
if (typeof selectors === 'string') {
return selectorsAndCss(selectors);
}
return '';
};
var templateObject_1;
export { resetWithSelectors, resets };
//# sourceMappingURL=index.js.map