|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
17 | | -.bigframes-widget { |
| 17 | +/* Increase specificity to override framework styles without !important */ |
| 18 | +.bigframes-widget.bigframes-widget { |
| 19 | + /* Default Light Mode Variables */ |
| 20 | + --bf-bg: white; |
| 21 | + --bf-border-color: #ccc; |
| 22 | + --bf-error-bg: #fbe; |
| 23 | + --bf-error-border: red; |
| 24 | + --bf-error-fg: black; |
| 25 | + --bf-fg: black; |
| 26 | + --bf-header-bg: #f5f5f5; |
| 27 | + --bf-null-fg: gray; |
| 28 | + --bf-row-even-bg: #f5f5f5; |
| 29 | + --bf-row-odd-bg: white; |
| 30 | + |
| 31 | + background-color: var(--bf-bg); |
| 32 | + box-sizing: border-box; |
| 33 | + color: var(--bf-fg); |
18 | 34 | display: flex; |
19 | 35 | flex-direction: column; |
| 36 | + font-family: |
| 37 | + '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', sans-serif; |
| 38 | + margin: 0; |
| 39 | + padding: 0; |
| 40 | +} |
| 41 | + |
| 42 | +.bigframes-widget * { |
| 43 | + box-sizing: border-box; |
| 44 | +} |
| 45 | + |
| 46 | +/* Dark Mode Overrides: |
| 47 | + * 1. @media (prefers-color-scheme: dark) - System-wide dark mode |
| 48 | + * 2. .bigframes-dark-mode - Explicit class for VSCode theme detection |
| 49 | + * 3. html[theme="dark"], body[data-theme="dark"] - Colab/Pantheon manual override |
| 50 | + */ |
| 51 | +@media (prefers-color-scheme: dark) { |
| 52 | + .bigframes-widget.bigframes-widget { |
| 53 | + --bf-bg: var(--vscode-editor-background, #202124); |
| 54 | + --bf-border-color: #444; |
| 55 | + --bf-error-bg: #511; |
| 56 | + --bf-error-border: #f88; |
| 57 | + --bf-error-fg: #fcc; |
| 58 | + --bf-fg: white; |
| 59 | + --bf-header-bg: var(--vscode-editor-background, black); |
| 60 | + --bf-null-fg: #aaa; |
| 61 | + --bf-row-even-bg: #202124; |
| 62 | + --bf-row-odd-bg: #383838; |
| 63 | + } |
| 64 | +} |
| 65 | + |
| 66 | +.bigframes-widget.bigframes-dark-mode.bigframes-dark-mode, |
| 67 | +html[theme='dark'] .bigframes-widget.bigframes-widget, |
| 68 | +body[data-theme='dark'] .bigframes-widget.bigframes-widget { |
| 69 | + --bf-bg: var(--vscode-editor-background, #202124); |
| 70 | + --bf-border-color: #444; |
| 71 | + --bf-error-bg: #511; |
| 72 | + --bf-error-border: #f88; |
| 73 | + --bf-error-fg: #fcc; |
| 74 | + --bf-fg: white; |
| 75 | + --bf-header-bg: var(--vscode-editor-background, black); |
| 76 | + --bf-null-fg: #aaa; |
| 77 | + --bf-row-even-bg: #202124; |
| 78 | + --bf-row-odd-bg: #383838; |
20 | 79 | } |
21 | 80 |
|
22 | 81 | .bigframes-widget .table-container { |
| 82 | + background-color: var(--bf-bg); |
| 83 | + margin: 0; |
23 | 84 | max-height: 620px; |
24 | 85 | overflow: auto; |
| 86 | + padding: 0; |
25 | 87 | } |
26 | 88 |
|
27 | 89 | .bigframes-widget .footer { |
28 | 90 | align-items: center; |
29 | | - /* TODO(b/460861328): We will support dark mode in a media selector once we |
30 | | - * determine how to override the background colors as well. */ |
31 | | - color: black; |
| 91 | + background-color: var(--bf-bg); |
| 92 | + color: var(--bf-fg); |
32 | 93 | display: flex; |
33 | | - font-family: |
34 | | - "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", sans-serif; |
35 | 94 | font-size: 0.8rem; |
36 | 95 | justify-content: space-between; |
37 | 96 | padding: 8px; |
|
70 | 129 | margin-right: 8px; |
71 | 130 | } |
72 | 131 |
|
73 | | -.bigframes-widget table { |
| 132 | +.bigframes-widget table.bigframes-widget-table, |
| 133 | +.bigframes-widget table.dataframe { |
| 134 | + background-color: var(--bf-bg); |
| 135 | + border: 1px solid var(--bf-border-color); |
74 | 136 | border-collapse: collapse; |
75 | | - /* TODO(b/460861328): We will support dark mode in a media selector once we |
76 | | - * determine how to override the background colors as well. */ |
77 | | - color: black; |
| 137 | + border-spacing: 0; |
| 138 | + box-shadow: none; |
| 139 | + color: var(--bf-fg); |
| 140 | + margin: 0; |
| 141 | + outline: none; |
78 | 142 | text-align: left; |
| 143 | + width: auto; /* Fix stretching */ |
| 144 | +} |
| 145 | + |
| 146 | +.bigframes-widget tr { |
| 147 | + border: none; |
79 | 148 | } |
80 | 149 |
|
81 | 150 | .bigframes-widget th { |
82 | | - background-color: var(--colab-primary-surface-color, var(--jp-layout-color0)); |
| 151 | + background-color: var(--bf-header-bg); |
| 152 | + border: 1px solid var(--bf-border-color); |
| 153 | + color: var(--bf-fg); |
83 | 154 | padding: 0; |
84 | 155 | position: sticky; |
85 | 156 | text-align: left; |
86 | 157 | top: 0; |
87 | 158 | z-index: 1; |
88 | 159 | } |
89 | 160 |
|
| 161 | +.bigframes-widget td { |
| 162 | + border: 1px solid var(--bf-border-color); |
| 163 | + color: var(--bf-fg); |
| 164 | + padding: 0.5em; |
| 165 | +} |
| 166 | + |
| 167 | +.bigframes-widget table tbody tr:nth-child(odd), |
| 168 | +.bigframes-widget table tbody tr:nth-child(odd) td { |
| 169 | + background-color: var(--bf-row-odd-bg); |
| 170 | +} |
| 171 | + |
| 172 | +.bigframes-widget table tbody tr:nth-child(even), |
| 173 | +.bigframes-widget table tbody tr:nth-child(even) td { |
| 174 | + background-color: var(--bf-row-even-bg); |
| 175 | +} |
| 176 | + |
90 | 177 | .bigframes-widget .bf-header-content { |
91 | 178 | box-sizing: border-box; |
92 | 179 | height: 100%; |
|
106 | 193 | } |
107 | 194 |
|
108 | 195 | .bigframes-widget button { |
| 196 | + background-color: transparent; |
| 197 | + border: 1px solid currentColor; |
| 198 | + border-radius: 4px; |
| 199 | + color: inherit; |
109 | 200 | cursor: pointer; |
110 | 201 | display: inline-block; |
| 202 | + padding: 2px 8px; |
111 | 203 | text-align: center; |
112 | 204 | text-decoration: none; |
113 | 205 | user-select: none; |
|
120 | 212 | } |
121 | 213 |
|
122 | 214 | .bigframes-widget .bigframes-error-message { |
123 | | - background-color: #fbe; |
124 | | - border: 1px solid red; |
| 215 | + background-color: var(--bf-error-bg); |
| 216 | + border: 1px solid var(--bf-error-border); |
125 | 217 | border-radius: 4px; |
126 | | - font-family: |
127 | | - "-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", sans-serif; |
| 218 | + color: var(--bf-error-fg); |
128 | 219 | font-size: 14px; |
129 | 220 | margin-bottom: 8px; |
130 | 221 | padding: 8px; |
|
139 | 230 | } |
140 | 231 |
|
141 | 232 | .bigframes-widget .null-value { |
142 | | - color: gray; |
143 | | -} |
144 | | - |
145 | | -.bigframes-widget td { |
146 | | - padding: 0.5em; |
| 233 | + color: var(--bf-null-fg); |
147 | 234 | } |
148 | 235 |
|
149 | | -.bigframes-widget tr:hover td, |
150 | | -.bigframes-widget td.row-hover { |
151 | | - background-color: var(--colab-hover-surface-color, var(--jp-layout-color2)); |
| 236 | +.bigframes-widget .debug-info { |
| 237 | + border-top: 1px solid var(--bf-border-color); |
152 | 238 | } |
0 commit comments