Skip to content

Potential illegible font size for map attribution and popup contentΒ #7952

Closed
@natevw

Description

As was foretold by #7571 (comment), the changes made in #7571 / #7800 can result in very small font sizes in some contexts. I.e. looks like the IE compatibility concern was addressed, but not the general issue of "what happens if a site has its own html { font-size: --arbitrary-value; }"?

For example one site I'm maintaining was started out years ago based on a Bootstrap stylesheet that makes a rem work out to 10px and this led to nearly-illegible popup and attribution content after updating to the latest Leaflet. [To be clear: when the rem is set to 10px or 62.5% at the html level, usually the initial em font size for the page is then scaled back up at the body level. I'm not complaining about the page and Leaflet having too-small text β€”Β only Leaflet ends up with tiny text in practice! See example in my later comment below.]

In my case I simply worked around by adding a subset of this

// [old] WORKAROUND: 
.leaflet-container { font-size: 12px; }
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale,
.leaflet-control-scale-line { font-size: 11px; }

UPDATE: now after #8057 the workaround should need only:

// set up units to match Leaflet expectation
.leaflet-container { font-size: 1.2rem; }

to the site's own stylesheet which is included after the vendored Leaflet one and so takes precedence.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions