wikimedia/css-sanitizer
Classes to parse and sanitize CSS
v6.2.1
6.3M downloads/mo
#1598 most downloaded on Packagist
wikimedia/css-sanitizer
What this package is like to depend on
Last release 5 months ago
04 Mar 2026
Release timing varies
gaps range from 2 weeks to 1.3 years
Nearly every release is documented
notes for 24 of 24 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
24 releases · first in 2017
3 releases in the last 12 months
see the full history below
Release timeline
24 releases · Apr 2017 to Mar 2026Releases
latest 24-
v6.2.104 Mar 2026Release notes
Open source →- Pass first byte to ord() in DataSourceTokenizer for PHP 8.5 compatibility
- Add comprehensive EOF checks in DataSourceTokenizer
-
v6.2.003 Dec 2025Release notes
Open source →- Allow var() inside calc() and other math functions
- Allow color functions inside var() fallback
- Allow color functions inside light-dark() function
- Allow var() inside color functions
-
v6.1.028 Oct 2025Release notes
Open source →- Add support for CSS Scroll Snap Module Level 1
- Fix
ruby-align: space-aroundsupport
-
v6.0.023 Jul 2025Release notes
Open source →New modules:
- Add support for CSS Box Sizing Level 4 (as seen in draft from 2025-02-24)
- values: stretch, fit-content, and contain;
- properties: aspect-ratio, contain-intrinsic-* (size, width, height, block-size, inline-size), min-intrinsic-size;
- Update Color to Level 4 (2025-04-24)
- Update Values and Units to Level 4 (WD 2024-03-12)
- Add support for Ruby Level 1 (WD 2022-12-31)
- Add support for Transforms Level 2 (WD 2021-11-09)
- Update Overflow Level 3 to WD 2023-03-29 and add support for Overflow Level 4 (WD 2023-03-21)
- Add support for Lists and Counters Level 3 (WD 2020-11-17) and Counter Styles Level 3 (WD 2021-07-27)
Substantive updates:
- Update Align Level 3 to WD 2025-03-11
- Update Backgrounds Level 3 to CRD 2024-03-11
- Update Display Level 3 to CR 2023-03-30
- Update Compositing Level 1 to CRD 2024-03-21
- Update Images Level 3 to CRD 2023-12-18
- Update Masking Level 1 to CRD 2021-08-05
- Update Paged Media Level 3 to WD 2023-09-14
- Update Position Level 3 to WD 2025-03-11
- Update Pseudo-Elements Level 4 to WD 2022-12-30
- Update Shapes Level 1 to CRD 2022-11-15
- Update User Interface Level 4 to WD 2021-03-16
Documentation-only updates:
- Update Animations Level 1 to WD 2023-03-02
- Update Cascade Level 4 to CR 2022-01-13
- Update Easing Level 1 to CRD 2023-02-13
- Update Grid Level 1 to CRD 2025-03-26
- Update Multi-column Layout Level 1 to CR 2024-05-16
- Update Syntax Level 3 to CRD 2021-12-24
- Update Text Level 3 to CRD 2024-09-30
- Update Text Decoration Level 3 to CRD 2022-05-05
- Add support for CSS Box Sizing Level 4 (as seen in draft from 2025-02-24)
-
v5.5.027 Jan 2025Release notes
Open source →- Ensure <-token and identifiers are always separated as a security paranoia measure
- Add support for prefers-reduced-motion, prefers-reduced-transparency, prefers-contrast and forced-colors media queries
- Add support for light-dark() color function
- [build] Bump dependencies
-
v5.4.030 Oct 2024Release notes
Open source →-
Add support for
:dir()pseudo-class -
Add support for CSS Logical 1 properties and values
-
code: Use explicit nullable type on parameter arguments
-
build: Phan must ignore EmptyIterator type in UnorderedGroup
-
build: Updating composer dependencies
-
build: Updating mediawiki/mediawiki-codesniffer to 44.0.0
-
build: Allow wikimedia/scopedcallback 5.0.0
-
build: Allow wikimedia/testing-access-wrapper 3.0.0
-
build: Remove use of
$PHPUNIT_ARGS
-
-
v5.3.018 Apr 2024Release notes
Open source →- Harden security by disallowing CSS custom properties for
border-color - Add support for fallback values for CSS custom properties in color attributes.
- Harden security by disallowing CSS custom properties for
-
v5.2.003 Apr 2024Release notes
Open source →- Add support for CSS custom properties in color attributes
- [build] Bump dependencies
-
v5.1.021 Feb 2024Release notes
Open source →- Drop support for wikimedia/utfnormal 2.x
- Change use of AtEase to at operator
- Support @media (prefers-color-scheme:...) rule
- [build] Bump dependencies
-
v5.0.029 Aug 2023Release notes
Open source →- Drop support for PHP < 7.4
- Support wikimedia/utfnormal ^4.0.0
- [build] Bump dependencies
-
v4.0.109 Jul 2022 -
v4.0.003 Jul 2022Release notes
Open source →- Update for new versions of various standards
- Add return types to inbuilt interfaces
- [build] Bump dependencies
-
v3.0.221 Mar 2021 -
v3.0.130 Jan 2021 -
v3.0.004 Jan 2021Release notes
Open source →- Drop support for PHP < 7.2 and HHVM
- Switch to PHPUnit 8; drop support for PHPUnit 4
- Remove support for wikimedia/utfnormal 1.1.0
- Make Parser::CV_DEPTH_LIMIT private
- [BREAKING CHANGE] Rename match() and Match class for PHP 8.0
- [build] Bump dependencies
-
v2.0.111 Feb 2019 -
v2.0.024 Aug 2018Release notes
Open source →- Update for new versions of various standards
- Add CSS Intrinsic and Extrinsic Sizing Level 3
- Add hoisting option to StyleRuleSanitizer selector handling
-
v1.0.618 Apr 2018 -
v1.0.502 Apr 2018 -
v1.0.427 Feb 2018Release notes
Open source →- Optionally depend on wikimedia/utfnormal 2.0.0
- [build] Bump dependencies
-
v1.0.317 Jan 2018 -
v1.0.213 Jun 2017 -
v1.0.106 Jun 2017 -
v1.0.006 Apr 2017