anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.24k stars 51 forks source link

The css value "unset" is not being reported for browsers that do not support it. #56

Closed narthollis closed 5 years ago

narthollis commented 7 years ago

Many browsers do not support the CSS value unset which is used for resetting a css attribute as back to its default inherit/initial value.

Currently doiuse is not reporting this when testing with browsers who do not have this value.

http://caniuse.com/#feat=css-unset-value

ZacharyRSmith commented 7 years ago

From what I can tell looking at the source code, no unsupported values are being checked -- only unsupported property-value pairs.

It might be worth it to have the Detector check ALL features, and whenever an unsupported value is used (such as unset or initial for IE), throw a warning.

screen shot 2017-04-18 at 9 43 45 am

ZacharyRSmith commented 7 years ago

My workaround:

I'm using stylelint to run doiuse, in addition to other linting. To warn about "initial" and "unset", I have the below rule in my .stylelintrc. The built-in rule 'declaration-property-value-blacklist' blacklists the property-value pair I give it. The pair I give it is:

property: "/^.*/" (match all regex) value: ["initial", "unset"]

So, all properties with a value of "initial" or "unset" will throw a violation.

I set the violation severity to warning.

        "declaration-property-value-blacklist": [{
            "/^.*/": ["initial", "unset"]
        }, { "severity": "warning" }],
ismay commented 7 years ago

From what I can tell looking at the source code, no unsupported values are being checked -- only unsupported properties.

By the way, it isn't just properties that are checked. I do get warnings for using rem for example. No idea why unset isn't being reported.

ZacharyRSmith commented 7 years ago

I should have said "unsupported property-value pairs". My guess is the code checks all properties known to use rem, then complains if it sees rem. But yeah, weird that it wouldn't do the same for unset etc.

rincedd commented 5 years ago

Hi @anandthakker,

I fixed this in #93. I'd be happy to work on a few other issues as well. Could you provide write access to the repo, as mentioned in the contribution guideline? Otherwise please consider the PR.

Thanks, Gerd

rincedd commented 5 years ago

Maybe @pkuczynski could help?

pkuczynski commented 5 years ago

I just merged your PR and can release the new version soon. When it comes to writing access to the repo, you have to talk with @anandthakker directly as I do not have permissions to grant rights...

rincedd commented 5 years ago

Cool, thanks a lot!