css custom property fallback 'unset' not working as expected
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox118 | --- | fixed |
People
(Reporter: hello, Assigned: emilio)
References
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/116.0
Steps to reproduce:
Following HTML/CSS:
<body>
<style>
.outer {
--background: red;
}
.inner {
--background: var(--background-no, unset);
}
input {
background: var(--background);
}
</style>
<div class="outer">
<div class="inner">
<input />
</div>
</div>
</body>
Actual results:
Background of the input isn't changed.
Expected results:
Background of the input should be red.
Apparently using 'unset' as a fallback for a missing custom property doesn't work as expected. If you put --background: unset on .inner, --background will have the value set at .outer. This is expected behaviour I think. When using "unset" as a fallback, --background is not inherited from .outer.
Comment 1•2 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•2 years ago
|
||
The severity field is not set for this bug.
:emilio, could you have a look please?
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 3•2 years ago
|
||
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Comment 4•2 years ago
|
||
So for unset and so it is reasonable to behave like a non-custom property. However, not sure what it means for revert/revert-layer...
| Assignee | ||
Comment 5•2 years ago
|
||
| Assignee | ||
Comment 6•2 years ago
|
||
See spec issue for what to do about revert / revert-layer.
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
| Assignee | ||
Updated•2 years ago
|
Comment 10•2 years ago
|
||
| bugherder | ||
Description
•