Potential illegible font size for map attribution and popup contentΒ #7952
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