Skip to content

Commit a32d249

Browse files
chore: add constants for tempDiv padding and gap
1 parent 495c0b5 commit a32d249

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/navigation/Header.svelte

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
1818
const THEME_SWITCHER_WIDTH = 56; // Width of the theme switcher component in pixels
1919
const EXTRA_PADDING = 32; // Extra padding to account for padding and margins in pixels
20+
const LINKS_GAP = '1rem'; // Matches gap-x-4 in the template
21+
const LINK_PADDING = '0.25rem 0.5rem'; // Matches px-2 py-1 in the template
2022
2123
let headerLinks = $state(null);
2224
@@ -59,12 +61,12 @@
5961
tempDiv.style.position = 'absolute';
6062
tempDiv.style.visibility = 'hidden';
6163
tempDiv.style.display = 'flex';
62-
tempDiv.style.gap = '1rem';
64+
tempDiv.style.gap = LINKS_GAP;
6365
6466
if (Object.keys(headerLinks).length > 0) {
6567
Object.keys(headerLinks).forEach((key) => {
6668
const linkDiv = document.createElement('div');
67-
linkDiv.style.padding = '0.25rem 0.5rem';
69+
linkDiv.style.padding = LINK_PADDING;
6870
linkDiv.style.flexShrink = '0';
6971
linkDiv.textContent = key;
7072
tempDiv.appendChild(linkDiv);

0 commit comments

Comments
 (0)