Re: [csswg-drafts] [css-values-4] inherit() function: like var() for parent value, for any property (#2864)

Working with custom properties, I've wanted this a few times. Here are a few examples (some may duplicate Leas examples above):

```css
.examples {
  /* change a value locally, without losing context */
  --columns: parent(--span);
  --span: 3;
  width: calc(var(--span) / var(--columns) * 100%);

  /* normal properties */
  color: color-contrast(parent(background-color) vs black, white);
  margin: calc(parent(padding) * -1);

  /* more generic patterns */
  --alternate: calc(parent(--alternate) * -1);
  --count: calc(parent(--count) + 1);

  --switch-1: parent(--switch-2);
  --switch-2: parent(--switch-1);
}
```

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


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

Received on Wednesday, 31 March 2021 04:54:10 UTC