File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44@use ' ../tokens' as * ;
55
6- [data-tutor-theme = ' dark' ] {
6+ // Mixin containing all dark theme tokens
7+ @mixin dark-theme-tokens {
78 // =============================================================================
89 // SURFACE COLORS
910 // =============================================================================
214215 --tutor-shadow-2xl : #{$tutor-shadow-2xl } ;
215216 --tutor-shadow-3xl : #{$tutor-shadow-3xl } ;
216217}
218+
219+ // Apply dark theme when explicitly set
220+ [data-tutor-theme = ' dark' ] {
221+ @include dark-theme-tokens ;
222+ }
223+
224+ // Apply dark theme when system preference is dark
225+ // This prevents flash of light theme before JS loads
226+ @media (prefers-color-scheme : dark ) {
227+ [data-tutor-theme = ' system' ] {
228+ @include dark-theme-tokens ;
229+ }
230+ }
Original file line number Diff line number Diff line change 5353// LIGHT — overrides specific to the light base theme
5454// =============================================================================
5555
56- [ data-tutor-theme = ' light' ][ data-tutor-vision = ' deuteranomaly ' ] {
56+ @mixin deuteranomaly- light-tokens {
5757 // SURFACE COLORS
5858 --tutor-surface-warning : #{$tutor-warning-50 } ;
5959 --tutor-surface-warning-hover : #{$tutor-warning-100 } ;
8888// DARK — overrides specific to the dark base theme
8989// =============================================================================
9090
91- [ data-tutor-theme = ' dark' ][ data-tutor-vision = ' deuteranomaly ' ] {
91+ @mixin deuteranomaly- dark-tokens {
9292 // SURFACE COLORS
9393 --tutor-surface-warning : #{$tutor-gray-750 } ;
9494 --tutor-surface-warning-hover : #{$tutor-warning-900 } ;
120120 --tutor-actions-warning-exception : #{$tutor-orange-50 } ;
121121 --tutor-actions-critical-secondary : #{$tutor-gray-700 } ;
122122}
123+
124+ [data-tutor-theme = ' light' ][data-tutor-vision = ' deuteranomaly' ],
125+ [data-tutor-theme = ' system' ][data-tutor-vision = ' deuteranomaly' ] {
126+ @include deuteranomaly-light-tokens ;
127+ }
128+
129+ [data-tutor-theme = ' dark' ][data-tutor-vision = ' deuteranomaly' ] {
130+ @include deuteranomaly-dark-tokens ;
131+ }
132+
133+ @media (prefers-color-scheme : dark ) {
134+ [data-tutor-theme = ' system' ][data-tutor-vision = ' deuteranomaly' ] {
135+ @include deuteranomaly-dark-tokens ;
136+ }
137+ }
Original file line number Diff line number Diff line change 5454// LIGHT — overrides specific to the light base theme
5555// =============================================================================
5656
57- [ data-tutor-theme = ' light' ][ data-tutor-vision = ' deuteranopia ' ] {
57+ @mixin deuteranopia- light-tokens {
5858 // SURFACE COLORS
5959 --tutor-surface-warning : #{$tutor-warning-50 } ;
6060 --tutor-surface-warning-hover : #{$tutor-warning-100 } ;
8484// DARK — overrides specific to the dark base theme
8585// =============================================================================
8686
87- [ data-tutor-theme = ' dark' ][ data-tutor-vision = ' deuteranopia ' ] {
87+ @mixin deuteranopia- dark-tokens {
8888 // SURFACE COLORS
8989 --tutor-surface-warning : #{$tutor-gray-750 } ;
9090 --tutor-surface-warning-hover : #{$tutor-warning-900 } ;
113113 --tutor-actions-critical-secondary : #{$tutor-gray-700 } ;
114114 --tutor-actions-caution : #{$tutor-yellow-500 } ;
115115}
116+
117+ [data-tutor-theme = ' light' ][data-tutor-vision = ' deuteranopia' ],
118+ [data-tutor-theme = ' system' ][data-tutor-vision = ' deuteranopia' ] {
119+ @include deuteranopia-light-tokens ;
120+ }
121+
122+ [data-tutor-theme = ' dark' ][data-tutor-vision = ' deuteranopia' ] {
123+ @include deuteranopia-dark-tokens ;
124+ }
125+
126+ @media (prefers-color-scheme : dark ) {
127+ [data-tutor-theme = ' system' ][data-tutor-vision = ' deuteranopia' ] {
128+ @include deuteranopia-dark-tokens ;
129+ }
130+ }
Original file line number Diff line number Diff line change 99// LIGHT — overrides specific to the light base theme
1010// =============================================================================
1111
12- [ data-tutor-theme = ' light' ][ data-tutor-contrast = ' high ' ] {
12+ @mixin high-contrast- light-tokens {
1313 // TEXT COLORS
1414 --tutor-text-primary : #{$tutor-gray-950 } ;
1515 --tutor-text-secondary : #{$tutor-gray-950 } ;
3636// DARK — overrides specific to the dark base theme
3737// =============================================================================
3838
39- [ data-tutor-theme = ' dark' ][ data-tutor-contrast = ' high ' ] {
39+ @mixin high-contrast- dark-tokens {
4040 // TEXT COLORS
4141 --tutor-text-primary : #{$tutor-gray-100 } ;
4242 --tutor-text-secondary : #{$tutor-gray-50 } ;
5858 --tutor-border-brand-secondary : #{$tutor-brand-800 } ;
5959 --tutor-border-brand-tertiary : #{$tutor-brand-700 } ;
6060}
61+
62+ [data-tutor-theme = ' light' ][data-tutor-contrast = ' high' ],
63+ [data-tutor-theme = ' system' ][data-tutor-contrast = ' high' ] {
64+ @include high-contrast-light-tokens ;
65+ }
66+
67+ [data-tutor-theme = ' dark' ][data-tutor-contrast = ' high' ] {
68+ @include high-contrast-dark-tokens ;
69+ }
70+
71+ @media (prefers-color-scheme : dark ) {
72+ [data-tutor-theme = ' system' ][data-tutor-contrast = ' high' ] {
73+ @include high-contrast-dark-tokens ;
74+ }
75+ }
Original file line number Diff line number Diff line change 6161// LIGHT — overrides specific to the light base theme
6262// =============================================================================
6363
64- [ data-tutor-theme = ' light' ][ data-tutor-vision = ' protanopia ' ] {
64+ @mixin protanopia- light-tokens {
6565 // SURFACE COLORS
6666 --tutor-surface-success : #{$tutor-cyan-50 } ;
6767 --tutor-surface-critical : #{$tutor-orange-100 } ;
8080// DARK — overrides specific to the dark base theme
8181// =============================================================================
8282
83- [ data-tutor-theme = ' dark' ][ data-tutor-vision = ' protanopia ' ] {
83+ @mixin protanopia- dark-tokens {
8484 // SURFACE COLORS
8585 --tutor-surface-success : #{$tutor-cyan-900 } ;
8686 --tutor-surface-critical : #{$tutor-orange-900 } ;
9292 --tutor-actions-success-exception : #{$tutor-cyan-950 } ;
9393 --tutor-actions-warning-exception : #{$tutor-orange-50 } ;
9494}
95+
96+ [data-tutor-theme = ' light' ][data-tutor-vision = ' protanopia' ],
97+ [data-tutor-theme = ' system' ][data-tutor-vision = ' protanopia' ] {
98+ @include protanopia-light-tokens ;
99+ }
100+
101+ [data-tutor-theme = ' dark' ][data-tutor-vision = ' protanopia' ] {
102+ @include protanopia-dark-tokens ;
103+ }
104+
105+ @media (prefers-color-scheme : dark ) {
106+ [data-tutor-theme = ' system' ][data-tutor-vision = ' protanopia' ] {
107+ @include protanopia-dark-tokens ;
108+ }
109+ }
You can’t perform that action at this time.
0 commit comments