Fix dark mode hr colour to use CSS variable instead of color-mod#1042
Fix dark mode hr colour to use CSS variable instead of color-mod#1042jonhickman wants to merge 1 commit intoTryGhost:mainfrom
Conversation
Replace color-mod(var(--color-darkmode) l(+8%)) with var(--color-secondary-text) for hr border and background in dark mode, consistent with how other secondary text colours are handled.
WalkthroughThe pull request updates dark-mode styling for horizontal rule elements ( Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@assets/css/screen.css`:
- Around line 2279-2285: The dark-scheme rules for hr in the html.auto-color
block must mirror the html.dark-mode change: locate the html.auto-color hr and
html.auto-color .gh-content hr:after rules (the ones still using color-mod(...))
and replace their color-mod(...) usages with the same tokens used in
html.dark-mode—use var(--color-secondary-text) for the hr color and for the
hr:after background, and ensure the box-shadow color matches
var(--color-darkmode) as in html.dark-mode so both auto-color and explicit
dark-mode paths render consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: ed52f23f-7185-43c3-b601-1aedc9950830
⛔ Files ignored due to path filters (1)
assets/built/screen.css.mapis excluded by!**/*.map
📒 Files selected for processing (2)
assets/built/screen.cssassets/css/screen.css
| html.dark-mode hr { | ||
| border-top-color: color-mod(var(--color-darkmode) l(+8%)); | ||
| border-top-color: var(--color-secondary-text); | ||
| } | ||
|
|
||
| html.dark-mode .gh-content hr:after { | ||
| background: color-mod(var(--color-darkmode) l(+8%)); | ||
| background: var(--color-secondary-text); | ||
| box-shadow: var(--color-darkmode) 0 0 0 5px; |
There was a problem hiding this comment.
Mirror this token change in the html.auto-color dark-scheme block.
html.dark-mode now uses var(--color-secondary-text), but html.auto-color hr / hr:after still use color-mod(...) (Line 2474, Line 2478). This makes dark appearance inconsistent depending on mode path.
🎯 Proposed fix
`@media` (prefers-color-scheme: dark) {
@@
html.auto-color hr {
- border-top-color: color-mod(var(--color-darkmode) l(+8%));
+ border-top-color: var(--color-secondary-text);
}
html.auto-color .gh-content hr:after {
- background: color-mod(var(--color-darkmode) l(+8%));
+ background: var(--color-secondary-text);
box-shadow: var(--color-darkmode) 0 0 0 5px;
}
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@assets/css/screen.css` around lines 2279 - 2285, The dark-scheme rules for hr
in the html.auto-color block must mirror the html.dark-mode change: locate the
html.auto-color hr and html.auto-color .gh-content hr:after rules (the ones
still using color-mod(...)) and replace their color-mod(...) usages with the
same tokens used in html.dark-mode—use var(--color-secondary-text) for the hr
color and for the hr:after background, and ensure the box-shadow color matches
var(--color-darkmode) as in html.dark-mode so both auto-color and explicit
dark-mode paths render consistently.
Summary
color-mod(var(--color-darkmode) l(+8%))withvar(--color-secondary-text)forhrborder and background in dark modeTest plan
hrelements render correctly in dark mode