Skip to content

Adds dark mode support#18

Open
timcappalli wants to merge 1 commit into
mainfrom
feat/dark-mode
Open

Adds dark mode support#18
timcappalli wants to merge 1 commit into
mainfrom
feat/dark-mode

Conversation

@timcappalli

Copy link
Copy Markdown
Member

Closes #1

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 15, 2026

Copy link
Copy Markdown

Deploying tools-passkeys-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4a14180
Status: ✅  Deploy successful!
Preview URL: https://8bd63e04.tools-passkeys-dev.pages.dev
Branch Preview URL: https://feat-dark-mode.tools-passkeys-dev.pages.dev

View logs

</ul>
</div>
<div class="ms-auto d-flex align-items-center ps-3">
<style>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

<style> tags always go in <head>. Though honestly because of the complexity of this site I'd suggest these styles end up in a .css file, either an existing one or a new one.

show-data-types="false"
show-size="false"
theme='{"base00": "#FFFFFF","base01": "#E0E0E0","base02": "#C5C8C6","base03": "#B4B7B4","base04": "#969896","base05": "#373B41","base06": "#282A2E","base07": "#1D1F21","base08": "#CC342B","base09": "#D63384","base0A": "#FBA922","base0B": "#198844","base0C": "#3971ED","base0D": "#FFBF3B","base0E": "#4F559C","base0F": "#3971ED"}'
theme='{"base00": "var(--bs-body-bg)","base01": "var(--bs-tertiary-bg)","base02": "var(--bs-border-color)","base03": "var(--bs-secondary-color)","base04": "var(--bs-secondary-color)","base05": "var(--bs-body-color)","base06": "var(--bs-body-color)","base07": "var(--bs-body-color)","base08": "#CC342B","base09": "#D63384","base0A": "#FBA922","base0B": "#198844","base0C": "#3971ED","base0D": "#FFBF3B","base0E": "#4F559C","base0F": "#3971ED"}'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Huh, did these colors influence the colors that AI picked for dark mode? I wasn't expecting to see so many substitutions for this color scheme that was otherwise only picked to differentiate code in the JSON viewer. I guess if you're otherwise fine with the appearance of the site in dark mode this is fine.

Image

Comment thread src/index.njk
Comment on lines +9 to +49
<style>
.theme-toggle-group {
background: var(--bs-secondary-bg);
padding: 2px;
border-radius: 50px;
display: flex;
gap: 2px;
}
.theme-toggle-btn {
border: none;
background: none;
width: 22px;
height: 22px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: var(--bs-secondary-color);
transition: all 0.2s ease;
padding: 0;
font-size: 0.75rem;
}
.theme-toggle-btn:hover {
color: var(--bs-body-color);
}
.theme-toggle-btn.active {
background: var(--bs-primary);
color: white !important;
}
</style>
<div class="theme-toggle-group" role="group" aria-label="Theme toggle">
<button class="theme-toggle-btn" data-bs-theme-value="light" title="Light mode">
<i class="bi bi-sun-fill"></i>
</button>
<button class="theme-toggle-btn" data-bs-theme-value="auto" title="Follow system">
<i class="bi bi-circle-half"></i>
</button>
<button class="theme-toggle-btn" data-bs-theme-value="dark" title="Dark mode">
<i class="bi bi-moon-stars-fill"></i>
</button>
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why does this theme picker exist twice? This is the same picker that's currently defined in header.njk above. Me thinks the picker should get split out into its own component if it needs to be used in two different places.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does the fact that the theme picker got duplicated to here mean that index.njk needs to use the header component? 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, I see why now, the individual tools have a header bar that the picker goes into:

Screenshot 2026-06-08 at 3 54 41 AM Screenshot 2026-06-08 at 3 54 43 AM

I don't have a real problem with the location of the picker, but I do think it should still get de-duped for use in both places so we don't end up with behavioral and visual drift over time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add dark mode

2 participants