Post #2392940
2026-04-04 05:06 UTC
@leaverou@front-end.social So, the resolution as it applies to the demo from your poll would create a result similar to setting the --arg value as a custom property on div (with length type & no initial value), and using it in the nested rules. The sibling p element gets the width declaration, but doesn't inherit an --arg value:
```css
div {
--arg: 10em;
width: var(--arg); /* OK */
}
div > h2 {
width: var(--arg); /* OK, --arg is inherited */
}
div + p {
width: var(--arg); /* invalid at computed time */
}
```
Replies (1)
-
@AmeliaBR@front-end.social 2026-04-04 05:10
@leaverou@front-end.social That's maybe still not super-intuitive, but it's consistent with established patterns about how custom properties work. It would probably be easily integrated with existing Dev Tools error messages to help people figure out what's going on. And I like that it doesn't invalidate any declarations that *don't* depend on the input argument. Although, it would still break some Sass-style mixins that are just trying to pass in an uncomputed token & use it to generate a set of related rules.