Skip to content

Commit 95e30eb

Browse files
committed
fix: update legend icons for better alignment
1 parent 0f42eed commit 95e30eb

2 files changed

Lines changed: 17 additions & 9 deletions

File tree

css/styles.css

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -750,18 +750,18 @@ body {
750750
display: flex;
751751
flex-direction: column;
752752
gap: var(--space-xs);
753-
align-items: center;
753+
align-items: flex-start;
754+
width: 100%;
755+
padding-left: var(--space-lg);
754756
}
755757

756758
.legend-item {
757759
display: flex;
758760
align-items: center;
759-
justify-content: center;
760761
font-size: clamp(13px, 1.1vw, 15px);
761762
color: var(--text-primary);
762763
padding: var(--space-xs) 0;
763764
font-weight: 500;
764-
text-align: center;
765765
gap: var(--space-sm);
766766
}
767767

@@ -782,6 +782,15 @@ body {
782782
object-fit: contain;
783783
}
784784

785+
.legend-color-box {
786+
width: 100%;
787+
height: 100%;
788+
display: block;
789+
border-radius: 3px;
790+
border: 1px solid rgba(255, 255, 255, 0.3);
791+
box-sizing: border-box;
792+
}
793+
785794
.legend-label {
786795
font-size: clamp(13px, 1.1vw, 15px);
787796
font-weight: 500;

js/app.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,12 +1277,11 @@ class ShelterAccessApp {
12771277
img.className = 'legend-icon-img';
12781278
iconDiv.appendChild(img);
12791279
} else if (item.type === 'color-box') {
1280-
// Use color boxes for polygon layers and building footprints
1281-
iconDiv.style.cssText = `
1282-
background: ${item.color};
1283-
border: 1px solid rgba(255, 255, 255, 0.3);
1284-
border-radius: 3px;
1285-
`;
1280+
// Use inner div for color boxes to match SVG icon structure
1281+
const colorBox = document.createElement('div');
1282+
colorBox.className = 'legend-color-box';
1283+
colorBox.style.background = item.color;
1284+
iconDiv.appendChild(colorBox);
12861285
}
12871286

12881287
const label = document.createElement('span');

0 commit comments

Comments
 (0)