@greensight/gds
Version:
Greensight Design System
72 lines (57 loc) • 1.19 kB
JavaScript
const writeFile = require('./writeFile');
function serializeBaseStyles(config) {
const layer = config.scss?.styles?.base?.layer;
const styles = `*,
::before,
::after {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html,
body {
min-height: 100%;
}
img {
max-width: 100%;
height: auto;
}
a {
display: inline-block;
text-decoration: none;
color: inherit;
cursor: pointer;
}
h1,
h2,
h3,
h4,
h5,
h6 {
margin: 0;
}
ul li,
ol li {
list-style: none;
}
button {
border: none;
background: none;
cursor: pointer;
}
input[type='number'] {
appearance: textfield;
}
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
margin: 0;
appearance: none;
}
fieldset {
padding: 0;
border: none;
}`;
const fileData = `${layer ? `@layer ${layer} { ${styles} }` : styles}`;
writeFile({ name: 'base', fileData, config });
}
module.exports = serializeBaseStyles;