I'd like to override the default style of Leaflet 1.0.0 tooltips, especially the bubble/frame. I don't see any options or methods for this. How do I hook into the CSS? I want to change layers individually, so I need to select each layer's tooltips individually with CSS.
[GIS] Overriding Leaflet tooltip style
cssleaflet
Best Answer
The
L.Tooltip
class includes aclassName
option (inherited from theDivOverlay
class), which will be converted into a CSS class when the tooltip is displayed. e.g.:Then, it's just a matter of defining that CSS class. The tip is a bit tricky, as it needs working with pseudo-elements and leaflet CSS classes:
See a working example here.