PackageTrack
Sign in Get early access

sabberworm/php-css-parser

Parser for CSS Files written in PHP

v9.4.0 225M downloads/mo #165 most downloaded on composer MyIntervals/PHP-CSS-Parser

What this package is like to depend on

Last release 2 months ago

18 Jun 2026

Ships unpredictably

gaps range from 1 weeks to 2.1 years

Most releases are documented

notes for 39 of 53 stable releases

Nothing withdrawn

no release was ever pulled

14 years old

53 releases · first in 2012

4 releases in the last 12 months

see the full history below

Release timeline

53 releases · Dec 2012 to Jun 2026
2013 2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 53
  1. v9.4.0 18 Jun 2026
    Release notes

    What's Changed

    Deprecated

    • Deprecate support for PHP 7.2 and 7.3 (#1565)

    Fixed

    • Allow CSS containing only whitespace or comments (#1593)
    • Only allow strings as LineName components (#1590)

    Full Changelog: v9.3.0...v9.4.0

    Open source →
    Release notes

    Deprecated

    • Deprecate support for PHP 7.2 and 7.3 (#1565)

    Fixed

    • Allow CSS containing only whitespace or comments (#1593)
    • Only allow strings as LineName components (#1590)
    Open source →
  2. v9.3.0 03 Mar 2026
    Release notes

    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

    Open source →
    Release notes

    Added

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

    Fixed

    • Avoid double autoloading of class aliases (#1552)

    Documentation

    Open source →
  3. v9.2.0 21 Feb 2026
    Release notes

    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

    Open source →
    Release notes

    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)
    Open source →
  4. v9.1.0 14 Sep 2025
    Release notes

    Added

    • Add support for PHP 8.5 (#1355)

    Fixed

    • Improve performance of selector validation
      (avoiding silent PCRE catastrophic failure) (#1372)
    • Use typesafe versions of PHP functions (#1368, #1370)
    Open source →
    Release notes

    Added

    • Add support for PHP 8.5 (#1355)

    Fixed

    • Improve performance of selector validation (avoiding silent PCRE catastrophic failure) (#1372)
    • Use typesafe versions of PHP functions (#1368, #1370)
    Open source →
  5. v9.0.0 27 Jul 2025
    Release notes

    Added

    • Interface RuleContainer for RuleSet Rule manipulation methods (#1256)
    • Partial support for CSS Color Module Level 4:
      • rgb and rgba, and hsl and hsla are now aliases (#797)
      • Parse color functions that use the "modern" syntax (#800)
      • Render RGB functions with "modern" syntax when required (#840)
      • Support none as color function component value (#859)
    • Add a class diagram to the README (#482)
    • Add more tests (#449)

    Changed

    • DeclarationBlock no longer extends RuleSet and instead has a RuleSet as
      a property; use getRuleSet() to access it directly (#1194)
    • The default line (and column) number is now null (not zero) (#1288)
    • setPosition() (in Rule and other classes) now has fluent interface,
      returning itself (#1259)
    • RuleSet::removeRule() now only allows Rule as the parameter
      (implementing classes are AtRuleSet and DeclarationBlock);
      use removeMatchingRules() or removeAllRules() for other functions (#1255)
    • RuleSet::getRules() and getRulesAssoc() now only allow string or null
      as the parameter (implementing classes are AtRuleSet and DeclarationBlock)
      (#1253)
    • Initialize KeyFrame properties to sensible defaults (#1146)
    • Make OutputFormat final (#1128)
    • Make Selector a Renderable (#1017)
    • Only allow string for some OutputFormat properties (#885)
    • Use more native type declarations and strict mode
      (#641, #772, #774, #778, #804, #841, #873, #875, #891, #922, #923, #933, #958,
      #964, #967, #1000, #1044, #1134, #1136, #1137, #1139, #1140, #1141, #1145,
      #1162, #1163, #1166, #1172, #1174, #1178, #1179, #1181, #1183, #1184, #1186,
      #1187, #1190, #1192, #1193, #1203)
    • Add visibility to all class/interface constants (#469)

    Removed

    • Remove getLineNo() from these classes (use getLineNumber() instead):
      Comment, CSSList, SourceException, Charset, CSSNamespace, Import,
      Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1258)
    • Remove Rule::getColNo() (use getColumnNumber() instead) (#1287)
    • Passing a string as the first argument to getAllValues() is no longer
      supported and will not work;
      the search pattern should now be passed as the second argument (#1243)
    • Passing a Boolean as the second argument to getAllValues() is no longer
      supported and will not work; the flag for searching in function arguments
      should now be passed as the third argument (#1243)
    • Remove __toString() (#1046)
    • Drop magic method forwarding in OutputFormat (#898)
    • Drop atRuleArgs() from the AtRule interface (#1141)
    • Remove OutputFormat::get() and ::set() (#1108, #1110)
    • Drop special support for vendor prefixes (#1083)
    • Remove the IE hack in Rule (#995)
    • Drop getLineNo() from the Renderable interface (#1038)
    • Remove OutputFormat::level() (#874)
    • Remove expansion of shorthand properties (#838)
    • Remove Parser::setCharset/getCharset (#808)
    • Remove Rule::getValues() (#582)
    • Remove Rule::setValues() (#562)
    • Remove Document::getAllSelectors() (#561)
    • Remove DeclarationBlock::getSelector() (#559)
    • Remove DeclarationBlock::setSelector() (#560)
    • Drop support for PHP < 7.2 (#420)

    Fixed

    • Remove trailing semicolon from declaration blocks with 'compact'
      OutputFormat (#1345)
    • Parse selector functions (like :not) with comma-separated arguments (#1292)
    • Parse quoted attribute selector value containing comma (#1323)
    • Allow comma in selectors (e.g. :not(html, body)) (#1293)
    • Insert Rule before sibling even with different property name
      (in RuleSet::addRule()) (#1270)
    • Ensure RuleSet::addRule() sets non-negative column number when sibling
      provided (#1268)
    • Don't render rgb colors with percentage values using hex notation (#803)

    Documentation

    • Add an API and deprecation policy (#720)

    @ziegenberg is a new contributor to this release and did a lot of the heavy
    lifting. Thanks! ❤️

    Open source →
    Release notes

    Added

    • Interface RuleContainer for RuleSet Rule manipulation methods (#1256)
    • Partial support for CSS Color Module Level 4:
      • rgb and rgba, and hsl and hsla are now aliases (#797)
      • Parse color functions that use the "modern" syntax (#800)
      • Render RGB functions with "modern" syntax when required (#840)
      • Support none as color function component value (#859)
    • Add a class diagram to the README (#482)
    • Add more tests (#449)

    Changed

    • DeclarationBlock no longer extends RuleSet and instead has a RuleSet as a property; use getRuleSet() to access it directly (#1194)
    • The default line (and column) number is now null (not zero) (#1288)
    • setPosition() (in Rule and other classes) now has fluent interface, returning itself (#1259)
    • RuleSet::removeRule() now only allows Rule as the parameter (implementing classes are AtRuleSet and DeclarationBlock); use removeMatchingRules() or removeAllRules() for other functions (#1255)
    • RuleSet::getRules() and getRulesAssoc() now only allow string or null as the parameter (implementing classes are AtRuleSet and DeclarationBlock) (#1253)
    • Initialize KeyFrame properties to sensible defaults (#1146)
    • Make OutputFormat final (#1128)
    • Make Selector a Renderable (#1017)
    • Only allow string for some OutputFormat properties (#885)
    • Use more native type declarations and strict mode (#641, #772, #774, #778, #804, #841, #873, #875, #891, #922, #923, #933, #958, #964, #967, #1000, #1044, #1134, #1136, #1137, #1139, #1140, #1141, #1145, #1162, #1163, #1166, #1172, #1174, #1178, #1179, #1181, #1183, #1184, #1186, #1187, #1190, #1192, #1193, #1203)
    • Add visibility to all class/interface constants (#469)

    Removed

    • Remove getLineNo() from these classes (use getLineNumber() instead): Comment, CSSList, SourceException, Charset, CSSNamespace, Import, Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1258)
    • Remove Rule::getColNo() (use getColumnNumber() instead) (#1287)
    • Passing a string as the first argument to getAllValues() is no longer supported and will not work; the search pattern should now be passed as the second argument (#1243)
    • Passing a Boolean as the second argument to getAllValues() is no longer supported and will not work; the flag for searching in function arguments should now be passed as the third argument (#1243)
    • Remove __toString() (#1046)
    • Drop magic method forwarding in OutputFormat (#898)
    • Drop atRuleArgs() from the AtRule interface (#1141)
    • Remove OutputFormat::get() and ::set() (#1108, #1110)
    • Drop special support for vendor prefixes (#1083)
    • Remove the IE hack in Rule (#995)
    • Drop getLineNo() from the Renderable interface (#1038)
    • Remove OutputFormat::level() (#874)
    • Remove expansion of shorthand properties (#838)
    • Remove Parser::setCharset/getCharset (#808)
    • Remove Rule::getValues() (#582)
    • Remove Rule::setValues() (#562)
    • Remove Document::getAllSelectors() (#561)
    • Remove DeclarationBlock::getSelector() (#559)
    • Remove DeclarationBlock::setSelector() (#560)
    • Drop support for PHP < 7.2 (#420)

    Fixed

    • Remove trailing semicolon from declaration blocks with 'compact' OutputFormat (#1345)
    • Parse selector functions (like :not) with comma-separated arguments (#1292)
    • Parse quoted attribute selector value containing comma (#1323)
    • Allow comma in selectors (e.g. :not(html, body)) (#1293)
    • Insert Rule before sibling even with different property name (in RuleSet::addRule()) (#1270)
    • Ensure RuleSet::addRule() sets non-negative column number when sibling provided (#1268)
    • Don't render rgb colors with percentage values using hex notation (#803)

    Documentation

    • Add an API and deprecation policy (#720)

    @ziegenberg is a new contributor to this release and did a lot of the heavy lifting. Thanks! :heart:

    Open source →
  6. v8.9.0 11 Jul 2025
    Release notes

    Added

    • RuleSet::removeMatchingRules() method
      (for the implementing classes AtRuleSet and DeclarationBlock) (#1249)
    • RuleSet::removeAllRules() method
      (for the implementing classes AtRuleSet and DeclarationBlock) (#1249)
    • Add Interface CSSElement (#1231)
    • Methods getLineNumber and getColumnNumber which return a nullable int
      for the following classes:
      Comment, CSSList, SourceException, Charset, CSSNamespace, Import,
      Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1225, #1263)
    • Positionable interface for CSS items that may have a position
      (line and perhaps column number) in the parsed CSS (#1221)

    Changed

    • Parameters for getAllValues() are deconflated, so it now takes three (all
      optional), allowing $element and $ruleSearchPattern to be specified
      separately (#1241)
    • Implement Positionable in the following CSS item classes:
      Comment, CSSList, SourceException, Charset, CSSNamespace, Import,
      Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1225)

    Deprecated

    • Support for PHP < 7.2 is deprecated; version 9.0 will require PHP 7.2 or later
      (#1264)
    • Passing a string or null to RuleSet::removeRule() is deprecated
      (implementing classes are AtRuleSet and DeclarationBlock);
      use removeMatchingRules() or removeAllRules() instead (#1249)
    • Passing a Rule to RuleSet::getRules() or getRulesAssoc() is deprecated,
      affecting the implementing classes AtRuleSet and DeclarationBlock
      (call e.g. getRules($rule->getRule()) instead) (#1248)
    • Passing a string as the first argument to getAllValues() is deprecated;
      the search pattern should now be passed as the second argument (#1241)
    • Passing a Boolean as the second argument to getAllValues() is deprecated;
      the flag for searching in function arguments should now be passed as the third
      argument (#1241)
    • getLineNo() is deprecated in these classes (use getLineNumber() instead):
      Comment, CSSList, SourceException, Charset, CSSNamespace, Import,
      Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1225, #1233)
    • Rule::getColNo() is deprecated (use getColumnNumber() instead)
      (#1225, #1233)
    • Providing zero as the line number argument to Rule::setPosition() is
      deprecated (pass null instead if there is no line number) (#1225, #1233)

    Fixed

    • Set line number when RuleSet::addRule() called with only column number set
      (#1265)
    • Ensure first rule added with RuleSet::addRule() has valid position (#1262)
    Open source →
    Release notes

    Added

    • RuleSet::removeMatchingRules() method (for the implementing classes AtRuleSet and DeclarationBlock) (#1249)
    • RuleSet::removeAllRules() method (for the implementing classes AtRuleSet and DeclarationBlock) (#1249)
    • Add Interface CSSElement (#1231)
    • Methods getLineNumber and getColumnNumber which return a nullable int for the following classes: Comment, CSSList, SourceException, Charset, CSSNamespace, Import, Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1225, #1263)
    • Positionable interface for CSS items that may have a position (line and perhaps column number) in the parsed CSS (#1221)

    Changed

    • Parameters for getAllValues() are deconflated, so it now takes three (all optional), allowing $element and $ruleSearchPattern to be specified separately (#1241)
    • Implement Positionable in the following CSS item classes: Comment, CSSList, SourceException, Charset, CSSNamespace, Import, Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1225)

    Deprecated

    • Support for PHP < 7.2 is deprecated; version 9.0 will require PHP 7.2 or later (#1264)
    • Passing a string or null to RuleSet::removeRule() is deprecated (implementing classes are AtRuleSet and DeclarationBlock); use removeMatchingRules() or removeAllRules() instead (#1249)
    • Passing a Rule to RuleSet::getRules() or getRulesAssoc() is deprecated, affecting the implementing classes AtRuleSet and DeclarationBlock (call e.g. getRules($rule->getRule()) instead) (#1248)
    • Passing a string as the first argument to getAllValues() is deprecated; the search pattern should now be passed as the second argument (#1241)
    • Passing a Boolean as the second argument to getAllValues() is deprecated; the flag for searching in function arguments should now be passed as the third argument (#1241)
    • getLineNo() is deprecated in these classes (use getLineNumber() instead): Comment, CSSList, SourceException, Charset, CSSNamespace, Import, Rule, DeclarationBlock, RuleSet, CSSFunction, Value (#1225, #1233)
    • Rule::getColNo() is deprecated (use getColumnNumber() instead) (#1225, #1233)
    • Providing zero as the line number argument to Rule::setPosition() is deprecated (pass null instead if there is no line number) (#1225, #1233)

    Fixed

    • Set line number when RuleSet::addRule() called with only column number set (#1265)
    • Ensure first rule added with RuleSet::addRule() has valid position (#1262)
    Open source →
  7. v8.8.0 23 Mar 2025
    Release notes

    Added

    • OutputFormat properties for space around specific list separators (#880)

    Changed

    • Mark the OutputFormat constructor as @internal (#1131)
    • Mark OutputFormatter as @internal (#896)
    • Mark Selector::isValid() as @internal (#1037)
    • Mark parsing-related methods of most CSS elements as @internal (#908)
    • Mark OutputFormat::nextLevel() as @internal (#901)
    • Make all non-private properties @internal (#886)

    Deprecated

    • Deprecate extending OutputFormat (#1131)
    • Deprecate OutputFormat::get() and ::set() (#1107)
    • Deprecate support for -webkit-calc and -moz-calc (#1086)
    • Deprecate magic method forwarding from OutputFormat to OutputFormatter
      (#894)
    • Deprecate __toString() (#1006)
    • Deprecate greedy calculation of selector specificity (#1018)
    • Deprecate the IE hack in Rule (#993, #1003)
    • OutputFormat properties for space around list separators as an array (#880)
    • Deprecate OutputFormat::level() (#870)

    Fixed

    • Include comments for all rules in declaration block (#1169)
    • Render rules in line and column number order (#1059)
    • Create Size with correct types in expandBackgroundShorthand (#814)
    • Parse @font-face src property as comma-delimited list (#794)
    Open source →
    Release notes

    Added

    • OutputFormat properties for space around specific list separators (#880)

    Changed

    • Mark the OutputFormat constructor as @internal (#1131)
    • Mark OutputFormatter as @internal (#896)
    • Mark Selector::isValid() as @internal (#1037)
    • Mark parsing-related methods of most CSS elements as @internal (#908)
    • Mark OutputFormat::nextLevel() as @internal (#901)
    • Make all non-private properties @internal (#886)

    Deprecated

    • Deprecate extending OutputFormat (#1131)
    • Deprecate OutputFormat::get() and ::set() (#1107)
    • Deprecate support for -webkit-calc and -moz-calc (#1086)
    • Deprecate magic method forwarding from OutputFormat to OutputFormatter (#894)
    • Deprecate __toString() (#1006)
    • Deprecate greedy calculation of selector specificity (#1018)
    • Deprecate the IE hack in Rule (#993, #1003)
    • OutputFormat properties for space around list separators as an array (#880)
    • Deprecate OutputFormat::level() (#870)

    Fixed

    • Include comments for all rules in declaration block (#1169)
    • Render rules in line and column number order (#1059)
    • Create Size with correct types in expandBackgroundShorthand (#814)
    • Parse @font-face src property as comma-delimited list (#794)
    Open source →
  8. v8.7.0 27 Oct 2024
    Release notes

    Added

    Changed

    • Mark parsing-internal classes and methods as @internal (#711)
    • Block installations on unsupported higher PHP versions (#691)

    Deprecated

    • Deprecate the expansion of shorthand properties (#719)
    • Deprecate Parser::setCharset() and Parser::getCharset() (#703)
    Open source →
    Release notes

    Added

    • Add support for PHP 8.4 (#643, #657)

    Changed

    • Mark parsing-internal classes and methods as @internal (#674)
    • Block installations on unsupported higher PHP versions (#691)

    Deprecated

    • Deprecate the expansion of shorthand properties (#578, #580, #579, #577, #576, #575, #574, #573, #572, #571, #570, #569, #566, #567, #558, #714)
    • Deprecate Parser::setCharset() and Parser::getCharset() (#688)

    Fixed

    • Fix type errors in PHP strict mode (#664)
    Open source →
  9. v8.6.0 01 Jul 2024
    Release notes

    Added

    • Support arithmetic operators in CSS function arguments (#607)
    • Add support for inserting an item in a CSS list (#545)
    • Add support for the dvh, lvh and svh length units (#415)

    Changed

    • Improve performance of Value::parseValue with many delimiters by refactoring to remove array_search() (#413)
    Open source →
    Release notes

    Added

    • Support arithmetic operators in CSS function arguments (#607)
    • Add support for inserting an item in a CSS list (#545)
    • Add support for the dvh, lvh and svh length units (#415)

    Changed

    • Improve performance of Value::parseValue with many delimiters by refactoring to remove array_search() (#413)
    Open source →
  10. v8.5.2 28 Jun 2024
    Release notes

    Changed

    • Mark all class constants as @internal (#500)

    Fixed

    • Fix undefined local variable in CalcFunction::parse() (#593)
    Open source →
    Release notes

    Changed

    • Mark all class constants as @internal (#472)

    Fixed

    • Fix undefined local variable in CalcFunction::parse() (#593)
    Open source →
  11. v8.5.1 15 Feb 2024
    Release notes

    Fixed

    • Fix PHP notice caused by parsing invalid color values having less than 6 characters (#485)
    • Fix (regression) failure to parse at-rules with strict parsing (#456)
    Open source →
  12. 8.5.0 01 Feb 2024
    Release notes

    Added

    • Add a method to get an import's media queries (#384)
    • Add more unit tests (#381, #382)

    Fixed

    • Retain CSSList and Rule comments when rendering CSS (#351)
    • Replace invalid turns unit with turn (#350)
    • Also allow string values for rules (#348)
    • Fix invalid calc parsing (#169)
    • Handle scientific notation when parsing sizes (#179)
    • Fix PHP 8.1 compatibility in ParserState::strsplit() (#344)
    Open source →
  13. 8.4.0 11 Dec 2021
    Release notes

    Features

    • Support for PHP 8.x
    • PHPDoc annotations
    • Allow usage of CSS variables inside color functions (by parsing them as regular functions)
    • Use PSR-12 code style
    • No deprecations

    Bugfixes

    • Improved handling of whitespace in calc()
    • Fix parsing units whose prefix is also a valid unit, like vmin
    • Allow passing an object to CSSList#replace
    • Fix PHP 7.3 warnings
    • Correctly parse keyframes with %
    • Don’t convert large numbers to scientific notation
    • Allow a file to end after an @import
    • Preserve case of CSS variables as specced
    • Allow identifiers to use escapes the same way as strings
    • No longer use eval for the comparison in getSelectorsBySpecificity, in case it gets passed untrusted input (CVE-2020-13756). Also fixed in 8.3.1, 8.2.1, 8.1.1, 8.0.1, 7.0.4, 6.0.2, 5.2.1, 5.1.3, 5.0.9, 4.0.1, 3.0.1, 2.0.1, 1.0.1.
    • Prevent an infinite loop when parsing invalid grid line names
    • Remove invalid unit vm
    • Retain rule order after expanding shorthands

    Backwards-incompatible changes

    • PHP ≥ 5.6 is now required
    • HHVM compatibility target dropped
    Open source →
  14. 8.3.1 01 Jun 2020

    Nothing published for this version

  15. 8.3.0 22 Feb 2019
    Release notes
    • Refactor parsing logic to mostly reside in the class files whose data structure is to be parsed (this should eventually allow us to unit-test specific parts of the parsing logic individually).
    • Fix error in parsing calc expessions when the first operand is a negative number, thanks to @raxbg.
    • Support parsing CSS4 colors in hex notation with alpha values, thanks to @raxbg.
    • Swallow more errors in lenient mode, thanks to @raxbg.
    • Allow specifying arbitrary strings to output before and after declaration blocks, thanks to @westonruter.
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  16. 8.2.1 01 Jun 2020

    Nothing published for this version

  17. 8.2.0 13 Jul 2018
    Release notes
    • Support parsing calc(), thanks to @raxbg.
    • Support parsing grid-lines, again thanks to @raxbg.
    • Support parsing legacy IE filters (progid:) in lenient mode, thanks to @FMCorz
    • Performance improvements parsing large files, again thanks to @FMCorz
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  18. 8.1.1 01 Jun 2020

    Nothing published for this version

  19. 8.1.0 19 Jul 2016
    Release notes
    • Comments are no longer silently ignored but stored with the object with which they appear (no render support, though). Thanks to @FMCorz.
    • The IE hacks using \0 and \9 can now be parsed (and rendered) in lenient mode. Thanks (again) to @FMCorz.
    • Media queries with or without spaces before the query are parsed. Still no real parsing support, though. Sorry…
    • PHPUnit is now listed as a dev-dependency in composer.json.
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  20. 8.0.1 01 Jun 2020

    Nothing published for this version

  21. 8.0.0 30 Jun 2016
    Release notes
    • Store source CSS line numbers in tokens and parsing exceptions.
    • No deprecations

    Backwards-incompatible changes

    • Unrecoverable parser errors throw an exception of type Sabberworm\CSS\Parsing\SourceException instead of \Exception.
    Open source →
  22. 7.0.4 01 Jun 2020

    Nothing published for this version

  23. 7.0.3 26 Apr 2016
    Release notes
    • Fixed parsing empty CSS when multibyte is off
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  24. 7.0.2 11 Feb 2016
    Release notes
    • 150 time performance boost thanks to @ossinkine
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  25. 7.0.1 25 Dec 2015
    Release notes
    • No more suppressed E_NOTICE
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  26. 7.0.0 24 Aug 2015
    Release notes
    • Compatibility with PHP 7. Well timed, eh?
    • No deprecations

    Backwards-incompatible changes

    • The Sabberworm\CSS\Value\String class has been renamed to Sabberworm\CSS\Value\CSSString.
    Open source →
  27. 6.0.2 01 Jun 2020

    Nothing published for this version

  28. 6.0.1 24 Aug 2015
    Release notes
    • Remove some declarations in interfaces incompatible with PHP 5.3 (< 5.3.9)
    • No deprecations
    Open source →
  29. 6.0.0 03 Jul 2014
    Release notes
    • Format output using Sabberworm\CSS\OutputFormat
    • No backwards-incompatible changes

    Deprecations

    • The parse() method replaces __toString with an optional argument (instance of the OutputFormat class)
    Open source →
  30. 5.2.1 01 Jun 2020

    Nothing published for this version

  31. 5.2.0 30 Jun 2014
    Release notes
    • Support removing a selector from a declaration block using $oBlock->removeSelector($mSelector)

    • Introduce a specialized exception (Sabberworm\CSS\Parsing\OuputException) for exceptions during output rendering

    • No deprecations

    Backwards-incompatible changes

    • Outputting a declaration block that has no selectors throws an OuputException instead of outputting an invalid {…} into the CSS document.
    Open source →
  32. 5.1.3 01 Jun 2020

    Nothing published for this version

  33. 5.1.2 24 Apr 2014
    Release notes
    • Remove the use of consumeUntil in comment parsing. This makes it possible to parse comments such as /** Perfectly valid **/
    • Add fr relative size unit
    • Fix some issues with HHVM
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  34. 5.1.1 28 Oct 2013
    Release notes
    • Updated CHANGELOG.md to reflect changes since 5.0.4
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  35. 5.1.0 23 Oct 2013
    Release notes
    • Performance enhancements by Michael M Slusarz
    • More rescue entry points for lenient parsing (unexpected tokens between declaration blocks and unclosed comments)
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  36. 5.0.9 01 Jun 2020

    Nothing published for this version

  37. 5.0.8 15 Aug 2013
    Release notes
    • Make default settings’ multibyte parsing option dependent on whether or not the mbstring extension is actually installed.
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  38. 5.0.7 04 Aug 2013
    Release notes
    • Fix broken decimal point output optimization
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  39. 5.0.6 31 May 2013
    Release notes
    • Fix broken unit test
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  40. 5.0.5 17 Apr 2013
    Release notes
    • Initial support for lenient parsing (setting this parser option will catch some exceptions internally and recover the parser’s state as neatly as possible).
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  41. 5.0.4 21 Mar 2013
    Release notes
    • Don’t output floats with locale-aware separator chars
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  42. 5.0.3 21 Mar 2013
    Release notes
    • More size units recognized
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  43. 5.0.2 21 Mar 2013
    Release notes
    • CHANGELOG.md file added to distribution
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  44. 5.0.1 20 Mar 2013
    Release notes
    • Internal cleanup
    • No backwards-incompatible changes
    • No deprecations
    Open source →
  45. 5.0.0 20 Mar 2013
    Release notes
    • Correctly parse all known CSS 3 units (including Hz and kHz).
    • Output RGB colors in short (#aaa or #ababab) notation
    • Be case-insensitive when parsing identifiers.
    • No deprecations

    Backwards-incompatible changes

    • Sabberworm\CSS\Value\Color’s __toString method overrides CSSList’s to maybe return something other than type(value, …) (see above).
    Open source →
  46. 4.0.1 01 Jun 2020

    Nothing published for this version

  47. 4.0.0 19 Mar 2013
    Release notes
    • Support for more @-rules
    • Generic interface Sabberworm\CSS\Property\AtRule, implemented by all @-rule classes
    • No deprecations

    Backwards-incompatible changes

    • Sabberworm\CSS\RuleSet\AtRule renamed to Sabberworm\CSS\RuleSet\AtRuleSet
    • Sabberworm\CSS\CSSList\MediaQuery renamed to Sabberworm\CSS\RuleSet\CSSList\AtRuleBlockList with differing semantics and API (which also works for other block-list-based @-rules like @supports).
    Open source →
  48. 3.0.1 01 Jun 2020

    Nothing published for this version

  49. 3.0.0 06 Mar 2013
    Release notes
    • Support for lenient parsing (on by default)
    • No deprecations

    Backwards-incompatible changes

    • All properties (like whether or not to use mb_-functions, which default charset to use and – new – whether or not to be forgiving when parsing) are now encapsulated in an instance of Sabberworm\CSS\Settings which can be passed as the second argument to Sabberworm\CSS\Parser->__construct().
    • Specifying a charset as the second argument to Sabberworm\CSS\Parser->__construct() is no longer supported. Use Sabberworm\CSS\Settings::create()->withDefaultCharset('some-charset') instead.
    • Setting Sabberworm\CSS\Parser->bUseMbFunctions has no effect. Use Sabberworm\CSS\Settings::create()->withMultibyteSupport(true/false) instead.
    • Sabberworm\CSS\Parser->parse() may throw a Sabberworm\CSS\Parsing\UnexpectedTokenException when in strict parsing mode.
    Open source →
  50. 2.0.1 01 Jun 2020

    Nothing published for this version

  51. 2.0.0 29 Jan 2013
    Release notes
    • Allow multiple rules of the same type per rule set

    Backwards-incompatible changes

    • Sabberworm\CSS\RuleSet->getRules() returns an index-based array instead of an associative array. Use Sabberworm\CSS\RuleSet->getRulesAssoc() (which eliminates duplicate rules and lets the later rule of the same name win).
    • Sabberworm\CSS\RuleSet->removeRule() works as it did before except when passed an instance of Sabberworm\CSS\Rule\Rule, in which case it would only remove the exact rule given instead of all the rules of the same type. To get the old behaviour, use Sabberworm\CSS\RuleSet->removeRule($oRule->getRule();
    Open source →
  52. 1.0.1 01 Jun 2020

    Nothing published for this version

  53. 1.0.0 12 Dec 2012

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive