question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

value-keyword-case for currentColor in non SVG CSS is breaking code

See original GitHub issue

What steps are needed to reproduce the bug?

I have a CSS declaration like this:

.footer a {
  color: currentColor;
}

which gets reported as value-keyword-case error.

What Stylelint configuration is needed to reproduce the bug?

{
    "rules": {
        "value-keyword-case": [ "lower", {
            "ignoreProperties": [ "@font-stack", "font-family", "font" ]
        } ]
    }
}

How did you run Stylelint?

CLI via npx stylelint assets/css/

Which version of Stylelint are you using?

14.3.0

What did you expect to happen?

no warning or error because of the syntax correct value currentColor

What actually happened?

assets/css/…
 4:19  ✖  Expected "currentColor" to be "currentcolor"  value-keyword-case

When set to non camelCase, browser will not respect this value, which breaks the styling.

Does the bug relate to non-standard syntax?

No response

Proposal to fix the bug

The root of this issue may lay in #5849. Please take a closer look.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

12reactions
jeddy3commented, Feb 1, 2022

Closing as no further reports.

The recommendation is to use currentcolor from the CSS Level 4 spec.

5reactions
portfolioriscommented, Jan 26, 2022

I’ve found the following:

  • Firefox’s devtools autocomplete to currentColor, but accepts both,
  • Edge’s devtools autocomplete to both currentColor and currentcolor,
  • Webstorm autocompletes to currentColor,
  • MDN mentions both ways on different pages,
  • The spec says currentcolor

I think the spec is the most accurate, and browsers and IDEs need to catch up.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding the currentColor Keyword in CSS - DigitalOcean
A super short post that tells you what the currentColor keyword is used for in CSS and how to make good use of...
Read more >
SVG currentColor do not inherit from parent division when ...
I try to integrate a SVG from a CSS file with the following code: .circle:before { content: url('data:image/svg+xml;charset=UTF-8, ...
Read more >
Making single color SVG icons work in dark mode - Hidde's blog
Using inline SVGs with currentColor fixed the issue. ... basically lets you tell a browser that your CSS supports dark modes and will...
Read more >
Using inline SVGs in Vue components - Caleb Porzio
After writing a crazy hack to achieve this functionality I discover SVG offers this functionality out of the box with a property called:...
Read more >
How to use SVGs in React | Sanity.io guide
This article will explore how to use SVG in React in three examples.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found