Skip to content

[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

Merged
merged 2 commits into from
Apr 29, 2025

Conversation

tabatkins
Copy link
Member

No description provided.

Copy link

@JoshTumath JoshTumath left a 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))''.

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was under the impression that the point of the unit was to allow authors to avoid having to manually type calc(... * env(preferred-text-scale)) all over the place; it was supposed to be syntax sugar for that expression, essentially. Thus, it should scale with the local definition of the em; otherwise, authors can just set a variable at the root and use that instead, and we don't care quite as much about the verbosity in that case.

That said, putting some thought into this revealed that the definition of the unit is going to be very problematically tied into the definition of text-size-adjust itself, which is currently both underspecified (it doesn't actually say enough about its effects) and wrongly specified (it claims to be a computed-time adjustment, which testing trivially shows it isn't).

Luckily, the unit isn't meant to be defined by this spec; it goes over into V&U. So I'll just leave the references here for now, and deal with the definition of pem elsewhere when we resolve the text-size-adjust issues more generally.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #11636 for discussion on this.

@tabatkins tabatkins merged commit 051c015 into main Apr 29, 2025
1 check passed
@tabatkins tabatkins deleted the env-text-zoom branch April 29, 2025 18:57
@syncbot syncbot restored the env-text-zoom branch May 2, 2025 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants