Packages

css-tree

3.2.1 · 5 Mar 2026MIT183.3M / weekRepositoryHomepagenpmAtom feed

Upgrading css-tree From 2.0.1 to 3.2.1

13 releases in betweennotes for 5

Other targets from 2.0.1Newest 2.x2.3.1
  1. 2.0.1yours
  2. 8 releases
  3. 3.0.0major
  4. 3.0.1breaking
  5. 2 releases
  6. 3.2.1target
1+
change to make
0
advisories fixed
34+
new
13+
fixes

Counted from 5 of 13 release notes. Advisories are counted from the advisory database, in full.

Before you upgrade

Tick each one off as you go
  • Breaking3.0.1

Release by release

  1. 3.2.1

    5 Mar 20261 fix
    • Fixed

      Fixed parsing of nested function in a group in definition syntax

  2. 3.2.0

    5 Mar 20267 new · 1 fix
    • New

      Added "sideEffects": false in package.json

    • New

      Added list option to the parse() method to specify whether the parser should produce a List (by default, list: true) or an array (list: false) for node's children (e.g., SelectorList, Block, etc.)

    • New

      Added support for Functional Notation in definition syntax (for now by wrapping function arguments into an implicit group when necessary, see #292)

    • New

      Added support for stacked multipliers {A}? and {A,B}? according to spec in definition syntax parsing

  3. 3.1.0

    6 Dec 20242 new · 4 fixes
    • New

      Added support for boolean expression multiplier in syntax definition, i.e. <boolean-expr[ test ]>

    • New

      Added source, startOffset, startLine, and startColumn parameters to OffsetToLocation constructor, eliminating the need to call setSource() after creating a new OffsetToLocation instance

    • Fixed

      Fixed Raw node value consumption by ignoring stop tokens inside blocks, resolving an issue where Raw value consumption stopped prematurely. This fix also enables parsing of functions whose content includes stop characters (e.g., semicolons and curly braces) within declaration values, aligning with the latest draft of CSS Values and Units L5.

    • Fixed

      Fixed TokenStream#balance computation to handle unmatched brackets correctly. Previously, when encountering a closing bracket, the TokenStream would prioritize it over unmatched opening brackets, leading to improper parsing. For example, the parser would incorrectly consume the declaration value of .a { prop: ([{); } as ([{) instead of consuming it until all opened brackets were closed (([{); }). Now, unmatched closing brackets are discarded unless they match the most recent opening bracket on the stack. This change aligns CSSTree with CSS specifications and browser behavior.

    • Fixed

      Fixed syntax definition parser to allow a token to be followed by a multiplier

    • Fixed

      Fixed location for Layer node

  4. 3.0.1

    Migration needed2 Nov 20245 new · 1 fix
    • Breaking

      Removed second parameter (assign) for the callback in the fork() method (e.g., syntax.fork((config, assign) => { ... })), as it simply refers to Object.assign()

    • New

      Added errors array to the Lexer#validate() method result, providing details on problematic syntax.

    • New

      Added a Lexer#cssWideKeywords dictionary to list CSS-wide keywords

    • New

      Updated the Lexer's constructor to consider config.cssWideKeywords for overriding the default list

    • New

      Expanded the lexer's dump output to include the cssWideKeywords dictionary

    • New

      Modified the fork() method to accept a cssWideKeywords option, allowing the addition of new keywords to the existing list

    • Fixed

      Fixes in syntaxes: <basic-shapes>, <absolute-color-function> and <'stroke-opacity'>

  5. 3.0.0

    11 Sep 202420 new · 6 fixes
  6. 2.0.2 – 2.3.18 releases, no release note

26 other lines we could not sort, mostly version bumps
  • getTokenEnd(tokenIndex) – returns the token's end offset by index, complementing getTokenStart(tokenIndex)

    3.2.0
  • getTokenType(tokenIndex) – returns the token's type by index

    3.2.0
  • isBlockOpenerTokenType(tokenType) – returns true for <function-token>, <(-token>, <[-token>, and <{-token>

    3.2.0
  • isBlockCloserTokenType(tokenType) – returns true for <)-token>, <]-token>, and <}-token>

    3.2.0
  • getBlockTokenPairIndex(tokenIndex) – returns the index of the pair token for a block, or -1 if no pair exists

    3.2.0
  • Changed generate() to not auto insert whitespaces between tokens for raw values

    3.2.0
  • Bumped mdn/data to 2.27.1 and various fixes in syntaxes

    3.2.0
  • Exposed OffsetToLocation class in the main entry point, which was previously accessible only via css-tree/tokenizer

    3.1.0
  • Bumped mdn/data to 2.12.2

    3.1.0
  • Bumped mdn/data to 2.12.1

    3.0.1

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.