jaraco / jaraco/cssutils

Parsing RGBA hex codes fails (feature from CSS Color Module 4)

Offen
#83 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
92
Forks
30
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

When a stylesheet with RGBA hex codes is parsed, it triggers `ERROR`-level logs.

Quick proof from an interactive Python session using `cssutils==2.15.0`:

```bash
$ python
Python 3.12.3 (main, Jun 19 2026, 12:46:00) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cssutils
>>> cssutils.parseString("body { color: #00808080; }")
ERROR PropertyValue: Missing token for production Choice(ColorValue, Dimension, URIValue, Value, variable, MSValue, CSSCalc, function): ('HASH', '#00808080', 1, 15)
ERROR No content to parse.
ERROR PropertyValue: Unknown syntax or no value: #00808080
ERROR CSSStyleDeclaration: Syntax Error in Property: color: #00808080
cssutils.css.CSSStyleSheet(href=None, media=None, title=None)
```

_CSS Color Module 4_ documents that as a supported syntax (8-digits): https://drafts.csswg.org/css-color/#hex-notation

I guess it's linked to #29 which covers a generic need to implement features from the _CSS Color Module 4_.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start by reproducing the issue with cssutils.parseString("body { color: #00808080; }") and trace the parser path for color values. Check the existing handling of CSS Color Module 4 hex notation; done means 8-digit RGBA hex colors parse without ERROR-level logs or property syntax errors.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
web-dev
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.