Fixes broken style when using MapboxDirections and MapboxGeocoder#226
Fixes broken style when using MapboxDirections and MapboxGeocoder#226alexshk wants to merge 3 commits intomapbox:mainfrom
Conversation
| // Template | ||
| var el = document.createElement('div'); | ||
| el.className = 'mapboxgl-ctrl-geocoder'; | ||
| el.className = 'mapboxgl-ctrl-geocoder mapboxgl-ctrl-geocoder-directions'; |
There was a problem hiding this comment.
Is there a reason we can't use replace mapboxgl-ctrl-geocoder here with mapboxgl-ctrl-geocoder-directions?
There was a problem hiding this comment.
Actually, that was my first thought. But this will break styles for the guys who already using current class name, this why I added additional class
There was a problem hiding this comment.
But does this mean if I'm changing styles for the MapboxGeocoder I'll inadvertently also change the style used by MapboxDirections?
There was a problem hiding this comment.
Theoretically, it is possible to break style by adding something in MapboxGeocoder, but I don't think this may happen. For example outline: 2px solid red in MapboxGeocder styles will add a red outline for MapboxDirections because outline isn't overridden in MapboxDirections styles.
|
What's blocking this PR? https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-directions/v4.1.0/mapbox-gl-directions.css is still clashing with https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.5.1/mapbox-gl-geocoder.css with ruins its UI. |
mapbox-gl-directions and mapbox-gl-geocoder both have conflicting
.mapboxgl-ctrl-geocoderCSS class. This PR adds a scoped class to fix the issue.