W3C home > Mailing lists > Public > public-css-archive@w3.org > May 2020

Re: [csswg-drafts] [css-env] Adding custom env() variables (#2627)

From: flavi1 via GitHub <sysbot+gh@w3.org>
Date: Wed, 06 May 2020 14:21:29 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-624678754-1588774888-sysbot+gh@w3.org>

Maybe something like this:
```css
@constants {
    --my-unalterable-var: my_Value_That_Is_Selector_Context_Agnostic;
    --breakpoint-s: 640px;
    --body-bg: blue;
}

@media screen and (min-width: var(--breakpoint-s, 300px)) {
    body {
        --body-bg: red; /* no effect, because --body-bg is already a constant (then it's unalterable) */
        background-color: var(--body-bg, green); /* blue, because --body-bg is simply already defined */
    }
}
```

I'm going to
1 - Search in tickets if something similar exists.
2 - Post a ticket if not.

-- 
GitHub Notification of comment by flavi1
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2627#issuecomment-624678754 using your GitHub account
Received on Wednesday, 6 May 2020 14:21:31 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:06 UTC