mapbox-controls icon indicating copy to clipboard operation
mapbox-controls copied to clipboard

Style control buttons have one rounded corner when focused

Open foundryspatial-duncan opened this issue 4 years ago • 0 comments

The built-in mapbox-gl styles apply a border-radius to the first and last buttons in a control group:

.mapboxgl-ctrl-group button:focus:first-child {...}
.mapboxgl-ctrl-group button:focus:last-child {...}

The style control's buttons are displayed horizontally so the top/bottom edge border radius doesn't apply here. (It's more visible if you change the -active color to something darker:

Here it is in the docs' excample: Screenshot from 2021-11-25 16-04-41 Screenshot from 2021-11-25 16-04-47

Solution is to just override those styles. Here's what I did:

// scss
.mapbox-control-styles button {
    &, &:focus {
        border-radius: 0;
    }
}

foundryspatial-duncan avatar Nov 26 '21 00:11 foundryspatial-duncan