Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False warnings for stroke-opacity #299

Closed
ryo-manba opened this issue Oct 28, 2024 · 2 comments
Closed

False warnings for stroke-opacity #299

ryo-manba opened this issue Oct 28, 2024 · 2 comments

Comments

@ryo-manba
Copy link

ryo-manba commented Oct 28, 2024

stroke-opacity generates false warnings due to incorrect syntax, as it doesn’t handle percentages.
See: stylelint/stylelint#8080 (comment)

Version 2.11 of mdn-data has updated definitions for stroke-related properties (see mdn/data#757).
Updating mdn-data and removing the corresponding patch should fix this issue.

csstree/data/patch.json

Lines 401 to 456 in 9224418

"stroke": {
"comment": "added SVG property",
"references": [
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
],
"syntax": "<paint>"
},
"stroke-dasharray": {
"comment": "added SVG property; a list of comma and/or white space separated <length>s and <percentage>s",
"references": [
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
],
"syntax": "none | [ <svg-length>+ ]#"
},
"stroke-dashoffset": {
"comment": "added SVG property",
"references": [
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
],
"syntax": "<svg-length>"
},
"stroke-linecap": {
"comment": "added SVG property",
"references": [
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
],
"syntax": "butt | round | square"
},
"stroke-linejoin": {
"comment": "added SVG property",
"references": [
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
],
"syntax": "miter | round | bevel"
},
"stroke-miterlimit": {
"comment": "added SVG property (<miterlimit> = <number-one-or-greater>) ",
"references": [
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
],
"syntax": "<number-one-or-greater>"
},
"stroke-opacity": {
"comment": "added SVG property",
"references": [
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
],
"syntax": "<number-zero-one>"
},
"stroke-width": {
"comment": "added SVG property",
"references": [
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
],
"syntax": "<svg-length>"
},

@lahmatiy
Copy link
Member

lahmatiy commented Nov 2, 2024

The fix in mdn/data is incorrect: the spec defines <'stroke-opacity'> as <'opacity'> (syntax of the opacity property) not <opacity> (a non-exists syntax definition). I changed CSSTree's patch, the issue should be resolved.

@ryo-manba
Copy link
Author

I created a PR in mdn/data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@lahmatiy @ryo-manba and others