Re: [csswg-drafts] [css-color] Custom color palettes (#5730)

> This looks cleaner:

~~~~ css
@color-profile a98-rgb {
  src: url("adobe.icc"); /* invalid for predefined color profiles */
  green: 96% 2% 2%; /* specify existing CSS color names as descriptors */
  --my-green: 98% 1% 1%; /* custom color name */
}
foo {
  color: color(a98-rgb green);
  background: color(a98-rgb --my-green);
}
~~~~

It really doesn't look cleaner. It redefines an existing predefined space, linking to a color profile that is unavailable due to trademark and redistribution-licensing constraints, just to avoid using the already-existing `color(a98-rgb 96% 2% 2%)` syntax and to be able to stuff it into `@color-profile` even though it is not defining a new color space.

I don't like that syntax at all.

> If the *default color profile* could be set by an inherited property, this would look even cleaner:

~~~~ css
:root {
  color-profile: a98-rgb; /* overrides `srgb` default */
}
foo {
  color: color(green); /* or just `green`? */
  background: color(--my-green); /* different from `var(--my-green)` */
}
~~~~

Overriding all existing colors that have been there since CSS1, with new meanings. A wonderful boon to readability.

If you want to propose a way to define a palette of named colors (and then use those names), please propose a different at-rule like `@color-palette` and don't try to overload colorspace definitions.

Also, as CSS Color 4 is undergoing stabilization prior to going to CR, please propose it for a later spec such as CSS Color 5 or a new css-color-palettes spec.

-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5730#issuecomment-761582255 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 16 January 2021 15:31:38 UTC