ph-css – Java library for parsing, representing, modifying, and writing CSS stylesheets

ph-css is a Java library for parsing, representing, modifying, and writing CSS stylesheets.

It focuses on the grammatical structure of CSS, letting applications read complete stylesheets or inline declaration lists, traverse CSS objects, adjust rules and URLs, and serialize the result as formatted or optimized output. The project also includes a Maven plugin for compressing CSS files during a build.

This is free and open source software.

Key Features

  • Reads complete CSS files and CSS declaration lists from files, readers, stream providers, or strings.
  • Represents stylesheets as Java objects covering imports, namespaces, style rules, media rules, font-face rules, keyframes, supports rules, layer rules, and unknown at-rules.
  • Provides visitor APIs for iterating through declarations and URLs, including support for modifying URL references inside stylesheets.
  • Writes CSS as formatted output or optimized output, with options for minification and removal of unnecessary code.
  • Includes utilities for CSS colours, units, numbers, rectangles, data URLs, media queries, and selected shorthand properties.

Website: github.com/phax/ph-css
Support:
Developer: Philip Helger
License: Apache License 2.0

ph-css is written in Java. Learn Java with our recommended free books and free tutorials.


Related Software

CSS Parsers
PostCSSTransform styles with JavaScript plugins
Lightning CSSParser, transformer, bundler, and minifier
ReworkPlugin framework for CSS preprocessing
MenschNon-validating CSS parser
CSSTreeTool set for CSS
StylisLightweight CSS preprocessor
tinycss2CSS parser and generator
LibCSSCSS parser and selection engine
Ruby CSS ParserLoad, parse and cascade CSS rule sets
ParserLibCSS3 SAX-inspired parser
css-parserFork of the cssutils project
StylecowModern CSS to all browsers
Gonzales PECSS parser which plays nicely with preprocessors
CSSOMCSS parser written in pure JavaScript

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted