Optionalcomputecompute math functions see supported functions mathFuncs
Optionalcomputecompute shorthand properties
Optionalcomputecompute transform functions see supported functions transformFunctions
Optionalinlineinline css variables
Optionalminifyenable minification
Optionalnestinggenerate nested rules
Optionalparseparse color tokens
Optionalpassdefine minification passes.
Optionalremoveremove duplicate declarations from the same rule. if passed as a string array, duplicated declarations are removed, except for those in the array
import {transform} from '@tbela99/css-parser';
const css = `
.table {
width: 100%;
width: calc(100% + 40px);
margin-left: 20px;
margin-left: min(100% , 20px)
}
`;
const result = await transform(css, {
beautify: true,
validation: true,
removeDuplicateDeclarations: ['width']
}
);
console.log(result.code);
Optionalremoveremove empty ast nodes
Optionalremoveremove css prefix
minify options