|
6 | 6 | // ============================================ |
7 | 7 | // COLOR VARIABLES (NVIDIA + Dark Tech Theme) |
8 | 8 | // ============================================ |
| 9 | + |
| 10 | +// Primary brand color - NVIDIA Green |
| 11 | +$nvidia-green: #76B900; |
| 12 | +$nvidia-green-light: #8FD917; |
| 13 | +$nvidia-green-dark: #5A8F00; |
| 14 | + |
| 15 | +// Accent colors |
| 16 | +$tech-teal: #00D4AA; |
| 17 | +$tech-blue: #00A8E8; |
| 18 | +$tech-purple: #9D4EDD; |
| 19 | +$tech-orange: #FF8500; |
| 20 | + |
| 21 | +// ============================================ |
| 22 | +// LIGHT THEME (default) |
| 23 | +// ============================================ |
9 | 24 | :root { |
10 | | - // Primary brand color - NVIDIA Green |
11 | | - --nvidia-green: #76B900; |
12 | | - --nvidia-green-light: #8FD917; |
13 | | - --nvidia-green-dark: #5A8F00; |
14 | | - |
15 | | - // Accent colors |
16 | | - --tech-teal: #00D4AA; |
17 | | - --tech-blue: #00A8E8; |
18 | | - --tech-purple: #9D4EDD; |
19 | | - --tech-orange: #FF8500; |
20 | | - |
| 25 | + // Backgrounds - light mode |
| 26 | + --bg-primary: #FFFFFF; |
| 27 | + --bg-secondary: #F6F8FA; |
| 28 | + --bg-tertiary: #EAEEF2; |
| 29 | + --bg-elevated: #FFFFFF; |
| 30 | + |
| 31 | + // Text colors - light mode |
| 32 | + --text-primary: #1F2328; |
| 33 | + --text-secondary: #57606A; |
| 34 | + --text-muted: #8B949E; |
| 35 | + |
| 36 | + // Border colors - light mode |
| 37 | + --border-subtle: #D0D7DE; |
| 38 | + --border-default: #EAEEF2; |
| 39 | + |
| 40 | + // Brand colors (same for both modes) |
| 41 | + --nvidia-green: #{$nvidia-green}; |
| 42 | + --nvidia-green-light: #{$nvidia-green-light}; |
| 43 | + --nvidia-green-dark: #{$nvidia-green-dark}; |
| 44 | + --tech-teal: #{$tech-teal}; |
| 45 | + --tech-blue: #{$tech-blue}; |
| 46 | + --tech-purple: #{$tech-purple}; |
| 47 | + --tech-orange: #{$tech-orange}; |
| 48 | + |
| 49 | + // Code block colors - light mode |
| 50 | + --code-bg: #F6F8FA; |
| 51 | + --code-text: #1F2328; |
| 52 | +} |
| 53 | + |
| 54 | +// ============================================ |
| 55 | +// DARK THEME |
| 56 | +// ============================================ |
| 57 | +[data-theme="dark"], |
| 58 | +html[data-theme="dark"] { |
21 | 59 | // Dark theme backgrounds |
22 | 60 | --bg-primary: #0D1117; |
23 | 61 | --bg-secondary: #161B22; |
24 | 62 | --bg-tertiary: #21262D; |
25 | 63 | --bg-elevated: #1C2128; |
26 | | - |
27 | | - // Text colors |
| 64 | + |
| 65 | + // Text colors - dark mode |
28 | 66 | --text-primary: #E6EDF3; |
29 | 67 | --text-secondary: #8B949E; |
30 | 68 | --text-muted: #6E7681; |
31 | | - |
32 | | - // Border colors |
| 69 | + |
| 70 | + // Border colors - dark mode |
33 | 71 | --border-subtle: #30363D; |
34 | 72 | --border-default: #21262D; |
| 73 | + |
| 74 | + // Code block colors - dark mode |
| 75 | + --code-bg: #161B22; |
| 76 | + --code-text: #E6EDF3; |
| 77 | +} |
| 78 | + |
| 79 | +// Fallback: Also apply dark theme at :root for backwards compatibility |
| 80 | +// This ensures dark styles work even without data-theme attribute |
| 81 | +@media (prefers-color-scheme: dark) { |
| 82 | + :root:not([data-theme="light"]) { |
| 83 | + --bg-primary: #0D1117; |
| 84 | + --bg-secondary: #161B22; |
| 85 | + --bg-tertiary: #21262D; |
| 86 | + --bg-elevated: #1C2128; |
| 87 | + --text-primary: #E6EDF3; |
| 88 | + --text-secondary: #8B949E; |
| 89 | + --text-muted: #6E7681; |
| 90 | + --border-subtle: #30363D; |
| 91 | + --border-default: #21262D; |
| 92 | + --code-bg: #161B22; |
| 93 | + --code-text: #E6EDF3; |
| 94 | + } |
35 | 95 | } |
36 | 96 |
|
37 | 97 | // ============================================ |
@@ -159,18 +219,72 @@ code { |
159 | 219 | margin-right: 1rem !important; |
160 | 220 | } |
161 | 221 |
|
162 | | -// Syntax highlighting - customized for CUDA |
| 222 | +// Syntax highlighting - CUDA optimized with light/dark support |
| 223 | +// Dark mode syntax colors (default for code blocks) |
| 224 | +$code-comment-dark: #6A9955; |
| 225 | +$code-keyword-dark: #569CD6; |
| 226 | +$code-string-dark: #CE9178; |
| 227 | +$code-number-dark: #B5CEA8; |
| 228 | +$code-function-dark: #DCDCAA; |
| 229 | +$code-punctuation-dark: #D4D4D4; |
| 230 | +$code-preprocessor-dark: #9CDCFE; |
| 231 | +$code-type-dark: #4EC9B0; |
| 232 | +$code-variable-dark: #9CDCFE; |
| 233 | + |
| 234 | +// Light mode syntax colors |
| 235 | +$code-comment-light: #008000; |
| 236 | +$code-keyword-light: #0000FF; |
| 237 | +$code-string-light: #A31515; |
| 238 | +$code-number-light: #098658; |
| 239 | +$code-function-light: #795E26; |
| 240 | +$code-punctuation-light: #333333; |
| 241 | +$code-preprocessor-light: #AF00DB; |
| 242 | +$code-type-light: #267F99; |
| 243 | +$code-variable-light: #001080; |
| 244 | + |
163 | 245 | .highlight { |
164 | | - .c, .cm, .c1, .cp { color: #6A9955; } // Comments |
165 | | - .k, .kc, .kd, .kn, .kr { color: #569CD6; } // Keywords |
166 | | - .s, .sb, .sc, .sd, .s2 { color: #CE9178; } // Strings |
167 | | - .mi, .mf, .mh, .il { color: #B5CEA8; } // Numbers |
168 | | - .n, .nf, .fm { color: #DCDCAA; } // Functions |
169 | | - .p { color: #D4D4D4; } // Punctuation |
170 | | - .o { color: #D4D4D4; } // Operators |
171 | | - .cpp, .cpf { color: #9CDCFE; } // Preprocessor |
172 | | - .kt, .nc { color: #4EC9B0; } // Types/Classes |
173 | | - .nv { color: #9CDCFE; } // Variables |
| 246 | + // Dark mode syntax (default) |
| 247 | + .c, .cm, .c1, .cp { color: $code-comment-dark; } |
| 248 | + .k, .kc, .kd, .kn, .kr { color: $code-keyword-dark; } |
| 249 | + .s, .sb, .sc, .sd, .s2 { color: $code-string-dark; } |
| 250 | + .mi, .mf, .mh, .il { color: $code-number-dark; } |
| 251 | + .n, .nf, .fm { color: $code-function-dark; } |
| 252 | + .p { color: $code-punctuation-dark; } |
| 253 | + .o { color: $code-punctuation-dark; } |
| 254 | + .cpp, .cpf { color: $code-preprocessor-dark; } |
| 255 | + .kt, .nc { color: $code-type-dark; } |
| 256 | + .nv { color: $code-variable-dark; } |
| 257 | +} |
| 258 | + |
| 259 | +// Light mode syntax highlighting |
| 260 | +[data-theme="light"] .highlight, |
| 261 | +html[data-theme="light"] .highlight { |
| 262 | + .c, .cm, .c1, .cp { color: $code-comment-light; } |
| 263 | + .k, .kc, .kd, .kn, .kr { color: $code-keyword-light; } |
| 264 | + .s, .sb, .sc, .sd, .s2 { color: $code-string-light; } |
| 265 | + .mi, .mf, .mh, .il { color: $code-number-light; } |
| 266 | + .n, .nf, .fm { color: $code-function-light; } |
| 267 | + .p { color: $code-punctuation-light; } |
| 268 | + .o { color: $code-punctuation-light; } |
| 269 | + .cpp, .cpf { color: $code-preprocessor-light; } |
| 270 | + .kt, .nc { color: $code-type-light; } |
| 271 | + .nv { color: $code-variable-light; } |
| 272 | +} |
| 273 | + |
| 274 | +// System preference light mode |
| 275 | +@media (prefers-color-scheme: light) { |
| 276 | + :root:not([data-theme="dark"]) .highlight { |
| 277 | + .c, .cm, .c1, .cp { color: $code-comment-light; } |
| 278 | + .k, .kc, .kd, .kn, .kr { color: $code-keyword-light; } |
| 279 | + .s, .sb, .sc, .sd, .s2 { color: $code-string-light; } |
| 280 | + .mi, .mf, .mh, .il { color: $code-number-light; } |
| 281 | + .n, .nf, .fm { color: $code-function-light; } |
| 282 | + .p { color: $code-punctuation-light; } |
| 283 | + .o { color: $code-punctuation-light; } |
| 284 | + .cpp, .cpf { color: $code-preprocessor-light; } |
| 285 | + .kt, .nc { color: $code-type-light; } |
| 286 | + .nv { color: $code-variable-light; } |
| 287 | + } |
174 | 288 | } |
175 | 289 |
|
176 | 290 | // Copy code button |
@@ -215,7 +329,22 @@ table { |
215 | 329 | } |
216 | 330 |
|
217 | 331 | tr:nth-child(even) { |
218 | | - background-color: rgba(255, 255, 255, 0.02) !important; |
| 332 | + background-color: rgba(128, 128, 128, 0.05) !important; |
| 333 | + } |
| 334 | + |
| 335 | + // Dark mode: darker stripe |
| 336 | + [data-theme="dark"] & { |
| 337 | + tr:nth-child(even) { |
| 338 | + background-color: rgba(255, 255, 255, 0.02) !important; |
| 339 | + } |
| 340 | + } |
| 341 | + |
| 342 | + @media (prefers-color-scheme: dark) { |
| 343 | + :root:not([data-theme="light"]) & { |
| 344 | + tr:nth-child(even) { |
| 345 | + background-color: rgba(255, 255, 255, 0.02) !important; |
| 346 | + } |
| 347 | + } |
219 | 348 | } |
220 | 349 |
|
221 | 350 | tr:hover { |
|
0 commit comments