feat: default-theme links follow the macOS accent color#19
Merged
Conversation
The content pane's link/anchor/marker color came from a fixed per-theme `--accent` CSS variable, so it ignored the accent the user picked in System Settings — even though the native chrome already tracks it via `Color.accentColor`. Resolve `NSColor.controlAccentColor` (per light/dark) to a hex string and push it to bridge.js as `setAccent`, which applies it as an inline `--accent` on the standard theme only. The Editorial/Terminal themes own their palettes, so an inline override (which would win over their `html[data-theme]` rules) is removed while one of those is active. Re-pushes on accent change (`systemColorsDidChangeNotification`) and on light/dark change, and replays on the web view's `ready` — mirroring the existing setTheme/setReadingTheme flow. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XuYtHEiHpVijSVh6wrrdi1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The native chrome already tracks the macOS accent color (via
Color.accentColor), but the rendered markdown content pane did not — links, heading anchors, and markers used a fixed per-theme--accentCSS variable, so they ignored the accent the user picked in System Settings.This wires the content pane's standard theme to the system accent:
MarkdownWebViewresolvesNSColor.controlAccentColorunder the active appearance (it maps to a different concrete color in light vs dark) and flattens it to a#rrggbbstring.window.ReaderMd.setAccent(hex)inbridge.js, which applies it as an inline--accentonly on the standard theme. The Editorial and Terminal reading themes own their palettes, so the inline override (which would win over theirhtml[data-theme]rules) is removed while one of those is active.NSColor.systemColorsDidChangeNotification) and on light/dark change, and replays on the web view'sready— mirroring the existingsetTheme/setReadingThemeflow.Chrome and
Color.accentColorare untouched.Related issue
Closes #
Testing
I don't have a macOS toolchain in this environment (the app needs the macOS 26 SDK;
swiftisn't available on Linux), so this has not been built or run yet.bridge.jspassesnode --check. Please verify locally:swift runManual checks to run:
Checklist
performAsCurrentDrawingAppearanceis macOS 11+AppState— follows the existingsetTheme/setReadingThemereplay pattern inMarkdownWebView🤖 Generated with Claude Code
https://claude.ai/code/session_01XuYtHEiHpVijSVh6wrrdi1
Generated by Claude Code