|
1 | 1 | import { css } from '../../utils/css'
|
2 | 2 |
|
3 |
| -const darkTheme = css` |
4 |
| - /* Background Dark */ |
5 |
| - --color-background-100: #0a0a0a; |
6 |
| - --color-background-200: #000000; |
7 |
| -
|
8 |
| - /* Syntax Dark */ |
9 |
| - --color-syntax-comment: #a0a0a0; |
10 |
| - --color-syntax-constant: #ededed; |
11 |
| - --color-syntax-function: #52a9ff; |
12 |
| - --color-syntax-keyword: #f76e99; |
13 |
| - --color-syntax-link: #0ac5b2; |
14 |
| - --color-syntax-parameter: #f1a10d; |
15 |
| - --color-syntax-punctuation: #ededed; |
16 |
| - --color-syntax-string: #0ac5b2; |
17 |
| - --color-syntax-string-expression: #0ac5b2; |
18 |
| -
|
19 |
| - /* Gray Scale Dark */ |
20 |
| - --color-gray-100: #1a1a1a; |
21 |
| - --color-gray-200: #1f1f1f; |
22 |
| - --color-gray-300: #292929; |
23 |
| - --color-gray-400: #2e2e2e; |
24 |
| - --color-gray-500: #454545; |
25 |
| - --color-gray-600: #878787; |
26 |
| - --color-gray-700: #8f8f8f; |
27 |
| - --color-gray-800: #7d7d7d; |
28 |
| - --color-gray-900: #a0a0a0; |
29 |
| - --color-gray-1000: #ededed; |
30 |
| -
|
31 |
| - /* Gray Alpha Scale Dark */ |
32 |
| - --color-gray-alpha-100: rgba(255, 255, 255, 0.066); |
33 |
| - --color-gray-alpha-200: rgba(255, 255, 255, 0.087); |
34 |
| - --color-gray-alpha-300: rgba(255, 255, 255, 0.125); |
35 |
| - --color-gray-alpha-400: rgba(255, 255, 255, 0.145); |
36 |
| - --color-gray-alpha-500: rgba(255, 255, 255, 0.239); |
37 |
| - --color-gray-alpha-600: rgba(255, 255, 255, 0.506); |
38 |
| - --color-gray-alpha-700: rgba(255, 255, 255, 0.54); |
39 |
| - --color-gray-alpha-800: rgba(255, 255, 255, 0.47); |
40 |
| - --color-gray-alpha-900: rgba(255, 255, 255, 0.61); |
41 |
| - --color-gray-alpha-1000: rgba(255, 255, 255, 0.923); |
42 |
| -
|
43 |
| - /* Blue Scale Dark */ |
44 |
| - --color-blue-100: #0f1b2d; |
45 |
| - --color-blue-200: #10243e; |
46 |
| - --color-blue-300: #0f3058; |
47 |
| - --color-blue-400: #0d3868; |
48 |
| - --color-blue-500: #0a4481; |
49 |
| - --color-blue-600: #0091ff; |
50 |
| - --color-blue-700: #0070f3; |
51 |
| - --color-blue-800: #0060d1; |
52 |
| - --color-blue-900: #52a9ff; |
53 |
| - --color-blue-1000: #eaf6ff; |
54 |
| -
|
55 |
| - /* Red Scale Dark */ |
56 |
| - --color-red-100: #2a1314; |
57 |
| - --color-red-200: #3d1719; |
58 |
| - --color-red-300: #551a1e; |
59 |
| - --color-red-400: #671e22; |
60 |
| - --color-red-500: #822025; |
61 |
| - --color-red-600: #e5484d; |
62 |
| - --color-red-700: #e5484d; |
63 |
| - --color-red-800: #da3036; |
64 |
| - --color-red-900: #ff6369; |
65 |
| - --color-red-1000: #ffecee; |
66 |
| -
|
67 |
| - /* Amber Scale Dark */ |
68 |
| - --color-amber-100: #271700; |
69 |
| - --color-amber-200: #341c00; |
70 |
| - --color-amber-300: #4a2900; |
71 |
| - --color-amber-400: #573300; |
72 |
| - --color-amber-500: #693f05; |
73 |
| - --color-amber-600: #e79c13; |
74 |
| - --color-amber-700: #ffb224; |
75 |
| - --color-amber-800: #ff990a; |
76 |
| - --color-amber-900: #f1a10d; |
77 |
| - --color-amber-1000: #fef3dd; |
78 |
| -
|
79 |
| - /* Green Scale Dark */ |
80 |
| - --color-green-100: #0b2211; |
81 |
| - --color-green-200: #0f2c17; |
82 |
| - --color-green-300: #11351b; |
83 |
| - --color-green-400: #0c461b; |
84 |
| - --color-green-500: #126427; |
85 |
| - --color-green-600: #1a9338; |
86 |
| - --color-green-700: #46a758; |
87 |
| - --color-green-800: #388e4a; |
88 |
| - --color-green-900: #63c174; |
89 |
| - --color-green-1000: #e5fbeb; |
90 |
| -
|
91 |
| - /* Turbopack Dark - Temporary */ |
92 |
| - --color-turbopack-text-red: #ff6d92; |
93 |
| - --color-turbopack-text-blue: #45b2ff; |
94 |
| - --color-turbopack-border-red: #6e293b; |
95 |
| - --color-turbopack-border-blue: #284f80; |
96 |
| - --color-turbopack-background-red: #250d12; |
97 |
| - --color-turbopack-background-blue: #0a1723; |
98 |
| -` |
99 |
| - |
100 |
| -// TODO: Replace the existing colors in Base.tsx. |
101 | 3 | export function Colors() {
|
102 | 4 | return (
|
103 | 5 | <style>
|
104 | 6 | {css`
|
105 | 7 | :host {
|
106 |
| - ${ |
107 |
| - // CAUTION: THIS IS A WORKAROUND! |
108 |
| - // For now, we use @babel/code-frame to parse the code frame which does not support option to change the color. |
109 |
| - // x-ref: https://github.com/babel/babel/blob/efa52324ff835b794c48080f14877b6caf32cd15/packages/babel-code-frame/src/defs.ts#L40-L54 |
110 |
| - // So, we do a workaround mapping to change the color matching the theme. |
111 |
| -
|
112 |
| - // For example, in @babel/code-frame, the `keyword` is mapped to ANSI "cyan". |
113 |
| - // We want the `keyword` to use the `syntax-keyword` color in the theme. |
114 |
| - // So, we map the "cyan" to the `syntax-keyword` in the theme. |
115 |
| - '' |
116 |
| - } |
| 8 | + /* |
| 9 | + * CAUTION: THIS IS A WORKAROUND! |
| 10 | + * For now, we use @babel/code-frame to parse the code frame which does not support option to change the color. |
| 11 | + * x-ref: https://github.com/babel/babel/blob/efa52324ff835b794c48080f14877b6caf32cd15/packages/babel-code-frame/src/defs.ts#L40-L54 |
| 12 | + * So, we do a workaround mapping to change the color matching the theme. |
| 13 | + * |
| 14 | + * For example, in @babel/code-frame, the "keyword" is mapped to ANSI "cyan". |
| 15 | + * We want the "keyword" to use the "syntax-keyword" color in the theme. |
| 16 | + * So, we map the "cyan" to the "syntax-keyword" in the theme. |
| 17 | + */ |
117 | 18 | /* cyan: keyword */
|
118 | 19 | --color-ansi-cyan: var(--color-syntax-keyword);
|
119 | 20 | /* yellow: capitalized, jsxIdentifier, punctuation */
|
@@ -237,16 +138,6 @@ export function Colors() {
|
237 | 138 | --color-turbopack-background-red: #fff7f9;
|
238 | 139 | --color-turbopack-background-blue: #f6fbff;
|
239 | 140 | }
|
240 |
| -
|
241 |
| - :host(.dark) { |
242 |
| - ${darkTheme} |
243 |
| - } |
244 |
| -
|
245 |
| - @media (prefers-color-scheme: dark) { |
246 |
| - :host(:not(.light)) { |
247 |
| - ${darkTheme} |
248 |
| - } |
249 |
| - } |
250 | 141 | `}
|
251 | 142 | </style>
|
252 | 143 | )
|
|
0 commit comments