Is there a CSS parser for C#?

C#CssParsing

C# Problem Overview


My program need to parse css files into an in-memory object format. Any advice on how this should be done ?

C# Solutions


Solution 1 - C#

ExCSS (supports CSS2.1 and CSS3) on GitHub: <https://github.com/TylerBrinks/ExCSS>;.

Which is a newer version of the code project article: <http://www.codeproject.com/KB/recipes/CSSParser.aspx>

Solution 2 - C#

And a slightly slower search turns up the blog post "CSS parser class in .NET" which embeds this gist on GitHub (in case the blog ever dies).

Solution 3 - C#

There is a CSS grammar file for GoldParser:

http://goldparser.org/grammars/files/css.zip

GoldParser is easy to include in a C# project, and generates an real LALR parser - not some regex hack.

Solution 4 - C#

Have you tried the one featured in JsonFx? It's written in C#, parses CSS3 syntax and is distributed under a MIT style license.

Solution 5 - C#

I wrote one, using the grammar specified in the CSS 2.1 spec. I have also released it now: for details, see http://www.modeltext.com/css/

Solution 6 - C#

Here you can find another one especially for C# with sample source.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionKenView Question on Stackoverflow
Solution 1 - C#Jon TackaburyView Answer on Stackoverflow
Solution 2 - C#mercatorView Answer on Stackoverflow
Solution 3 - C#matt woodardView Answer on Stackoverflow
Solution 4 - C#m0saView Answer on Stackoverflow
Solution 5 - C#ChrisWView Answer on Stackoverflow
Solution 6 - C#dajoodView Answer on Stackoverflow