Skip to content

Commit e9c8686

Browse files
committed
fix: add box shadow instead of outline for all focusable elements, add some extra spacing to the elements
1 parent 96b4fe3 commit e9c8686

3 files changed

Lines changed: 51 additions & 3 deletions

File tree

docs/_includes/header_custom.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
<button class="btn js-toggle-dark-mode" aria-label="Switch to light mode">
2-
3-
</button>
1+
<div class="js-toggle-dark-mode-wrapper">
2+
<button
3+
class="btn js-toggle-dark-mode"
4+
aria-label="Switch to light mode"
5+
type="button"
6+
>
7+
8+
</button>
9+
</div>
410

511
<script>
612
const toggleDarkMode = document.querySelector(".js-toggle-dark-mode");

docs/_sass/custom/custom.scss

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
:root {
2+
--outline-color: #{$outline-color-light};
3+
}
4+
5+
[data-theme="dark"] {
6+
--outline-color: #{$outline-color-dark};
7+
}
8+
19
html,
210
body {
311
height: 100%;
@@ -66,3 +74,33 @@ main {
6674
background-color: $label-error-bg;
6775
}
6876
}
77+
78+
//Outline styles
79+
.search:focus-within,
80+
.btn:focus,
81+
.btn:active,
82+
.btn:focus:hover,
83+
a:focus-visible,
84+
summary:focus-visible {
85+
outline: none;
86+
box-shadow: 0 0 0 3px var(--outline-color);
87+
border-radius: 2px;
88+
transition: box-shadow 0.2s ease;
89+
}
90+
91+
.aux-nav .aux-nav-list-item {
92+
padding: 5px;
93+
}
94+
95+
.nav-list-item {
96+
padding-left: 1px;
97+
padding-right: 1px;
98+
}
99+
100+
.js-toggle-dark-mode {
101+
height: 100%;
102+
}
103+
104+
.js-toggle-dark-mode-wrapper {
105+
padding: 5px;
106+
}

docs/_sass/custom/setup.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
$blue-400: #4da6ff;
33
$green-700: #00755c;
44
$red-600: #d13c3c;
5+
$purple-500: rgba(215, 186, 255, 0.65);
6+
$lavender: #b69cff;
57

68
// Semantic mappings
79
$link-color-dark: $blue-400;
810
$label-success-bg: $green-700;
911
$label-error-bg: $red-600;
12+
$outline-color-light: $lavender;
13+
$outline-color-dark: $purple-500;

0 commit comments

Comments
 (0)