Skip to content

Commit

Permalink
Use content box sizing instead of negative margins
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Aug 12, 2024
1 parent 3f4cba4 commit 96ac0fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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
3 changes: 3 additions & 0 deletions app/assets/stylesheets/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ body.small-nav {
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

0 comments on commit 96ac0fb

Please sign in to comment.