Skip to content

Commit be0e277

Browse files
committed
one more fix
1 parent a7ca665 commit be0e277

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

src/css/custom.css

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,9 +1434,52 @@ code {
14341434
* Queues") had enough slack to absorb the padding and looked fine, which is
14351435
* why this wasn't caught immediately — the bug is width-dependent per title,
14361436
* not universal, so the only universally safe fix is no added width at all.
1437+
*
1438+
* display: inline-block is required, not cosmetic: .nodeLabel (a <span>) is
1439+
* `display: inline` by default, but wraps a block-level <p> — invalid inline
1440+
* content per the CSS spec, which browsers handle via an anonymous-block
1441+
* fixup around the <p>. That fixup detaches the span's own background-color
1442+
* from the box the text actually paints in, so the background silently
1443+
* never appears behind the visible glyphs — confirmed live on a real
1444+
* production page (route-specialized-workloads.mdx's "GPU ML Pool"/
1445+
* "High-Memory Pool" titles, on hardcoded pale cluster fills where a missing
1446+
* background makes the text unreadable), even though getComputedStyle
1447+
* reports the correct background-color and color throughout. A dev-only
1448+
* standalone test tool missed this entirely; it only surfaces with
1449+
* Docusaurus's real surrounding markup. inline-block establishes its own
1450+
* block formatting context, which sidesteps the fixup and paints the
1451+
* background where the text actually is, without disturbing the parent's
1452+
* text-align: center (verified: still centers identically to an unaffected
1453+
* title like "Standard CPU Pool").
14371454
*/
14381455
.docusaurus-mermaid-container .cluster-label .nodeLabel {
14391456
background-color: var(--mermaid-cluster-bg);
1457+
display: inline-block;
1458+
}
1459+
/*
1460+
* A subgraph can itself carry a hardcoded `style X fill:#hex` (e.g.
1461+
* route-specialized-workloads.mdx's GPUPool/MEMPool), the cluster-level
1462+
* equivalent of the hardcoded node fills handled elsewhere in this file —
1463+
* same inline style="fill:#hex !important" mechanism, same fill-only (no
1464+
* stroke) signature. For those specific clusters, the rule above paints a
1465+
* --mermaid-cluster-bg patch that doesn't match the cluster's own actual
1466+
* (pale, non-theme-aware) background at all, so instead of blending it
1467+
* shows as a mismatched solid box sitting on top of the pale fill.
1468+
* Transparent lets the label sit directly on whatever's actually behind it,
1469+
* matching every other unclassed node/text in this codebase that just
1470+
* accepts a hardcoded fill's background as-is rather than fighting it.
1471+
*
1472+
* Text color has to come along with it: the general .cluster text/span rule
1473+
* below still paints this label var(--mermaid-text) (white in dark mode),
1474+
* and white-on-pale is exactly the original unreadable-text bug this
1475+
* stylesheet exists to fix — a transparent background alone would silently
1476+
* reintroduce it. Hardcoded fills in this codebase are always pale,
1477+
* light-mode-only colors (same premise as the equivalent node-level fix),
1478+
* so dark text is always correct here regardless of site theme.
1479+
*/
1480+
.docusaurus-mermaid-container .cluster:has(rect[style*='fill:']):not(:has(rect[style*='stroke:'])) .cluster-label .nodeLabel {
1481+
background-color: transparent;
1482+
color: #1c1e21 !important;
14401483
}
14411484

14421485
/*

0 commit comments

Comments
 (0)