Skip to content

[css-color-4] backgroundColor #364

Closed
@frivoal

Description

@frivoal

Just as we have currentColor, having backgroundColor (or background-color) would be useful when you're doing effects that depend on the background color, but you don't know what it is (for example when the background color changes in various parts of the document).

Here's an example which could be solved by having that keyword:

http://jsbin.com/detezeb/edit?css,output

The definition, which would parallel that of currentColor, would be something like:

The keyword ''backgroundColor'' takes its value from the value of the 'background-color' property on the same element. This happens at used-value time, which means that if the value is inherited, it’s inherited as ''backgroundColor'', not as the value of the color property, so descendants will use their own color property to resolve it.

If ''backgroundColor' is used as the value of the background-color property, it instead takes its value from the value of the background-color property on the parent element, or ''transparent'' if there is no parent element.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions