Expose env() values to JavaScript

As per https://github.com/w3c/csswg-drafts/issues/2732


I would like to know if there is intent to expose the values of env() values to JavaScript?


These values have been in iOS devices for nearly two years now and other than UA sniffing combined with screen measurement we don't have any means at our disposal to read in the values in JavaScript.


Is there any progress on exposing these values to script?

Replies

Turns out can do it by assigning the value of the environment variable to a CSS custom property and reading in. More: https://benfrain.com/how-to-get-the-value-of-phone-notches-environment-variables-env-in-javascript-from-css/