Skip to content
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

Refactor font sizes for text content #8052

Closed
wants to merge 1 commit into from

Conversation

Malvoz
Copy link
Member

@Malvoz Malvoz commented Mar 11, 2022

Comparison

Default Custom font-size [NOTE] Browser setting: Very large
1.7.1
1.8.0-beta.0
PR preview
[NOTE]: The custom font sizes used
html {
  font-size: 200%; /* changes root font-size */
}

body {
  font-size: 0.3em; /* changes parent element font-size */
}

With these particular custom styles, the computed font-size SHOULD be smaller than the default font-size in the screenshots.


1.7.1 1.8.0-beta.0 PR preview
Scales relatively to the root (<html>) font size? ✔️ ✔️
Scales relatively to custom font sizes on (non-root) ascendant elements? ✔️
Respects the user's browser settings? ✔️ ✔️

@Malvoz Malvoz added accessibility Anything related to ensuring no barriers exist that prevent interactions or information access breaking labels Mar 11, 2022
@Malvoz
Copy link
Member Author

Malvoz commented Mar 11, 2022

An alternative solution to the changes suggested here is to convert and use em (as proposed in #7952 (comment)) instead of rem (#7800), though which would not increase the default font size (and as such would not fix #7346 and #8051).

@mourner
Copy link
Member

mourner commented Mar 11, 2022

This is great! But the default font sizes look unreasonably large to me, and completely out of character for interactive maps. The font size legibility guidelines make sense for content-heavy web pages, but it's very different here — popups are usually small and have very limited space to afford gigantic default text size, and attribution isn't really meant to be prominent and read by everyone, it's more of a small aside, unobtrusive and not taking attention away from the map itself.

@Malvoz
Copy link
Member Author

Malvoz commented Mar 11, 2022

@mourner Thanks for the feedback. I don't share the same opinion (#8051), but you're the man. Feel free to close this PR.

@natevw Do you want to send a PR for your proposal for em in #7952? They should have the same effect as this PR I think: #7952 (comment), but without changes to the default font size.

@mourner
Copy link
Member

mourner commented Mar 11, 2022

Maybe we could settle on some kind of a compromise? Still fix relative font sizes and "large" setting, and increase the default size a little bit, but not that much?

@Malvoz Malvoz marked this pull request as draft March 11, 2022 21:08
@Falke-Design
Copy link
Member

I see the benefits for the accessibility but when I think out of my project view and not from Leaflet view, I wouldn't like that the text is after an update to 1.8.0 much bigger especially the attribution control.

I add the blocker label to this PR because we need a descision for the problem: #8044 (comment)

@Falke-Design Falke-Design added the blocker Critical issue or PR that must be resolved before the next release label Mar 12, 2022
@@ -431,8 +430,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
font-size: 0.69rem;
font-size: smaller;
Copy link
Member

Choose a reason for hiding this comment

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

Also, do we know if relative sizes like smaller work in older IE versions? I'd maybe leave the adjusted pixel definitions before new ones just in case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for pointing this out. I thought about it but it still managed to slip my mind. I did a quick search for browser support but didn't find anything. The lack of support data is usually indicative of legacy features, but unless we find any support data we should keep the px variants as fallback.

@natevw
Copy link
Contributor

natevw commented Mar 13, 2022

@natevw Do you want to send a PR for your proposal for em in #7952? They should have the same effect as this PR I think: #7952 (comment), but without changes to the default font size.

Yes, I still have my VM set up for this project and could do so this coming week. Basically my approach would be to replace the new rem to just em.

@Malvoz
Copy link
Member Author

Malvoz commented Mar 14, 2022

Closing per #8057:

I'm wary about addressing #7952 (like in #8052) because once we fix it, we're getting a bunch of potential problems from the other side

The "potential problems" were expected and described in this PR, but maybe a big breaking change like this (if accepted) is better suited for v2.0.0.

@Malvoz Malvoz closed this Mar 14, 2022
@Malvoz Malvoz deleted the font-size-refactor branch March 15, 2022 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Anything related to ensuring no barriers exist that prevent interactions or information access blocker Critical issue or PR that must be resolved before the next release breaking needs discussion
Projects
None yet
4 participants