Could `currentBackgroundColor` become a valid, useful CSS color value keyword?
Yes it could. For example, it would make it very easy to create an section of your text inverted-colour, ie you could swap the foreground and background colours to highlight something.
However, suggesting this as a CSS feature would be fighting against the tide. There used to be a whole bunch of CSS colour keywords, for things like the scrollbar colour, and the standard button colour, and the colours of the 3D shadows on the buttons... but they were all dropped from CSS some time ago.
There are lots of things in CSS that could be useful that aren't in there. Personally I'm more excited about CSS variables. When they become mainstream we are unlikely to be too worried about colour keywords like this
Can anyone point to any implementation issues which I may not be considering?
Yes. There could be circular dependencies:
* {
background-color: currentColor;
color: currentBackgroundColor;
}
Moreover, currentcolor
can be useful because text has a single color. But backgrounds can have additional things like background-images and such, which might counterintuitively leave background-color
set to the default of transparent
. And then currentBackgroundColor
is not much useful.