-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Milestone
Description
Add shortest scope which produces short class names
import {ModuleCaseTransformEnum, ModuleScopeEnumOptions, transform} from "@tbela99/css-parser";
const css = `
.className {
background: red;
color: yellow;
}
.subClass {
composes: className;
background: blue;
}
`;
const result = await transform(css, {
beautify: true,
module: ModuleScopeEnumOptions.Shortest | ModuleScopeEnumOptions.ICSS | ModuleCaseTransformEnum.DashCaseOnly
});
console.debug(result.code);result
:export {
class-name: a;
sub-class: b a;
}
.a {
background: red;
color: #ff0
}
.b {
background: blue
}console.error(result.mapping);{
"class-name": "a",
"sub-class": "b a",
}Metadata
Metadata
Assignees
Labels
No labels