PHP CSS Parser v9.3.0 Release Notes

Release Date: 2026-03-03 // 4 months ago
  • ➕ Added

    • ➕ Add support for modern CSS at-rules: @layer, @scope, and @starting-style (#1549)

    🛠 Fixed

    • 📜 Avoid double autoloading of class aliases (#1552)

    🆕 New Contributors

    Full Changelog : v9.2.0...v9.3.0


Previous changes from v9.2.0

  • ➕ Added

    • ➕ Add OutputFormat::setSpaceAroundSelectorCombinator() (#1504)
    • ➕ Add support for escaped quotes in the selectors (#1485, #1489)
    • 👻 Provide line number in exception message for mismatched parentheses in
      📜 selector (#1435)
    • ➕ Add support for CSS container queries (#1400)

    🔄 Changed

    • 📜 RuleSet\RuleContainer is renamed to RuleSet\DeclarationList (#1530, #1539)
    • Methods like setRule() in RuleSet and DeclarationBlock have been renamed
      📜 to setDeclaration(), etc. (#1521)
    • Rule\Rule class is renamed to Property\Declaration
      📜 (#1508, #1512, #1513, #1522)
    • Rule::setRule() and getRule() are replaced with setPropertyName() and
      📜 getPropertyName() (#1506)
    • Selector is now represented as a sequence of Selector\Component objects
      which can be accessed via getComponents(), manipulated individually, or set
      📜 via setComponents() (#1478, #1486, #1487, #1488, #1494, #1496, #1536, #1537)
    • 👻 Selector::setSelector() and Selector constructor will now throw exception
      📜 upon provision of an invalid selectior (#1498, #1502)
    • 📜 Clean up extra whitespace in CSS selector (#1398)
    • The array keys passed to DeclarationBlock::setSelectors() are no longer
      📜 preserved (#1407)

    🗄 Deprecated

    • 🗄 RuleSet\RuleContainer is deprecated; use RuleSet\DeclarationList instead
      📜 (#1530)
    • 🗄 Methods like setRule() in RuleSet and DeclarationBlock are deprecated;
      📜 there are direct replacements such as setDeclaration() (#1521)
    • 🗄 Rule\Rule class is deprecated; Property\Declaration is a direct
      📜 replacement (#1508)
    • 🗄 Rule::setRule() and getRule() are deprecated and replaced with
      📜 setPropertyName() and getPropertyName() (#1506, #1519)

    🛠 Fixed

    • 📜 Do not escape characters that do not need escaping in CSS string (#1444)
    • 📜 Reject selector comprising only whitespace (#1433)
    • 👌 Improve recovery parsing when a rogue } is encountered (#1425, #1426)
    • 📜 Parse comment(s) immediately preceding a selector (#1421, #1424)
    • 📜 Parse consecutive comments (#1421)
    • 👌 Support attribute selectors with values containing commas in
      📜 DeclarationBlock::setSelectors() (#1419)
    • 👍 Allow removeDeclarationBlockBySelector() to be order-insensitve (#1406)
    • 🛠 Fix parsing of calc expressions when a newline immediately precedes or
      📜 follows a + or - operator (#1399)
    • 📜 Use typesafe versions of PHP functions (#1379, #1380, #1382, #1383, #1384)

    🆕 New Contributors

    Full Changelog : v9.1.0...v9.2.0