Skip to content

Commit b64504b

Browse files
committed
docs: sidebar badge on the landing previews is readable in the dark theme, primary background with its contrast text like in the app AdminForth/2005
1 parent 2a2ca59 commit b64504b

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎documentation/static/landing-previews/branding.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
.side .nav.is-on .i { color: #FFFFFF; }
1616
.side .nav-sep { background: rgba(255, 255, 255, .14); }
1717
.side .nav-head { color: rgba(255, 255, 255, .5); }
18-
.side .count { background: #38BDF8; color: #0B1430; }
18+
.side .nav .count { background: #38BDF8; color: #0B1430; }
1919
.acts { display: flex; gap: 2px; color: var(--muted); }
2020
.at td.act { padding-top: 8px; padding-bottom: 8px; }
2121
.at tr.is-sel td { background: var(--accent-soft); }

‎documentation/static/landing-previews/previews.css‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ button { font: inherit; }
134134
.kbd { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-family: 'Geist Mono', ui-monospace, monospace; font-size: 11px; line-height: 1; }
135135
.btn-primary .kbd { background: transparent; border-color: rgba(127, 127, 127, .35); color: inherit; opacity: .7; }
136136
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--accent); color: #FFFFFF; }
137+
/* primary with its contrast color, like lightPrimary / darkPrimary and their *Contrast tokens */
138+
:root.dark .count { background: var(--accent-fg); color: var(--bg); }
137139
.btn-primary .count { background: var(--on-ink); color: var(--ink); }
138140

139141
/* links */
@@ -197,6 +199,7 @@ button { font: inherit; }
197199
.nav.is-on { background: var(--surface-3); color: var(--text); font-weight: 500; }
198200
.nav.is-on .i { color: var(--text); }
199201
.nav .trail { margin-left: auto; color: var(--faint); }
202+
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; font-weight: 500; }
200203
.nav-head { padding: 14px 10px 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
201204
.nav-sep { height: 1px; background: var(--border); margin: 8px 10px; }
202205

‎documentation/static/landing-previews/previews.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ for (const side of document.querySelectorAll('.side')) {
2626
if (item.heading) {
2727
return `<div class="nav-sep"></div>${rail ? '' : `<div class="nav-head">${item.heading}</div>`}`;
2828
}
29-
const text = rail ? '' : `${item.label}${item.badge ? `<span class="count trail">${item.badge}</span>` : ''}`;
29+
const text = rail ? '' : `${item.label}${item.badge ? `<span class="count">${item.badge}</span>` : ''}`;
3030
return `<span class="nav${item.label === side.dataset.active ? ' is-on' : ''}">${icon(item.icon)}${text}</span>`;
3131
});
3232
const logo = `<svg><use href="brands.svg#${side.dataset.logo ?? 'adminforth'}"/></svg>`;

0 commit comments

Comments
 (0)