@@ -7,48 +7,59 @@ import { getThinkingPolicyForModel } from "@/browser/utils/thinking/policy";
77import { updatePersistedState } from "@/browser/hooks/usePersistedState" ;
88import { getLastThinkingByModelKey } from "@/common/constants/storage" ;
99
10- // Subtle consistent glow for active levels
11- const GLOW = {
12- track : "0 0 6px 1px hsl(271 76% 53% / 0.3)" ,
13- thumb : "0 0 4px 1px hsl(271 76% 53% / 0.3)" ,
14- } ;
15-
10+ // Uses CSS variable --color-thinking-mode for theme compatibility
11+ // Glow is applied via CSS using color-mix with the theme color
1612const GLOW_INTENSITIES : Record < number , { track : string ; thumb : string } > = {
1713 0 : { track : "none" , thumb : "none" } ,
18- 1 : GLOW ,
19- 2 : GLOW ,
20- 3 : GLOW ,
14+ 1 : {
15+ track : "0 0 6px 1px color-mix(in srgb, var(--color-thinking-mode) 30%, transparent)" ,
16+ thumb : "0 0 4px 1px color-mix(in srgb, var(--color-thinking-mode) 30%, transparent)" ,
17+ } ,
18+ 2 : {
19+ track : "0 0 6px 1px color-mix(in srgb, var(--color-thinking-mode) 30%, transparent)" ,
20+ thumb : "0 0 4px 1px color-mix(in srgb, var(--color-thinking-mode) 30%, transparent)" ,
21+ } ,
22+ 3 : {
23+ track : "0 0 6px 1px color-mix(in srgb, var(--color-thinking-mode) 30%, transparent)" ,
24+ thumb : "0 0 4px 1px color-mix(in srgb, var(--color-thinking-mode) 30%, transparent)" ,
25+ } ,
2126} ;
2227
23- // Continuous function for text styling based on level (n: 0-3)
24- const getTextStyle = ( n : number ) => {
28+ // Text styling based on level (n: 0-3)
29+ // Uses CSS variables for theme compatibility
30+ const getTextStyle = ( n : number ) : React . CSSProperties => {
2531 if ( n === 0 ) {
2632 return {
27- color : "#606060 " ,
33+ color : "var(--color-muted) " ,
2834 fontWeight : 400 ,
2935 textShadow : "none" ,
3036 fontSize : "10px" ,
3137 } ;
3238 }
3339
34- // Continuous interpolation for n = 1-3
35- const hue = 271 + ( n - 1 ) * 7 ; // 271 → 278 → 285
36- const lightness = 65 - ( n - 1 ) * 5 ; // 65 → 60 → 55
40+ // Active levels use the thinking mode color with increasing intensity
3741 const fontWeight = 400 + n * 100 ; // 500 → 600 → 700
38- const shadowBlur = n * 4 ; // 4 → 8 → 12
39- const shadowOpacity = 0.3 + n * 0.15 ; // 0.45 → 0.6 → 0.75
42+ // Use color-mix to lighten the base color for lower levels
43+ const lightnessAdjust = ( 3 - n ) * 10 ; // high=0%, medium=10%, low=20% lighter
4044
4145 return {
42- color : `hsl(${ hue } 76% ${ lightness } %)` ,
46+ color :
47+ lightnessAdjust > 0
48+ ? `color-mix(in srgb, var(--color-thinking-mode-light) ${ lightnessAdjust } %, var(--color-thinking-mode))`
49+ : "var(--color-thinking-mode)" ,
4350 fontWeight,
44- textShadow : `0 0 ${ shadowBlur } px hsl(${ hue } 76% ${ lightness } % / ${ shadowOpacity } )` ,
51+ textShadow :
52+ n > 0
53+ ? `0 0 ${ n * 4 } px color-mix(in srgb, var(--color-thinking-mode) ${ 30 + n * 15 } %, transparent)`
54+ : "none" ,
4555 fontSize : "10px" ,
4656 } ;
4757} ;
4858
4959const getSliderStyles = ( value : number , isHover = false ) => {
5060 const effectiveValue = isHover ? Math . min ( value + 1 , 3 ) : value ;
51- const thumbBg = value === 0 ? "#606060" : `hsl(271 76% ${ 53 + value * 5 } %)` ;
61+ // Use CSS variable for thumb color when active
62+ const thumbBg = value === 0 ? "var(--color-muted)" : "var(--color-thinking-mode)" ;
5263
5364 return {
5465 trackShadow : GLOW_INTENSITIES [ effectiveValue ] . track ,
0 commit comments