Skip to content

v1.6.7 #162

Closed
Closed

Description

@tbela99

v1.6.7

  • limit the amount of memory used when parsing large files
  • use node flags as bitmasks
  • fix powerless and missing components handling with color-mix(). missing and powerless colors are now carried forward
const css = `

    button {
    
color: color-mix(in hsl, hwb(none none none), hsl(11 33 44));
color: color-mix(in hsl, lch(none none 180), hsl(11 33 44));
color: color-mix(in srgb, white, black);
color: color-mix(in oklch, oklch(0.783 0.108 326.5 / 0.5), oklch(0.392 0.4 0 / none));

    color: color-mix(in srgb, color(display-p3 none none none), color(srgb 0.11 0.33 0.44));
color: color-mix(in oklch, oklch(78.3% 0.108 326.5), oklch(39.2% 0.4 none)) ;

}
`;

const result =  transformSync({input: css, 
  beautify: true, 
  inlineCssVariables: true,
  removeDuplicateDeclarations: false,
  convertColor: ColorType.SRGB
});
// console.debug(result);
console.debug(result.code);

should produce

button {
 color: color(srgb .78255 .272052 .15745);
 color: color(srgb .5852 .32384 .2948);
 color: color(srgb .5 .5 .5);
 color: color(srgb .843871 -.026576 .636173/50%);
 color: color(srgb .11 .33 .44);
 color: color(srgb .764947 .131643 .788822)
}
  • use node flags as bitmasks
  • merging properties should takes into consideration the !important flag
import {transformSync} from '@tbela99/css-parser';

 const options = {
            input: `
    
    button {
            	line-height: 2.5 !important;
            	line-height: 1.5;
            }
    `,
            beautify: true,
        };

  const result = transformSync(options);
  console.debug(result.code);

should produce

button {
 line-height: 2.5!important
}

cec10d6
fa8d7bd
07bdd33
9b1df69
d9accb5
00528fc
8f3d51d
51d85c1
0c1ca9e
0af55c0

Activity

  1. added this to the v1.6.7 milestone on Oct 12, 2026
  2. linked a pull request that will close this issuev1.6.7 #163on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions