Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Java CSS Stream Parser
Failed to load latest commit information.
CSS Parser updated simple test
.gitignore Initial commit
LICENSE Initial commit updated readme

CSS Stream Parser for Java


This is a Stream Parser for reading Cascading Style-Sheets (CSS) using Java. Used correctly, this can provide a fast and efficient way for parsing CSS. It is also designed to be scalable for new versions of CSS, in that adding additional support for At-Rules is straight-forward, adding new syntax is relatively straight-forward, and all of the current features are supported (as of January, 2014).

I am currently using this project in the droidQuery project, to use CSS to manipulate the Android UI. Apart from that, this library has not been extensively tested. If you find any issues, please report them here.


The simplest way to include jCSS-Parser in your project is to build using ant, then include the jar in your build path. The simplest way to parse a CSS file is using the following code:

    //First get the input stream. For example, from a file
    InputStream is = new FileInputStream(new File("/path/to/my/CSS/main.css"));

    //Then parse        
    CSSParser parser = new CSSParser(is, new DefaultCSSHandler());
catch (Throwable t)

For more help, see


Copyright 2013 Phil Brown

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Something went wrong with that request. Please try again.