Skip to content

Conversation

@alexshk
Copy link

@alexshk alexshk commented Sep 8, 2019

mapbox-gl-directions and mapbox-gl-geocoder both have conflicting .mapboxgl-ctrl-geocoder CSS class. This PR adds a scoped class to fix the issue.

@alexshk alexshk changed the title Fix for #223 Fixes broken style when using MapboxDirections and MapboxGeocoder Sep 8, 2019
// Template
var el = document.createElement('div');
el.className = 'mapboxgl-ctrl-geocoder';
el.className = 'mapboxgl-ctrl-geocoder mapboxgl-ctrl-geocoder-directions';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we can't use replace mapboxgl-ctrl-geocoder here with mapboxgl-ctrl-geocoder-directions?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But does this mean if I'm changing styles for the MapboxGeocoder I'll inadvertently also change the style used by MapboxDirections?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Berkmann18
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants