44
55/* Prevent theme flash on page load - set default background */
66html {
7- background-color : # 000000 ;
7+ background-color : # 000000 ; /* safe default for dark/mono to avoid white flash */
8+ color-scheme : light; /* default */
89}
910
11+ /* Match browser chrome/overscroll color to theme by default */
12+ @media (prefers-color-scheme : light) {
13+ html { background-color : # f9fafb ; }
14+ }
15+ @media (prefers-color-scheme : dark) {
16+ html { background-color : # 111827 ; color-scheme : dark; }
17+ }
18+
19+ /* Themed scrollbars (WebKit + Firefox) */
20+ /* Base (light) */
21+ html {
22+ scrollbar-width : thin; /* Firefox */
23+ scrollbar-color : # cbd5e1 transparent; /* thumb + transparent track */
24+ }
25+ /* WebKit */
26+ * ::-webkit-scrollbar {
27+ width : 8px ;
28+ height : 8px ;
29+ }
30+ * ::-webkit-scrollbar-track { background : transparent; }
31+ * ::-webkit-scrollbar-thumb {
32+ background-color : # cbd5e1 ; /* gray-300 */
33+ border-radius : 8px ;
34+ border : 2px solid # f3f4f6 ; /* creates padding effect */
35+ }
36+ * ::-webkit-scrollbar-thumb : hover {
37+ background-color : # 9ca3af ; /* gray-400 */
38+ }
39+
40+ /* Dark */
41+ .dark html , .modern-dark html , .mono html { scrollbar-color : # 0f172a transparent; }
42+ .dark html , .modern-dark html , .mono html { color-scheme : dark; }
43+ .dark * ::-webkit-scrollbar-track ,
44+ .modern-dark * ::-webkit-scrollbar-track ,
45+ .mono * ::-webkit-scrollbar-track { background : transparent; }
46+ .dark * ::-webkit-scrollbar-thumb ,
47+ .modern-dark * ::-webkit-scrollbar-thumb { background-color : # 0f172a ; border-color : # 111827 ; }
48+ .dark * ::-webkit-scrollbar-thumb : hover ,
49+ .modern-dark * ::-webkit-scrollbar-thumb : hover { background-color : # 1f2937 ; }
50+
51+ /* Mono (pure black theme) */
52+ .mono * ::-webkit-scrollbar-track { background : transparent; }
53+ .mono * ::-webkit-scrollbar-thumb { background-color : # 2a2a2a ; border-color : # 000000 ; }
54+ .mono * ::-webkit-scrollbar-thumb : hover { background-color : # 3a3a3a ; }
55+ .mono html { scrollbar-color : # 2a2a2a # 000000 ; }
56+
57+ /* Modern (light gradient) - subtle purple/indigo thumb */
58+ .modern html { scrollbar-color : rgba (99 , 102 , 241 , 0.6 ) transparent; }
59+ .modern * ::-webkit-scrollbar-track { background : transparent; }
60+ .modern * ::-webkit-scrollbar-thumb {
61+ background-color : rgba (99 , 102 , 241 , 0.6 ); /* indigo-500 @ 0.6 */
62+ border-color : transparent;
63+ }
64+ .modern * ::-webkit-scrollbar-thumb : hover {
65+ background-color : rgba (79 , 70 , 229 , 0.75 ); /* indigo-600 @ 0.75 */
66+ }
67+
68+ /* Modern-dark (dark gradient) - lighter lavender thumb */
69+ .modern-dark html { scrollbar-color : rgba (255 , 255 , 255 , 0.2 ) transparent; }
70+ .modern-dark * ::-webkit-scrollbar-track { background : transparent; }
71+ .modern-dark * ::-webkit-scrollbar-thumb { background-color : rgba (255 , 255 , 255 , 0.2 ); border-color : transparent; }
72+ .modern-dark * ::-webkit-scrollbar-thumb : hover { background-color : rgba (255 , 255 , 255 , 0.3 ); }
73+
1074/* Ensure proper theme is applied immediately */
1175html : not (.light ): not (.dark ): not (.modern ): not (.modern-dark ): not (.mono ) {
1276 background-color : # 000000 ;
@@ -27,15 +91,23 @@ body.theme-loaded {
2791 }
2892
2993 body {
30- @apply bg-gray-50 text-gray-900;
94+ @apply bg-gray-50 text-gray-900; /* light fallback */
95+ }
96+
97+ /* Ensure overscroll/rubber-band shows correct theme color (html/body) */
98+ .light html , .light body {
99+ @apply bg-gray-50;
100+ }
101+ .dark html , .dark body {
102+ @apply bg-gray-900;
31103 }
32104
33105 /* Override body background for modern themes */
34- .modern body {
106+ .modern html , . modern body {
35107 @apply bg-gradient-to-br from-purple-100 via-blue-100 to-indigo-100 text-purple-900;
36108 }
37109
38- .modern-dark body {
110+ .modern-dark html , . modern-dark body {
39111 @apply bg-gradient-to-br from-purple-900 via-blue-900 to-indigo-900 text-purple-100;
40112 }
41113
@@ -88,7 +160,7 @@ body.theme-loaded {
88160 }
89161
90162 /* Mono theme: fully black UI with white text and subtle borders */
91- .mono body {
163+ .mono html , . mono body {
92164 @apply bg-black text-white;
93165 }
94166
0 commit comments