8000 [css-ui-3] caret-color animations, 'auto' and 'currentColor' · Issue #781 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]

Skip to content

[css-ui-3] caret-color animations, 'auto' and 'currentColor' #781

@frivoal

Description

@frivoal

The auto and currentColor values of the caret-color property compute to themselves as a keywords, rather than to an RGB(A) value, because otherwise that would mess with inheritance.

However, (unless I am misunderstanding how transitions and animations work) this also means that you cannot smoothly transition or animate betweenauto or currentColor and another color.

While it is not the end of the world, it seems a little unfortunate. Code like this for example, while probably not a major use case, doesn't look unreasonable, and it'd be nicer if the transition worked without discontinuity:

.foo {
  color: initial; /* or whatever */
  caret-color: auto;
  transition: all 1s;
}
.foo:hover {
  color: green;
  caret-color: lime;
}

Preserving sanity of inheritance is much more important than that, but @mrego ’s first try and implementing caret-color in Blink actually got both: for inheritance and getComputedStyle() purposes, auto and currentColor compute to themselves as keywords, but at the same time, they still animate.

Is the ability to do that unique to Blink's internals, or can other browsers do it too? Do we have a concept in the spec that allows to express this? If yes to both, should we do it? Did I misunderstand something?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0