- From: Sebastian Zartner via GitHub <sysbot+gh@w3.org>
- Date: Sat, 08 Jul 2023 23:05:41 +0000
- To: public-css-archive@w3.org
SebastianZ has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-fonts-5] Allow to define palette colors outside of `@font-palette-values` == Thinking about the proposal for animating `font-palette` in #8922, the question I had in mind was, why not allow to animate the different colors individually? The main benefit of that is that you can transition each color individually and with that also define the interpolation color space. And besides the transition/animation use case, you'd be able to change each color on usage. That would require a new property to access and overwrite the colors outside of `@font-palette-values`, e.g. called `font-palette-color`. Syntax suggestion: ```abnf font-palette-color: [ <integer [0,∞]> [ <absolute-color-base> | from-palette ] ]# ``` So it would basically work like the [`override-colors` descriptor](https://drafts.csswg.org/css-fonts/#override-color) descriptor but may also use the color from the palette via the `from-palette` keyword. Example for an animation: ```css @keyframes --palette-animation { from { font-palette-color: 1 red, 2 from-palette 3 oklch(0.63 0.12 105.7); } to { font-palette-color: 1 blue, 2 hsl(80 90% 60%), 3 oklch(0.5 0.90 185.7); } } ``` One open question is what to do with colors _not_ defined in `font-palette-color` and `font-palette` itself is not animated. Possible solutions I can think of: 1. Use the colors from the palettes and 1. interpolate them like other colors 2. interpolate them discretely 2. Use a default color like `currentcolor` (that might also be overwritten by allowing to define a color without index, e.g. `font-palette-color: black, 2 blue;` would set the second color to `blue` and the rest of the colors in the palette to `black`) Initially, I wanted to add that as a comment to #8922, though as it covers additional use cases besides animation and is orthogonal to the proposal there, I thought it would be worth to discuss this separately. Sebastian Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9046 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Saturday, 8 July 2023 23:05:43 UTC