Commit f040a65
authored
[css-mixins-1] Let 'inherit' work like 'inherit()' (w3c#12387)
With @function, it becomes possible to have a "type mismatch"
between an "outer" custom property and an "inner" custom property:
@Property --x {
syntax: "auto | red";
/* ... */
}
@function --f(--x <color>: inherit) {
result: var(--x);
}
div {
--x: red;
--f(); /* => ? */
}
We have to address this somehow, and the obvious way seems to be
making 'inherit' behave like "a var(--x) that resolves in the parent
stack frame". This is essentially what inherit() does, which already
exists in the spec.1 parent b3a00e8 commit f040a65
1 file changed
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
633 | 633 | | |
634 | 634 | | |
635 | 635 | | |
636 | | - | |
637 | | - | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
638 | 659 | | |
639 | 660 | | |
640 | 661 | | |
| |||
0 commit comments