css-parser: pure CSS parser/printer

[ bsd3, library, program, web ] [ Propose Tags ] [ Report a vulnerability ]
Versions [RSS] 0.0.1
Change log CHANGELOG.md
Dependencies array (>=0.5.2 && <1), base (>=4.7 && <5), bytestring (>=0.9 && <1), css-parser, either (<6), generic-deriving (<2), reorder-expression (<1), text (>=2 && <3), these (<2), unordered-containers (<1) [details]
License BSD-3-Clause
Copyright 2026
Author Daniil Iaitskov
Maintainer dyaitskov@gmail.com
Uploaded by DaniilIaitskov at 2026-05-15T18:08:51Z
Category web
Home page https://github.com/yaitskov/css-parser
Source repo head: git clone https://github.com/yaitskov/css-parser
Distributions
Executables css-parser
Downloads 1 total (1 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for css-parser-0.0.1

[back to package description]

css-parser

This is a modern CSS parser and printer written in pure Haskell with Alex/Happy stack. CSS libraries test set includes: bootstrap, carbon, patternfly, uikit, primer, uswds, etc.

css-parser is based on css-selectors.

The work is started to provide info about style sheets structure to miso-css library.

Dev

$ nix develop
$ emacs src/CssParser.hs &
$ cabal test
$ cabal repl
ghci> import CssParser
ghci> parseCss "p {x: 1px;}"
CssFile {rules = [CssRule (Selector Nothing (TagSelector {tagNs = NoBar, tagName = TagName "p", tagSubSelectors = []}) [] :| []) [CssLeafRule (KnownDescriptor XT) (PropVals (IntVal (TypedNum "1" Px) :| []) Nothing)]]}
nix build
./result file.css
./result < file.css

Integration tests

cd itest
nix develop
intest

Links to successfully parsed CSS files are stored in .css-hashes folder to exclude them from consequent intest reruns.