0

I am using CSS Lint to detect errors and warnings in a specific css. CSS Lint detects 3 errors:

enter image description here

in below piece of css code:

a.btn,
:not(li.menu_icon a.btn),
.k-button.btn,
input[type=submit].btn, 
input[type=button].btn, 
button[type=submit].btn:not(.gridAddBtn), 
button[type=button].btn:not(.gridAddBtn), 
a[name=butonWorkFlow].btn {
    background-image: none;
    min-width: 90px;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

...but I do not know how to correct it. I have basic knowledge about css.

Willy
  • 9,848
  • 22
  • 141
  • 284
  • You probably have an error before the snippet you posted. – D. Pardal Feb 10 '21 at 11:48
  • @D.Pardal I have discarded this because I have only parsed the css code before this one and there are no errors. Line indicated by CSS Lint corresponds to :not(li.menu_icon a.btn) in that piece of code. – Willy Feb 10 '21 at 11:54
  • There are no errors on your posted CSS. The lint program is probably wrong. The only issue from the W3C CSS validation is unrecognised vendor extension for `-moz-` and `-webkit-` which you don't need for `box-sizing`, to be honest. – Martin Feb 10 '21 at 11:54
  • FYI: The W3C CSS Validator (https://jigsaw.w3.org/css-validator/) marks `:not(li.menu_icon a.btn)` as a parse error here, when validating against profile `CSS level 3 + SVG`. – CBroe Feb 10 '21 at 12:44
  • 2
    @CBroe: I don't recommend using Jigsaw to check CSS anymore, it's buggy, slow to catch up (or refuses to catch up with anything the maintainers don't consider a "standard" regardless of how stable or widely used the feature is), and it's been that way for *years*. Everyone uses stylelint these days. – BoltClock Feb 11 '21 at 03:51
  • @BoltClock thanks for the info, I’ll take that into consideration in the future. – CBroe Feb 11 '21 at 07:08

2 Answers2

4

CSS Lint is no longer being updated, so does not recognize the updated :not() syntax. Use an up-to-date linter, such as stylelint, which will pass your CSS.

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
1

:not(selector) is part of CSS3. Might be you are using lower version.

nano dev
  • 335
  • 4
  • 6
  • CSS Lint recognizes the old :not() syntax just fine, it's the new syntax that it doesn't understand. The highest version of CSS Lint is several years old. Nobody uses it anymore. – BoltClock Feb 11 '21 at 03:52