-
-
Notifications
You must be signed in to change notification settings - Fork 75
oklab and oklch non-percentage values for lightness not supported in Safari 16.0 on iPhone 12 #1176
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
Comments
Hi @rsstiglitz, Thank you for reporting this issue and for following the template.
This seems like a good solution. In an older version of the CSS color specifications only one kind of value was allowed for each channel. So either a number or a percentage. This was relaxed recently to allow both in all positions. I think all color notation So for The notations are defined here : If you have time and want to contribute then this is good first issue.
This change will affect a number of plugins, each will need to have their test result files updated. |
Thanks for your answer!
Ah, good to know, so indeed changing the Just to be clear for anyone else reading this: You can easily fix this in your codebase now by either using percentage values or I think setting I found this issue while working on my company's new product release (which is tomorrow), so after that I'm probably going to take some time off in general, if anyone wants to open a PR in the meantime, feel free to do so. Also, this is the GitHub account I use for work and I'm probably going to switch to my private account when doing this, so don't be confused if you see @nnmrts pop up here or in a PR; thats me! 😆 By the way: I couldn't find anything about this compatibility issue anywhere. Can I use and MDN which use the same source (browser-compat-data) don't say anything about this detail. Note that this issue only occurs on iPhone 12 Safari 16, not on newer iPhones/iOS even with the same Safari major version, as far as I know. Do you know if |
a codepen with some examples : https://codepen.io/romainmenke/pen/wvNYKmR new WPT tests for things not yet supported in all browsers : web-platform-tests/wpt#43450 chrome bug report : https://bugs.chromium.org/p/chromium/issues/detail?id=1506549 mdn compat data issue : mdn/browser-compat-data#21404 |
Small update :
I've started tracking this on |
We also need to test for this in relative color syntax |
Uh oh!
There was an error while loading. Please reload this page.
Bug description
Safari 16.0 on iPhone 12 does not seem to support normal number values for the lightness entry in
oklch
andoklab
functions when at the same time using a variable in the/
opacity addition.@csstools/postcss-oklab-function
is not accounting for that when usingoklch
andoklab
with a/ var(--opacity)
opacity suffix and using the options{"preserve": true}
because it inserts thissupports
rule:This leads to this example not being polyfilled:
Three different ways to fix this, either adjust the supports rule to
@supports (color: oklab(0 0 0))
(without the percentage symbol; it works, I tried it), but this might break other environments which support only numbers and no percentage (are there any). Or, and I don't know if postcss plugins are able to do this, convert decimals inoklab
andoklch
functions to percentage values.Third option is to make two
supports
rules, one with the percentage symbol and one without it.Source CSS
Expected CSS
Actual CSS
Does it happen with
npx @csstools/csstools-cli <plugin-name> minimal-example.css
?Yes
Debug output
No response
Extra config
No response
What plugin are you experiencing this issue on?
PostCSS OKLab Function
Plugin version
3.0.7
What OS are you experiencing this on?
macOS
Node Version
20.8.0
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: