Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alpha-value-notation #4770

Merged
merged 1 commit into from May 19, 2020
Merged

Add alpha-value-notation #4770

merged 1 commit into from May 19, 2020

Conversation

jeddy3
Copy link
Member

@jeddy3 jeddy3 commented May 14, 2020

Which issue, if any, is this issue related to?

Closes #4720

Is there anything in the PR that needs further explanation?

I added an exceptProperties option as support for percentage alpha-values for opacity was added in a later spec, it isn't supported in some browsers like Safari, and I don't think postcss-preset-env transpiles it yet.

When this rule and the other two new rules are in, I'll create a follow-up issue to refactor some of the shared functions into utils, e.g. getValue and setValue.

@jeddy3 jeddy3 mentioned this pull request May 14, 2020
6 tasks
Copy link
Member

@m-allanson m-allanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also looks great 👍

@jeddy3 jeddy3 mentioned this pull request May 17, 2020
6 tasks
@mathiasbynens
Copy link
Contributor

I added an exceptProperties option as support for percentage alpha-values for opacity was added in a later spec, it isn't supported in some browsers like Safari, and I don't think postcss-preset-env transpiles it yet.

Note that the latest stable Safari version (13.1) supports opacity: 50% according to CSS.supports('opacity', '50%');. I don't know what the oldest Safari version is that supports it though. Also, Opera is Chromium-based, so it likely actually has support for it too. TL;DR Take the MDN support data with a grain of salt. (I think exceptProperties is a good idea regardless 👍)

@jeddy3 jeddy3 merged commit 781d2ab into master May 19, 2020
@jeddy3 jeddy3 deleted the issue-4720 branch May 19, 2020 13:05
@jeddy3
Copy link
Member Author

jeddy3 commented May 19, 2020

@mathiasbynens Thank you for the review. I'll release the new rules now.


Changelog entry:

  • Added: alpha-value-notation rule (#4770).

@pascalduez
Copy link
Contributor

As a possible ref, we just hit NMFR/optimize-css-assets-webpack-plugin#118 after upgrading to stylelint 14, stylelint-config-standard 23.

TL;DR: cssnano badly transforms opacity percentage values. Should be fixed by now, but you know stuck transitive dependencies, lacking time to upgrade tooling like Webpack etc.

@alexander-akait
Copy link
Member

Please migrate on https://github.com/webpack-contrib/css-minimizer-webpack-plugin (new cssnano version), if it will not help, please open an issue in cssnano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add alpha-value-notation
5 participants