Commit d746da6
authored
fix(css): make heading scale resilient — target markdown-block, not hook class (#503)
The heading size overrides used .pi-assistant-body h1 which depends on
applyMessageStyleHooks() stamping the class on the right DOM node. When
the hook didn't run (streaming, DOM structure changes from dep bumps,
timing races), headings fell back to Tailwind v4's base reset
(font-size: inherit) or browser defaults (2em) — both much too large
for the sidebar.
Now target 'markdown-block h1' directly. markdown-block is a stable
custom element tag in pi-web-ui's light DOM that always exists in the
render tree, so headings are always capped regardless of hook state.
This is the root cause behind the recurring 'headings too large'
reports — the same fragility pattern (hook-dependent selectors failing
when upstream components change) also caused the KaTeX and thinking
block issues fixed earlier.1 parent fb119d8 commit d746da6
2 files changed
+46
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
134 | 151 | | |
135 | 152 | | |
136 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
36 | 53 | | |
37 | | - | |
| 54 | + | |
38 | 55 | | |
39 | 56 | | |
40 | 57 | | |
41 | 58 | | |
42 | 59 | | |
43 | 60 | | |
44 | | - | |
| 61 | + | |
45 | 62 | | |
46 | 63 | | |
47 | 64 | | |
48 | 65 | | |
49 | 66 | | |
50 | 67 | | |
51 | | - | |
| 68 | + | |
52 | 69 | | |
53 | 70 | | |
54 | 71 | | |
55 | 72 | | |
56 | 73 | | |
57 | 74 | | |
58 | | - | |
59 | | - | |
60 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
61 | 78 | | |
62 | 79 | | |
63 | 80 | | |
64 | 81 | | |
65 | 82 | | |
66 | 83 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
73 | 90 | | |
74 | 91 | | |
75 | 92 | | |
0 commit comments