Re: [csswg-drafts] [css-env-1] Clarify how variables can be detected (#2732)

Hi,

That results in this:

```
<div style="width: env(safe-area-inset-top);"></div>
```

However, one of the specification authors came through with the solution to this (for my scenario at least):

CSS:

```css
:root {
    --sat: env(safe-area-inset-top);
    --sar: env(safe-area-inset-right);
    --sab: env(safe-area-inset-bottom);
    --sal: env(safe-area-inset-left);
}
```

JS:
```javascript
getComputedStyle(document.documentElement).getPropertyValue("--sat")
```

Full info: https://benfrain.com/how-to-get-the-value-of-phone-notches-environment-variables-env-in-javascript-from-css/

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

Received on Thursday, 29 August 2019 11:08:38 UTC