Skip to content

V1.4.4#128

Merged
tbela99 merged 27 commits into
masterfrom
v.next
Jul 13, 2026
Merged

V1.4.4#128
tbela99 merged 27 commits into
masterfrom
v.next

Conversation

@tbela99

@tbela99 tbela99 commented Jul 4, 2026

Copy link
Copy Markdown
Owner

v1.4.4

Validation changes

  • Added the state and errors properties to nodes to expose their validation status and any associated validation errors.
  • Nodes that fail validation are no longer discarded. Nodes are discarded only if they are invalid, unparsed, or malformed. Unknown nodes are discarded when lenient parsing is disabled.

Color

  • alpha(): Added support for minifying the CSS Color 5 alpha() color function.
import {transform} from '@tbela99/css-parser';

const css = `

:root {
--mycolor:  oklch(60% 0.25 315 / 0.8);
}
    .s {
    
    color:
 alpha(from var(--mycolor)  / calc(alpha * 0.5));

`;

const result = await transform(css, {
                    beautify: true,
                    inlineCssVariables: true,
                });

console.debug(result.code);

result:

.s {
 color: #b538e366
}
import {transform} from '@tbela99/css-parser';

const css = `
.hsl { color: color-mix(firebrick, goldenrod); }
`;

const result = await transform(css, {
                    beautify: true,
                    convertColor: ColorType.OKLAB
                });

console.debug(result.code);

result:

.hsl {
 color: oklab(.624172 .087878 .113592)
}

Webkit gradient prefix removal

  • Convert -webkit-* gradient functions
    • -webkit-gradient() to:
      • linear-gradient()
      • radial-gradient() - not supported ⚠️
    • -webkit-linear-gradient()
    • -webkit-repeating-linear-gradient()
    • -webkit-radial-gradient()
    • -webkit-repeating-radial-gradient()

CSS gradient minification

  • Minify gradient functions
    • linear-gradient()
    • radial-gradient()
    • conic-gradient()
    • repeating-linear-gradient()
    • repeating-radial-gradient()
    • repeating-conic-gradient()

Other changes

Bug fixes

  • Fix path resolution on Windows
  • Do not minify supports() arguments

CSS incorrectly parsed:

body {
  background-color: if(
    supports(color: oklch(0.7 0.185 232)): oklch(0.7 0.185 232);
    else: #00adf3;
  );
  
  &::after {
    content: if(
    supports(color: oklch(0.7 0.185 232)): "Your browser supports OKLCH";
    else: "Your browser does not support OKLCH";
    );
  }
}

result:

body {
 background-color: if(supports(color:#00aefc):#00aefc;else:#00adf3);
 &:after {
  content: if(supports(color:#00aefc):"Your browser supports OKLCH";else:"Your browser does not support OKLCH")
 }
}

instead of:

body {
 background-color: #00adf3;
 @supports (color:oklch(.7 .185 232)) {
  background-color: #00aefc
 }
 &:after {
  content: "Your browser does not support OKLCH";
  @supports (color:oklch(.7 .185 232)) {
   content: "Your browser supports OKLCH"
  }
 }
}
  • Incorrectly parse selector when removePrefix and css module settings are enabled
*,:before,:after {
 box-sizing: border-box
}

is parsed and rendered as:

,,*:before:after {
 box-sizing: border-box
}

instead of:

*,:before,:after {
 box-sizing: border-box
}

Deprecation

Loading as commonjs module

  • Deprecate commonjs entry point. It will be removed in a future release.

Functions

  • Deprecate parseFile(). Use parse({file, asStream, ...options}) instead.
  • Deprecate transformFile(). Use transform({file, asStream, ...options}) instead

Enums

  • Deprecate using ValidationLevel to configure parsing validation settings. Use boolean values instead.
  • Deprecate invalid EnumToken node types. There are no longer used.
  • EnumToken.InvalidRuleNodeType
  • EnumToken.InvalidAtRuleNodeType
  • EnumToken.InvalidDeclarationNodeType

Interfaces

  • AstInvalidRule
  • AstInvalidDeclaration
  • AstInvalidAtRule

89645b6

@tbela99 tbela99 added this to the v1.4.4 milestone Jul 4, 2026
@tbela99 tbela99 merged commit bd898bf into master Jul 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant