-
Notifications
You must be signed in to change notification settings - Fork 706
[css-env-1] Add a text-scale env() (name to be bikeshedded). #10674 #11961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
||
The ''bikeshed-text-scale'' [=environment variable=] | ||
represents the scale factor | ||
of the user agent's operating system font scale. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user agent's operating system font scale lines up with Chrome's immediate plans, where we populate this env var for Android only. Android doesn't have a UA-level user font slider; it only has an OS-level user font slider.
But in the future we hope to populate this env var for all platforms. Most platforms only have one font slider:
- Mac has UA
- CrOS has UA
- Android has OS
Our latest thinking is that we would populate the env var on those platforms from their single sliders.
BUT Windows has both sliders. We're thinking we would populate the env var
on Windows with the product of the two sliders.
Would the definition in this PR ("user agent's operating system font scale") preclude us from exposing the product of the two sliders?
Note that we haven't begun to implement any of this on other platforms, where the demand for such functionality is much lower, so who knows how it will all shake out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing the initial draft!
then ''env(bikeshed-text-scale)'' would resolve to ''2''. | ||
|
||
Note: The ''bsem'' unit represents this same information; | ||
''1em'' is exactly equivalent to ''calc(1em * env(bikeshed-text-scale))''. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't seem right to me. In #10674 (comment), I defined it as the computed value of font-size: medium
× env(bikeshed-text-scale)
I don't think we discussed in the issue whether the unit could be relative to 1em
unit - the computed value of the selected element's font-size
. My understanding was the computed value of 1bsem
would be the same regardless of what element it was used on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think my understanding matches Josh's -- computed value of 1bsem
would be the same regardless of what element it was used on.
No description provided.