Commit 0d69d7a
committed
Move color detection to head and set CSS variables as inline styles
Previous approach applied classes after styles were loaded, causing a timing
issue. Now the color scheme is detected in a script in the head, before any
styles are applied, and the CSS variables are set directly as inline styles
on the html element.
Changes:
- Move color scheme detection script from body to head
- Set --bg-color and --text-color as inline styles via setProperty
- Apply color and background-color directly to :root
- Change * selector to use 'inherit' for better color inheritance
- Remove duplicate color scheme script from body
This ensures colors are applied immediately before any content renders,
preventing black text from appearing in dark mode.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent fb1815a commit 0d69d7a
1 file changed
+26
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
19 | 41 | | |
20 | | - | |
| 42 | + | |
21 | 43 | | |
22 | 44 | | |
23 | 45 | | |
| 46 | + | |
| 47 | + | |
24 | 48 | | |
25 | 49 | | |
26 | 50 | | |
27 | 51 | | |
28 | 52 | | |
29 | 53 | | |
30 | | - | |
| 54 | + | |
31 | 55 | | |
32 | 56 | | |
33 | 57 | | |
| |||
45 | 69 | | |
46 | 70 | | |
47 | 71 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
0 commit comments