Open
Description
In line with Open UI's component spec template we should name parts of components using the HTML part
attribute.
This would enable author- and user style sheets (requested in #297) via the CSS ::part()
pseudo-element. And to some extent help us answer how styling MapML with CSS works.
Example
If we set part="reload-button"
on the reload button, authors (and users/user style sheets) can now style the reload button:
<style>
::part(reload-button) {
color: white;
background-color: black;
}
/* I also briefly experimented with feature styling */
::part(feature) {
fill: green;
stroke: lime;
}
/* or scoped (`:defined` is optional): `mapml-viewer:defined::part(...) {}` */
</style>
<mapml-viewer ... controls>
<layer- ...>
</mapml-viewer>

Notes
We should document any named parts as eligible for styling (related: Maps4HTML/web-map-doc#26).
References
- HTML
part
attribute definition: https://www.w3.org/TR/css-shadow-parts/#part-attr (91%~ browser support) - CSS
::part
pseudo-element definition: https://www.w3.org/TR/css-shadow-parts/#part (91%~ browser support)