Open
Description
It might be a good idea to have a "Styling the map" page which would include explanations for:
- pre-styling to avoid FOUC (generally always recommended)
- using fallback content:
- importance of the
:defined
pseudo-class - pre-styling to avoid Layout Shift (occurs because the browser has to wait for the element to be defined before applying
height
/width
) - resetting
display: none
of fallback content if JS is disabled
- importance of the
And other - perhaps more common use cases - such as:
- responsive maps (
max-width: 100%
) - prerequisite for
%
value height maps - full viewport sized maps (without scrollbars! 😋)
(see also Fix issue with standalone maps not always spanning the entire visible viewport experiments#93)
We could then link to that page from https://github.com/Maps4HTML/Web-Map-Custom-Element#styling-the-map-element (or remove that section altogether).