Skip to content

fix: restore dark mode text color after Docusaurus 3.10 update - #302

Merged
hoefnageltom merged 2 commits into
mainfrom
fix/dark-mode-text-color
Nov 11, 2026
Merged

hoefnageltom merged 2 commits into
mainfrom
fix/dark-mode-text-color

Conversation

@hoefnageltom

@hoefnageltom hoefnageltom commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Problem

Since #300 (Node 24 / npm audit), Docusaurus went from 3.9.2 to 3.10.2. In dark mode the text is now dark, too (see https://api-documentation.homewizard.com/docs/introduction/).

The new CSS build places the :root { … } variable block from custom.css after the [data-theme='dark'] { … } block. Both selectors have the same specificity (0,1,0), so the light values (e.g. --ifm-font-color-base: #111828) override the dark ones.

Fix

Change the dark selector to :root[data-theme='dark'] (specificity 0,2,0), so the dark variables win regardless of the order in the built CSS.

Verification

  • npm run build succeeds

The Docusaurus 3.10 CSS build emits the :root variable block after the
[data-theme='dark'] block. Both have equal specificity, so the light
values won and text stayed dark in dark mode. Scope the dark block to
:root[data-theme='dark'] so it wins regardless of order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 3d23e92):

https://hw-api-documentation--pr302-fix-dark-mode-text-c-ul3mn2c7.web.app

(expires Wed, 18 Nov 2026 10:22:58 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 4accc1c887f1346ec9c563d5645c74c94f610c07

@hoefnageltom
hoefnageltom merged commit d89ea01 into main Nov 11, 2026
10 checks passed
@hoefnageltom
hoefnageltom deleted the fix/dark-mode-text-color branch November 11, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants