Post #1096775
2026-04-04 01:38 UTC
RE: https://front-end.social/@leaverou/116297807826814028
Thank you all for voting! Thanks to your input we managed to reverse the resolution that forced all mixins to be scoped โ sibling and ancestor rules will no longer be silently dropped from mixins. ๐
Relevant WG resolution: https://github.com/w3c/csswg-drafts/issues/13727#issuecomment-4173187508
My slides: https://webplatform.design/talks/mixins
Replies (1)
-
@AmeliaBR@front-end.social 2026-04-04 05:06
@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 */ } ```