Skip to content

Commit 5e0153c

Browse files
authored
fix(ui): improve light-theme component rendering (#5526)
Fixes some light-theme specific quirks: On chromium-based browsers, scrollbar always rendered in dark styling, because the `color-scheme` property was missing, additionally the `$osv-background` was not visible. Before/After: <img width="1704" height="520" alt="home_before" src="https://github.com/user-attachments/assets/74bfeb1c-9dc9-44f6-9165-c98f1869fc30" /> <img width="1704" height="588" alt="home_after" src="https://github.com/user-attachments/assets/78cf61b2-b1e5-4f03-a8b3-370751d636ba" /> --- The "Load More" spinner on the list page had a white color making it invisible on light mode so that was fixed too by setting it to `$osv-text-color` instead: <img width="1700" height="462" alt="spinner_light" src="https://github.com/user-attachments/assets/2383de41-b6ba-4771-a0dc-39858b3bc065" /> --- Finally, non-CVSS severity chips had poor contrast on light mode, showing white text on a very light gray background (osv-grey-800): <img width="944" height="248" alt="ubuntu_before" src="https://github.com/user-attachments/assets/84c2f06c-fb15-4ecf-a803-adf50691786b" /> Fixed by updating the text color: <img width="1274" height="318" alt="ubuntu_after" src="https://github.com/user-attachments/assets/92081939-ab03-4ede-9a41-6431f47949a6" />
1 parent 7418f5a commit 5e0153c

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

gcp/website/frontend3/src/styles.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@use '@material/data-table/data-table-theme';
66

77
:root {
8+
color-scheme: dark;
89
--osv-bg: #292929;
910
--osv-text: #fff;
1011
--osv-grey-100: #f8f9fa;
@@ -30,6 +31,7 @@
3031
}
3132

3233
:root[data-theme="light"] {
34+
color-scheme: light;
3335
--osv-bg: #f5f3f4;
3436
--osv-text: #161A1D;
3537
--osv-grey-100: #202124;
@@ -156,6 +158,7 @@ body {
156158
height: 100%;
157159
scroll-behavior: smooth;
158160
font-size: 14px;
161+
background: $osv-background;
159162
}
160163

161164
ol,
@@ -179,7 +182,6 @@ table {
179182
/** Global styles */
180183

181184
body {
182-
background: $osv-background;
183185
color: $osv-text-color;
184186
font-family: $osv-body-font-family;
185187
--mdc-theme-primary: #{$osv-text-color};
@@ -309,7 +311,7 @@ pre {
309311

310312
&.severity-invalid {
311313
background: $osv-grey-800;
312-
color: white;
314+
color: $osv-text-color;
313315
}
314316
}
315317

@@ -775,7 +777,7 @@ md-icon-button.mdc-data-table__sort-icon-button {
775777

776778
turbo-frame[busy] .next-page-indicator {
777779
display: block;
778-
--md-circular-progress-active-indicator-color: white;
780+
--md-circular-progress-active-indicator-color: #{$osv-text-color};
779781
--md-circular-progress-size: 36px;
780782
}
781783

0 commit comments

Comments
 (0)