Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set layer button size relative to font size #5067

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/javascripts/leaflet.layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ L.OSM.layers = function (options) {
.prop("checked", map.hasLayer(layer))
.appendTo(buttonContainer);

var item = $("<label class='btn btn-outline-primary border-4 rounded-3 bg-transparent position-absolute top-0 start-0 bottom-0 end-0 m-n1 overflow-hidden'>")
var item = $("<label class='btn btn-outline-primary border-4 rounded-3 bg-transparent position-absolute p-0 h-100 w-100 overflow-hidden'>")
.prop("for", id)
.append($("<span class='badge position-absolute top-0 start-0 rounded-top-0 rounded-start-0 py-1 px-2 bg-body bg-opacity-75 text-body text-wrap text-start fs-6 lh-base'>").append(layer.options.name))
.appendTo(buttonContainer);
Expand Down
5 changes: 4 additions & 1 deletion app/assets/stylesheets/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,12 @@ body.small-nav {

.layers-ui {
.base-layers > * {
height: 56px;
height: 3.5rem;

> .btn {
box-sizing: content-box;
top: - map.get($border-widths, 4);
left: - map.get($border-widths, 4);
--bs-btn-border-color: var(--bs-body-bg);
}
> .btn:hover {
Expand Down