UNPKG

typed-bem

Version:
4 lines (3 loc) 674 B
"use strict";const fs=require("fs");function c(f,n){const s=[];Object.entries(f).forEach(([t,i])=>{s.push(`.${t} {`),i.modifiers&&i.modifiers instanceof Set&&i.modifiers.forEach(e=>{s.push(` &--${e} {`),s.push(` // Styles for ${t}--${e}`),s.push(" }")}),i.elements&&Object.entries(i.elements).forEach(([e,o])=>{s.push(` &__${e} {`),o.modifiers&&o.modifiers instanceof Set?o.modifiers.forEach(r=>{s.push(` &--${r} {`),s.push(` // Styles for ${t}__${e}--${r}`),s.push(" }")}):s.push(` // Styles for ${t}__${e}`),s.push(" }")}),s.push("}")}),fs.writeFileSync(`${n}.scss`,s.join(` `),"utf8")}exports.generateBemScssFile=c; //# sourceMappingURL=scss.cjs.map