Commit 3a8a25e
committed
Set CSS variables via JavaScript to prevent external CSS override
The external client.css was overriding our inline CSS variable definitions
because it loaded after our inline <style> tag. Both had the same specificity
(:root selector), so cascade order determined the winner.
By setting CSS variables via JavaScript using setProperty(), we create inline
styles on the html element which have higher specificity than any CSS selector
(equivalent to style="--text-color: #f5f9ff"). This ensures the variables are
set correctly before the external CSS loads and cannot be overridden.
This fixes the black-text-on-dark-background issue while still allowing user
inline styles to override colors on specific elements.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 3771e6f commit 3a8a25e
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
30 | 39 | | |
31 | 40 | | |
32 | 41 | | |
| |||
0 commit comments