-
Notifications
You must be signed in to change notification settings - Fork 711
<absolute-color-base>
not enough anymore
#9555
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
So we would have a grammar like
|
FWIW, I am fine with flattening color sub-productions and excluding some functions or arguments in some contexts in prose, if this cannot be achieved with basic syntax, which seems hard to achieve here, and also with keeping productions that are neither related to parsing/serialization rules ( |
Yeah, that sounds appropriate. I'd still have an |
Yup @LeaVerou suggested the same thing to me earlier. |
I'm not sure what would be the most appropriate place to raise this, but I'm starting to think that the spec phrase
is not entirely true in implementations. I wrote a little test (GitHub doesn't let me upload *.html, so *.txt will have to do) and see that both Firefox (128.6.0esr) and Chromium (131.0.6778.264) show the same results:
Is this a point where the implementations and specification are drifting apart, or are they behaving as specified (and am I misunderstanding the spec)? |
Chrome and Firefox do not currently support In the relative color syntax, Chrome accepts all relative colors. Firefox only accepts In
nit: adding "otherwise it is invalid" would be very handy to find it among the syntax rules defined in prose. I would suspect that any relative color function should not accept relative colors as argument. But both Chrome and Firefox accept any of them in |
Closing again as the [comment by @cdoublev (https://github.com//issues/9555#issuecomment-2642195433) answers the questions asked, and the one small change to CSS Fonts 4 about |
As described in the op/title, this issue may be considered as fixed, but I see two related issues that may need to be further discussed separately:
I cannot find any related issue open.
Specs currently require all non-absolute colors to be |
Also, could you clarify what should be said about colors resolved at used value time? |
Chrome/FF implementations (cannot speak about Webkit) suggest making exceptions to this (as already reported by @stiiin above):
And if I understand your comment correctly:
You also suggested allowing So I would like to clarify whether these implementations are correct and exceptions should be made to the above restriction, and whether your suggestion is rejected. |
Ah, I see. Yes, my earlier suggestion to allow |
Yes, that is correct. From 14.5. Resolving other colors
|
I cannot find the related discussions to understand why, but I have no opinion on this. Alright. So if - Nor are any of those values used inside <color-mix()> or in relative color syntax.
+ All these values but currentcolor are invalid inside <color-mix()> or in relative color syntax. Alternatively: - Nor are any of those values used inside <color-mix()> or in relative color syntax.
+ Nor are any of those values used inside <color-mix()> or in relative color syntax,
+ unless otherwise specified. With a specific statement below the grammar definition of
But I would also like to know if Chrome should not accept them all in these contexts. |
Okay, I think I see the confusion. In the Colors which are not absolute are perfectly fine in general, they just require special handling. For example, depend on the color mode, which can vary per element. So the result of For example, inside
in consequence, in 10.1. Resolving color-mix() Values:
and similarly in RCS, 10.2. Resolving Relative Color Syntax Values :
I think you were reading an "all non-absolute colors are invalid" into the specification, which was not the intent. Reviewing that text it is clear that 10.1 and 10.2 were written with primarily But we do need an addition to call out the used value of And 6. Uncalibrated CMYK Colors: the device-cmyk() Function needs an explicit mention (rather than inferring from omission in 4. Relative Colors ) that |
…e the whole descriptor invalid, not just the individual color #9555
That was clear to me.
I am reading "all non-absolute colors are invalid in
https://drafts.csswg.org/css-color-5/#absolute-color Examples in
Examples in RCS:
|
Can you point out exactly where it says that? Because the line you quoted is just one part of the "absolute color" definition. |
Quoting it with the full context would be pointless. If this line is not enough, I guess I misinterpreted it, sorry. |
The examples you gave are all valid. They aren't absolute. The value cannot be computed on encountering them; it depends on document context and the value of other properties. |
Damn. So the explicit version of this line is:
Ok. Sorry for the confusion, again... and thanks for your patience. |
The notion of
<absolute-color-base>
was introduced to the grammar of<color>
in CSS Color 4 to separate out problematic things likecurrentColor
(which can't be resolved until used-value time and depends on the value ofcolor
on that element and its ancestors) or<system-color>
which depend on light/dark mode, and forced colors modeIt continued on in CSS Color 5 where it is also used to exclude problematic
device-cmyk()
(which has no colorimetric basis and might be resolved by an ICC profile or might be an eye-searingly inaccurate naive color conversion<absolute-color-base>
is used directly in the grammar for theoverride-colors
descriptor on@font-palette-values
(to excludecurrentColor
). But there is no good reason to excludedevice-cmyk()
there.However, this is no longer sufficient because CSS Color 5 introduces
color-mix()
and Relative Color Syntax so what used to be a resolvable, colorimetric item likergb(30% 70% 20%)
could now bergb(from currentColor r g b)
orcolor-mix(in oklab, rgb(30% 70% 20%) 40%, currentColor)
.There is still a need to exclude certain problematic color forms for various reasons, but I am now of the opinion that doing this via formal syntax is no longer workable and the exclusion should be case-by-case in prose, instead.
/cc @fantasai @cdoublev @drott @LeaVerou because I have had discussions touching on this in various other issues and would like feedback.
The text was updated successfully, but these errors were encountered: