Commit fab78c9
committed
feat(ie-css): implement CSS parser with rules, declarations, and value types #68
CSS parser consuming tokens from CssTokenizer:
- Stylesheet/Rule/Declaration types with PropertyId enum (~55 properties)
- parse_stylesheet() and parse_declarations() public API
- Qualified rule parsing: raw selector strings + declaration blocks
- Declaration parsing: property:value with !important detection
- Value types: CssValue (Length, Percentage, Number, Color, keywords,
Auto, Inherit, Initial, None)
- Color parsing: #hex (3/4/6/8 digit), rgb()/rgba(), 16 named colors
- Length units: px, em, rem, %, vw, vh, vmin, vmax, ch, ex, pt
- Shorthand expansion: margin, padding, border, border-width/style/color
- Property inheritance classification, initial values
- At-rule skipping (@import, @media consumed but not processed)
- 14 parser tests + 26 tokenizer tests = 40 total1 parent a9b8bba commit fab78c9
4 files changed
Lines changed: 1150 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
| 15 | + | |
0 commit comments