@diagrammo/dgmo 0.81.0 → 0.82.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/block.css +11 -4
- package/dist/block.js +12 -5
- package/package.json +1 -1
package/dist/block.css
CHANGED
|
@@ -9,9 +9,16 @@
|
|
|
9
9
|
* swallowed into a rule they then emit as garbage. */
|
|
10
10
|
|
|
11
11
|
/* === Color-mode visibility (dual-render) ===
|
|
12
|
-
* The dark wrapper also carries
|
|
12
|
+
* The dark wrapper also carries an inline display:none, so a page that never
|
|
13
13
|
* loaded this stylesheet shows the light diagram rather than both of them.
|
|
14
|
-
*
|
|
14
|
+
* The two reveal rules are !important because of it: an inline declaration
|
|
15
|
+
* outranks every normal author rule, and only an important one beats it.
|
|
16
|
+
*
|
|
17
|
+
* That inline style replaced the "hidden" ATTRIBUTE in issue 647. Tailwind v4
|
|
18
|
+
* hides [hidden] with !important from inside a cascade layer, and a layered
|
|
19
|
+
* important declaration outranks an unlayered one at ANY specificity — so no
|
|
20
|
+
* rule here could reveal the dark wrapper, and every diagram on a Tailwind v4
|
|
21
|
+
* host was a zero-height empty box in dark mode.
|
|
15
22
|
* Keep the two host conventions in separate rule blocks — the adapters
|
|
16
23
|
* rewrite by literal replace and a folded rule would half-rewrite. */
|
|
17
24
|
.dgmo-dark {
|
|
@@ -21,13 +28,13 @@
|
|
|
21
28
|
display: none;
|
|
22
29
|
}
|
|
23
30
|
[data-theme="dark"] .dgmo-dark {
|
|
24
|
-
display: block;
|
|
31
|
+
display: block !important;
|
|
25
32
|
}
|
|
26
33
|
html.dark .dgmo-light {
|
|
27
34
|
display: none;
|
|
28
35
|
}
|
|
29
36
|
html.dark .dgmo-dark {
|
|
30
|
-
display: block;
|
|
37
|
+
display: block !important;
|
|
31
38
|
}
|
|
32
39
|
|
|
33
40
|
/* === Diagram sizing ===
|
package/dist/block.js
CHANGED
|
@@ -587,9 +587,16 @@ var BLOCK_CSS = `
|
|
|
587
587
|
* swallowed into a rule they then emit as garbage. */
|
|
588
588
|
|
|
589
589
|
/* === Color-mode visibility (dual-render) ===
|
|
590
|
-
* The dark wrapper also carries
|
|
590
|
+
* The dark wrapper also carries an inline display:none, so a page that never
|
|
591
591
|
* loaded this stylesheet shows the light diagram rather than both of them.
|
|
592
|
-
*
|
|
592
|
+
* The two reveal rules are !important because of it: an inline declaration
|
|
593
|
+
* outranks every normal author rule, and only an important one beats it.
|
|
594
|
+
*
|
|
595
|
+
* That inline style replaced the "hidden" ATTRIBUTE in issue 647. Tailwind v4
|
|
596
|
+
* hides [hidden] with !important from inside a cascade layer, and a layered
|
|
597
|
+
* important declaration outranks an unlayered one at ANY specificity \u2014 so no
|
|
598
|
+
* rule here could reveal the dark wrapper, and every diagram on a Tailwind v4
|
|
599
|
+
* host was a zero-height empty box in dark mode.
|
|
593
600
|
* Keep the two host conventions in separate rule blocks \u2014 the adapters
|
|
594
601
|
* rewrite by literal replace and a folded rule would half-rewrite. */
|
|
595
602
|
.dgmo-dark {
|
|
@@ -599,13 +606,13 @@ var BLOCK_CSS = `
|
|
|
599
606
|
display: none;
|
|
600
607
|
}
|
|
601
608
|
[data-theme="dark"] .dgmo-dark {
|
|
602
|
-
display: block;
|
|
609
|
+
display: block !important;
|
|
603
610
|
}
|
|
604
611
|
html.dark .dgmo-light {
|
|
605
612
|
display: none;
|
|
606
613
|
}
|
|
607
614
|
html.dark .dgmo-dark {
|
|
608
|
-
display: block;
|
|
615
|
+
display: block !important;
|
|
609
616
|
}
|
|
610
617
|
|
|
611
618
|
/* === Diagram sizing ===
|
|
@@ -1090,7 +1097,7 @@ async function renderDgmoBlock(source, options = {}) {
|
|
|
1090
1097
|
renderTheme("dark")
|
|
1091
1098
|
]);
|
|
1092
1099
|
const background = opts.background === "auto" ? defaultEmbedBackground(chartType) : opts.background;
|
|
1093
|
-
svgsHtml = `<div class="${escapeAttr(innerClasses(opts, "dgmo-light"))}" data-dgmo-bg="${escapeAttr(palette.light.bg)}">${normalizeSvgForEmbed(light, { background })}</div><div class="${escapeAttr(innerClasses(opts, "dgmo-dark"))}" data-dgmo-bg="${escapeAttr(palette.dark.bg)}"
|
|
1100
|
+
svgsHtml = `<div class="${escapeAttr(innerClasses(opts, "dgmo-light"))}" data-dgmo-bg="${escapeAttr(palette.light.bg)}">${normalizeSvgForEmbed(light, { background })}</div><div class="${escapeAttr(innerClasses(opts, "dgmo-dark"))}" data-dgmo-bg="${escapeAttr(palette.dark.bg)}" style="display:none">${normalizeSvgForEmbed(dark, { background })}</div>`;
|
|
1094
1101
|
} else {
|
|
1095
1102
|
const svg = await renderTheme(opts.colorMode);
|
|
1096
1103
|
const background = opts.background === "auto" ? defaultEmbedBackground(chartType) : opts.background;
|