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.

Fix `value-no-vendor-prefix` false positives for `-webkit-box`

See original GitHub issue

What is the problem you’re trying to solve?

I recently applied a fairly straightforward stylelint config to a legacy project and found that several instances of display: -webkit-box; got changed to display: box;, as I would expect with the value-no-vendor-prefix rule enabled.

However, to my surprise not only is there not an equivalent non-prefixed display value available, display: -webkit-box; and the related -webkit-line-clamp property have been added to the CSS Overflow Module 3 spec in that same vendor-prefixed syntax. As far as I can tell, display: -webkit-box; is the only valid way (even in non-webkit browsers) to produce the line -webkit-line-clamp behavior at the time of writing.

I was able to avoid this autofixing by adding

"value-no-vendor-prefix": [
    true,
    {
        "ignoreValues": ["box"]
    }
]

to my .stylelintrc.json, as the docs correctly suggest.

What solution would you like to see?

Have "ignoreValues": ["box"] be the default value of value-no-vendor-prefix

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jeddy3commented, Sep 29, 2022

So it looks better to me to change stylelint-config-standard instead

Sorry for the confusion. Let’s do it this way, i.e. make the change in the standard config.

1reaction
jeddy3commented, Sep 29, 2022

This issue seems related to not only value-no-vendor-prefix but also property-no-vendor-prefix because the -webkit-line-clamp property has also been standardized for legacy compatibility.

If they’re been standardized for legacy compatibility then we should probably fix the behaviour of the rules so that they’re not flagged as problematic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autoprefixer and property-no-vendor-prefix #395 - GitHub
We commit the vendor prefixes added by Autoprefixer to our primary repo, as such we have CSS code with the -webkit-box-shadow vendor prefix, ......
Read more >
value-no-vendor-prefix - Stylelint
Disallow vendor prefixes for values. This rule ignores non-standard vendor-prefixed values that aren't handled by Autoprefixer. The fix option can ...
Read more >
Vendor prefixes are not developer-friendly - Paul Irish
If Mozilla and others implement -webkit- prefixes, the standardization process would be hurt, because features from Apple/Google browsers start ...
Read more >
Why doesn't [CSS feature] work in [browser] but works in others?
Vendor prefixes are exactly what their name describes - a vendor-specific (vendor meaning a company who develops a browser) prefix of a property ......
Read more >
CSS vendor prefixes redux - QuirksBlog - QuirksMode
The problem is real. Vendor prefixes have some serious problems, and these problems will become worse as time progresses. My proposed solution ...
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