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

Re: [csswg-drafts] Updating the css `env()` function to enable selection by index from a list of pre-defined environment variables (#5622)

From: Daniel Libby via GitHub <sysbot+gh@w3.org>
Date: Thu, 15 Oct 2020 08:22:03 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-708985992-1602750121-sysbot+gh@w3.org>
Reducing verbosity wasn't a goal for introducing `index()` &mdash; we were mainly concerned with two aspects: 
1. being able to represent the arbitrary values in spec (i.e. I don't *think* you could specify that `viewport-segment-n-width` is a variable that is potentially valid for all `n`)
1. compatibility with the existing `env()` syntax, given that the fallback value comes after the comma.  

If I'm wrong about (1) then adding the variables with permutations to the spec sounds like a reasonable path forward. Else what you proposed for extending the `env()` syntax to have an optional integer to the first 'argument' (before the comma) seems like a nice way to express this concept (and is less verbose than an `index()` function).

We were also thinking something like `index()` might eventually have broader applicability, say for use with `var()` assuming you could declare array-like variables, but again extending the syntax with an optional integer would work well in the same way.



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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 15 October 2020 08:22:05 UTC

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