Skip to content

Commit b0dc3d9

Browse files
committed
docs: composite inline code over admonition tints
The inline-code chip is an absolute dark surface designed for the page canvas; on an admonition's tinted panel it sits as an opaque slab (Zensical's modern theme has the same defect on its own docs — classic Material mitigated it with a hairline ring on title code, which modern dropped). Scope a tone-on-tone translucent chip to code inside admonitions, the pattern Starlight and Docusaurus ship for code inside callouts; prose chips keep the block-matching dark surface.
1 parent 0d3ef49 commit b0dc3d9

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

docs/extra.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@
7979
}
8080
}
8181

82+
/* Inline code inside admonitions: the chip token is an absolute dark
83+
surface designed for the page canvas, so on a tinted admonition panel it
84+
sits as an opaque slab (Zensical's own docs share this bug). Re-tint it
85+
tone-on-tone instead — translucent foreground, composited over whatever
86+
the panel color is — the same pattern Starlight and Docusaurus ship for
87+
code inside callouts. Prose chips keep the block-matching dark surface;
88+
block code inside admonitions keeps its own surface too. The first
89+
declaration is the fallback where color-mix is unsupported. */
90+
.md-typeset .admonition :not(pre) > code,
91+
.md-typeset details :not(pre) > code {
92+
background-color: var(--md-default-fg-color--lightest);
93+
background-color: color-mix(in srgb, currentcolor 11%, transparent);
94+
color: inherit;
95+
}
96+
8297
/* Headings: the 300-weight light-gray defaults read washed out; use the
8398
full foreground color and a solid weight instead. 700, not 600: only
8499
Inter 300/400/700 are loaded (see the nav__link note above). */

0 commit comments

Comments
 (0)