Skip to content

Commit 011abe4

Browse files
authored
bug: ui theme is inaccessible (#106)
* increase contrast * aria-labels
1 parent e5c30de commit 011abe4

4 files changed

Lines changed: 25 additions & 13 deletions

File tree

css/code.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616

1717
html:not(.dark) .z-code {
18-
@apply bg-gray-100;
18+
@apply bg-gray-50;
1919
}
2020

2121
.z-code {

css/content.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
@layer base {
22

3-
/* Typography rules for guide and blog content. The `to (.bc)` boundary
4-
stops descent into shortcode subtrees so basecoat components keep
5-
their own styling. */
3+
/*
4+
Typography rules for guide and blog content. The `to (.bc)` boundary stops
5+
descent into shortcode subtrees so basecoat components keep their own styling.
6+
*/
67
@scope (.content) to (.bc) {
78

89
:is(h1, h2, h3, h4, h5) {
@@ -47,7 +48,7 @@
4748
}
4849

4950
a {
50-
@apply text-primary hover:underline;
51+
@apply text-link hover:text-link-hover hover:underline;
5152
}
5253
}
5354
}

css/theme.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
4949
--tracking-normal: 0em;
5050
--spacing: 0.25rem;
51+
--link: oklch(0.54 0.2 150);
52+
--link-hover: oklch(0.7 0.2 150);
5153
}
5254

5355
.dark {
@@ -98,6 +100,8 @@
98100
--shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 4px 6px -1px hsl(0 0% 0% / 0.10);
99101
--shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.10), 0 8px 10px -1px hsl(0 0% 0% / 0.10);
100102
--shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25);
103+
--link: var(--primary);
104+
--link-hover: oklch(from var(--primary) 0.86 c h);
101105
}
102106

103107
@theme inline {
@@ -147,6 +151,9 @@
147151
--shadow-lg: var(--shadow-lg);
148152
--shadow-xl: var(--shadow-xl);
149153
--shadow-2xl: var(--shadow-2xl);
154+
155+
--color-link: var(--link);
156+
--color-link-hover: var(--link-hover);
150157
}
151158

152159
@layer base {

templates/navbar.html

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
<div class="flex h-14 w-full items-center gap-2 px-4">
2-
<button type="button" onclick="document.dispatchEvent(new CustomEvent('basecoat:sidebar'))" aria-label="Toggle sidebar" data-tooltip="Toggle sidebar"
3-
data-side="bottom" data-align="start" class="btn-sm-icon-ghost mr-auto size-7 -ml-1.5">
2+
<button type="button" onclick="document.dispatchEvent(new CustomEvent('basecoat:sidebar'))"
3+
aria-label="Toggle sidebar" data-tooltip="Toggle sidebar"
4+
data-side="bottom" data-align="start" class="btn-sm-icon-ghost mr-auto size-7 -ml-1.5">
45
<span class="iconify lucide--sidebar"></span>
56
</button>
67
<div class="relative">
7-
<span class="iconify lucide--search absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground pointer-events-none"></span>
8+
<span
9+
class="iconify lucide--search absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground pointer-events-none"></span>
810
<input class="input h-8 pl-8" id="input-with-text" type="search" placeholder="Search the docs">
911
</div>
1012
<button type="button" aria-label="Toggle dark mode" data-tooltip="Toggle dark mode" data-side="bottom"
11-
onclick="document.dispatchEvent(new CustomEvent('basecoat:theme'))" class="btn-icon-outline size-8">
13+
onclick="document.dispatchEvent(new CustomEvent('basecoat:theme'))" class="btn-icon-outline size-8">
1214
<span class="iconify lucide--sun hidden dark:block"></span>
1315
<span class="iconify lucide--moon block dark:hidden"></span>
1416
</button>
15-
<a href="{{ config.extra.url.github }}" class="btn-icon-outline size-8" target="_blank" rel="noopener noreferrer" data-tooltip="GitHub repository"
16-
data-side="bottom" data-align="end">
17+
<a href="{{ config.extra.url.github }}" class="btn-icon-outline size-8" target="_blank" rel="noopener noreferrer"
18+
data-tooltip="GitHub repository"
19+
data-side="bottom" data-align="end" aria-label="Link to GitHub repository">
1720
<span class="iconify mdi--github"></span>
1821
</a>
19-
<a href="{{ config.extra.url.discord }}" class="btn-icon-outline size-8" target="_blank" rel="noopener noreferrer" data-tooltip="Discord channel"
20-
data-side="bottom" data-align="end">
22+
<a href="{{ config.extra.url.discord }}" class="btn-icon-outline size-8" target="_blank" rel="noopener noreferrer"
23+
data-tooltip="Discord channel"
24+
data-side="bottom" data-align="end" aria-label="Link to Discord channel">
2125
<span class="iconify fa7-brands--discord text-xs"></span>
2226
</a>
2327
</div>

0 commit comments

Comments
 (0)