Commit 0065715
committed
fix(configurator): align Auto dark derivation with CSS formula
The JS deriveDarkFromLight formula (l + 0.27) didn't match the CSS
formula in themes.css (clamp(0.65, 0.95 - l * 0.5, 0.88)), and the
base color used a completely different formula that wasn't handled at all.
In Auto dark mode the configurator was also baking the derived dark value
into the exported CSS override, bypassing the runtime CSS formula entirely.
- Fix deriveDarkFromLight to mirror the exact CSS formulas (including the
base-specific clamp(0.16, 1.18 - l, 0.24) / c * 0.5 variant)
- In Auto dark mode, only write the light token to overrides — the CSS
formula in themes.css handles source-dark at runtime
- Switching Auto → Manual now removes the dark override; switching
Manual → Auto populates dark as a pre-filled starting point
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gjdz9WEvMA8M1ve3Z1Xsoc1 parent 5449064 commit 0065715
1 file changed
Lines changed: 17 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
153 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
154 | 160 | | |
155 | 161 | | |
156 | 162 | | |
157 | 163 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 164 | + | |
163 | 165 | | |
164 | 166 | | |
165 | 167 | | |
166 | 168 | | |
167 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
168 | 172 | | |
169 | 173 | | |
170 | | - | |
171 | | - | |
172 | | - | |
| 174 | + | |
| 175 | + | |
173 | 176 | | |
174 | 177 | | |
175 | 178 | | |
| |||
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 227 | + | |
231 | 228 | | |
232 | 229 | | |
233 | 230 | | |
| |||
252 | 249 | | |
253 | 250 | | |
254 | 251 | | |
255 | | - | |
| 252 | + | |
256 | 253 | | |
257 | 254 | | |
258 | 255 | | |
| |||
0 commit comments