Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions docs/_includes/header_custom.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<button class="btn js-toggle-dark-mode" aria-label="Switch to light mode">
</button>
<div class="js-toggle-dark-mode-wrapper">
<button
class="btn js-toggle-dark-mode"
aria-label="Switch to light mode"
type="button"
>
</button>
</div>

<script>
const toggleDarkMode = document.querySelector(".js-toggle-dark-mode");
Expand Down
42 changes: 40 additions & 2 deletions docs/_sass/custom/custom.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
:root {
--outline-color: #{$outline-color-light};
}

[data-theme="dark"] {
--outline-color: #{$outline-color-dark};
}

html,
body {
height: 100%;
Expand Down Expand Up @@ -29,7 +37,7 @@ div.site-logo {
color: $body-text-color;
}

//Dark mode link styles
// Dark mode link styles
html[data-theme="dark"] {
.main-header a,
.main-header button,
Expand All @@ -56,7 +64,7 @@ html[data-theme="dark"] {
}
}

//Label colors
// Label colors
main {
.label-green {
background-color: $label-success-bg;
Expand All @@ -66,3 +74,33 @@ main {
background-color: $label-error-bg;
}
}

// Outline styles
.search:focus-within,
.btn:focus,
.btn:active,
.btn:focus:hover,
a:focus-visible,
summary:focus-visible {
outline: none;
box-shadow: 0 0 0 3px var(--outline-color);
border-radius: 2px;
transition: box-shadow 0.2s ease;
}
Copy link
Copy Markdown
Member

@samcunliffe samcunliffe Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed fix of

For example:
Screenshot 2025-06-17 at 09 40 35Screenshot 2025-06-17 at 09 40 40

C.f. James' original comment and screenshots in #534. (Also apparent in the video!)


.aux-nav .aux-nav-list-item {
padding: 5px;
}

.nav-list-item {
padding-left: 1px;
padding-right: 1px;
}

.js-toggle-dark-mode {
height: 100%;
}

.js-toggle-dark-mode-wrapper {
padding: 5px;
}
4 changes: 4 additions & 0 deletions docs/_sass/custom/setup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
$blue-400: #4da6ff;
$green-700: #00755c;
$red-600: #d13c3c;
$purple-500: rgba(215, 186, 255, 0.65);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of interest why rgba here rather than a HEX?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I used rgba because it’s easier to adjust the opacity by changing the last argument. There’s also the option to use hex with alpha, like #d13c3c65, where the last two control opacity. However, I’m not sure about browser support for that, and I’ve just got used to using rgba in these cases)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation!

$lavender: #b69cff;

// Semantic mappings
$link-color-dark: $blue-400;
$label-success-bg: $green-700;
$label-error-bg: $red-600;
$outline-color-light: $lavender;
$outline-color-dark: $purple-500;