Răsfoiți Sursa

fix(remark-drawio): mark foreignObject reset as !important

Host selectors like `.wiki ol:not(.nav) li` outrank the scoped
`.drawio-viewer foreignObject li` reset on specificity (`:not(.nav)`
contributes a class-level weight), so `all: revert` was being
overridden and the cells continued to clip.

Defending foreignObject content is an adversarial cross-cutting
concern, so opt out of the specificity race with `!important` rather
than chasing host selectors. Mirrors the user-facing Custom CSS
workaround, which also relies on `!important` for the same reason.

Refs #11052

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Yuki Takei 19 ore în urmă
părinte
comite
9cc0f67930

+ 7 - 1
packages/remark-drawio/src/components/DrawioViewer.module.scss

@@ -12,10 +12,16 @@
 // drawio sizes each cell using UA-default HTML metrics and clips overflow via
 // an inline max-height wrapper, so non-default styles (e.g. line-height,
 // margin from a wrapping `.wiki` ruleset) cause label content to be cut off.
+//
+// `!important` is required: host selectors such as `.wiki ol:not(.nav) li`
+// outrank our scoped selector on specificity (`:not(.nav)` adds a class-level
+// weight). Defending the foreignObject content is an adversarial cross-cutting
+// concern, so we explicitly opt out of the specificity contest rather than
+// chasing host selectors.
 .drawio-viewer foreignObject {
   h1, h2, h3, h4, h5, h6,
   p, ul, ol, li, blockquote,
   img, video, table {
-    all: revert;
+    all: revert !important;
   }
 }