Re: [csswg-drafts] Proposal: Custom CSS Functions & Mixins (#9350)

Exactly, `@sames-as` – or `@include ` in [#3714](https://github.com/w3c/csswg-drafts/issues/3714#issuecomment-1407783568) – could only really work with a special kind of selector that did not actually match anything in the (HTML) document directly. 

~~~~ css
$fg { color: var(--color, red); }
$bg { background: var(--bg, red); }
$br { border-radius: 5px; }

.foo { @same-as $fg; }
.bar { @same-as $bg; }
[round] { @same-as $br; }

#myfoo1 {
  color: black;
  @same-as $fg $br;
  padding: .3rem;
}
#myfoo2 {
  @same-as $fg $bg;
  --color: green;
  --bg: white;
  color: orange;
}
foo {
  @same-as $fg; /* no class to element aliasing */
  --color: rebeccapurple;
}
~~~~

-- 
GitHub Notification of comment by Crissov
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9350#issuecomment-1968252061 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 28 February 2024 05:20:48 UTC