PHP CSS Parser is a PHP library for reading CSS and turning it into a structured document model that applications can inspect, modify, and render back to CSS.
It’s designed for developers who need programmatic access to stylesheets, whether for cleaning CSS, rewriting declarations, analysing rules, or generating optimized output from parsed CSS.
This is free and open source software.
Key Features
- Parses CSS strings or files into a manipulable PHP object structure.
- Allows rules, declarations, selectors, and values to be inspected and changed before output.
- Renders parsed documents back to CSS, including optimized output formatting.
- Installs via Composer using the sabberworm/php-css-parser package.
- Supports modern CSS parsing improvements, including container queries and CSS Color Module Level 4 syntax.
Website: github.com/MyIntervals/PHP-CSS-Parser
Support:
Developer: MyIntervals
License: MIT License
PHP CSS Parser is written in PHP. Learn PHP with our recommended free books and free tutorials.
Related Software
| CSS Parsers | |
|---|---|
| PostCSS | Transform styles with JavaScript plugins |
| Lightning CSS | Parser, transformer, bundler, and minifier |
| Rework | Plugin framework for CSS preprocessing |
| Mensch | Non-validating CSS parser |
| CSSTree | Tool set for CSS |
| Stylis | Lightweight CSS preprocessor |
| tinycss2 | CSS parser and generator |
| LibCSS | CSS parser and selection engine |
| Ruby CSS Parser | Load, parse and cascade CSS rule sets |
| ParserLib | CSS3 SAX-inspired parser |
| css-parser | Fork of the cssutils project |
| Stylecow | Modern CSS to all browsers |
| Gonzales PE | CSS parser which plays nicely with preprocessors |
| CSSOM | CSS parser written in pure JavaScript |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |

