-
-
Notifications
You must be signed in to change notification settings - Fork 83
Description
The value of the cursor CSS property for csstree is currently defined here as follows:
[ [ <url> | <url-set()> ] [ <x> <y> ]? ]#? [ auto | … ]
This does however not match the way the cursor css property is defined in CSS Level3 and accepted by browsers: The difference is that if the URL (or URL set) part is present, then the syntax above would not allow a comma between the URL part and the fallback-cursor, which is however required for the CSS rule to work in a browser.
A simple example CSS: url(example.png), auto does not parse in csstree when using the definition from this repo. The version with the omitted comma (url(example.png) auto) parses using the above definition, but fails to be usable in Chrome
or Firefox
.
As far as I can tell, the following would be the correct syntax to define the cursor CSS property:
[ [ <url> | <url-set()> ] [ <x> <y> ]? , ]* [ auto | … ]
PS: The same (incorrect) #? syntax to define the cursor property was also present in recent CSS Level4 drafts (e.g. in the version of 8 August 2025), where it was a mistake as well: see w3c/csswg-drafts#13001.