Comments (13)
Make sense. Let's move this into the standard config repo and continue discussing.
Ref:
stylelint-config-standard/index.js
Line 111 in 5aa5dd5
from stylelint-config-standard.
The link you provided is CSS Color Module Level 4
(https://www.w3.org/TR/css-color-4/#currentcolor-color), keyword is only mentioned in lowercase.
In CSS Color Module Level 3
(https://www.w3.org/TR/css-color-3/#currentcolor) keyword is written in camel case, and references SVG 1.0 specifications which also use camel case.
Finaly, SVG2 draft also mentions the keyword in camel case: https://svgwg.org/svg2-draft/painting.html#ColorProperty.
To summarize:
- CSS3, SVG1 and SVG2:
currentColor
- CSS4:
currentcolor
from stylelint-config-standard.
@rohm1 Thanks for the report. But I believe this is not a bug. You can avoid the error by the camelCaseSvgKeywords
option:
{
"rules": {
"value-keyword-case": ["lower", {"camelCaseSvgKeywords": true}]
}
}
See also this demo.
from stylelint-config-standard.
@ybiquitous thanks, but this is at least a default config bug. I should not have to configure anything for standard CSS properties and values.
from stylelint-config-standard.
Revisit old issues:
from stylelint-config-standard.
Just to confirm, are both valid, e.g., optimizeLegibility
and optimizelegibility
?
from stylelint-config-standard.
Not sure, the specs make only mention of the camel case option (https://svgwg.org/svg2-draft/painting.html#TextRenderingProperty). But both Firefox and Chrome seem to accept camel case and lowercase.
from stylelint-config-standard.
Umm, if we enable camelCaseSvgKeywords
, the following valid CSS using the currentcolor
keyword will be reported:
a {
color: currentcolor;
/* ^ Expected "currentcolor" to be "currentColor"
*/
}
See this demo.
What do you think?
from stylelint-config-standard.
Looks like this is wrong: https://github.com/stylelint/stylelint/blob/main/lib/reference/keywords.js#L265 currentcolor
is expected to be camel case but the spec you mention states lowercase.
from stylelint-config-standard.
Does the SVG spec support currentColor
, right?
from stylelint-config-standard.
Umm..., it seems we cannot enable camelCaseSvgKeywords
until fixing the problem. 🤔
from stylelint-config-standard.
The CSS color 4 tests are all using currentColor
:
https://github.com/web-platform-tests/wpt/blob/master/css/css-color/currentcolor-001.html
https://github.com/web-platform-tests/wpt/blob/master/css/css-color/currentcolor-002.html
https://github.com/web-platform-tests/wpt/blob/master/css/css-color/currentcolor-003.html
from stylelint-config-standard.
I came across this issue, and trying to trace down any upstream issue I found w3c/csswg-drafts#4599
which points over that the values are case insensitive https://drafts.csswg.org/css-values-4/#keywords, so fixing them to the camelCase should be safe
from stylelint-config-standard.
Related Issues (20)
- Remove deprecated rules HOT 4
- Stylelint peer dependencies in not up to date HOT 1
- Add import-notation HOT 1
- Add keyframe-selector-notation HOT 3
- Add SVG opacity properties as exceptions to alpha-value-notation HOT 6
- Use parameterized custom messages HOT 1
- Change `import-notation` to `"url"` HOT 1
- rgba format problem HOT 1
- Is the "stylelint-config-recommended" required HOT 12
- Fix `length-zero-no-unit` false positives for custom properties HOT 2
- Add `media-feature-range-notation: "context"` rule HOT 5
- Is stylelint-config-standard compatible with custom syntax like less? HOT 3
- Restore `declaration-block-single-line-max-declarations` removed on 30.0.0 HOT 2
- Unknown rule HOT 11
- Upgrade to 32.0.0 causes parseError with media query in .less file HOT 3
- Regression: Throwing syntax error when filter is repeatedy used after upgrading to v33 HOT 1
- Unknown rule media-query-no-invalid media-query-no-invalid HOT 5
- Remove `media-feature-range-notation: "context"` until support is beter HOT 12
- false positive fatal unknow rule errors after upgrade HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stylelint-config-standard.