Skip to content

[SPARK-55853][UI] Migrate hardcoded CSS colors to Bootstrap 5 CSS custom properties#54640

Closed
yaooqinn wants to merge 1 commit intoapache:masterfrom
yaooqinn:SPARK-55853
Closed

[SPARK-55853][UI] Migrate hardcoded CSS colors to Bootstrap 5 CSS custom properties#54640
yaooqinn wants to merge 1 commit intoapache:masterfrom
yaooqinn:SPARK-55853

Conversation

@yaooqinn
Copy link
Member

@yaooqinn yaooqinn commented Mar 5, 2026

What changes were proposed in this pull request?

Replace hardcoded hex colors and rgb() values in CSS/JS files with Bootstrap 5 CSS custom properties so the Spark UI automatically adapts to data-bs-theme="dark".

Why are the changes needed?

The Spark UI currently uses hardcoded color values throughout its CSS and JS files. To support dark mode via Bootstrap 5's data-bs-theme attribute, these colors need to use CSS custom properties that automatically adapt.

Does this PR introduce any user-facing change?

No visual change in light mode. Enables future dark mode support by making all colors theme-aware.

How was this patch tested?

  • ./dev/lint-js passes
  • ./build/sbt core/compile sql/compile succeeds
  • Manual verification that all hardcoded colors outside :root blocks have been replaced

Was this patch authored or co-authored using generative AI tooling?

Yes, GitHub Copilot CLI was used.

…tom properties

Replace hardcoded hex colors and rgb() values in CSS/JS files with Bootstrap 5 CSS custom properties so the Spark UI automatically adapts to `data-bs-theme="dark"`.

### Changes
- **webui.css**: Replaced ~27 hardcoded color references with BS5 variables (`--bs-link-color`, `--bs-body-color`, `--bs-border-color`, etc.) and custom `--spark-*` variables for progress bars and thread dump hover.
- **spark-dag-viz.css**: Replaced ~21 hardcoded colors with BS5 variables and custom `--spark-dag-*` variables for DAG visualization nodes, clusters, and edges.
- **timeline-view.css**: Replaced ~33 hardcoded colors with BS5 variables and custom `--spark-timeline-*` / `--spark-*-proportion` variables for timeline status indicators and task proportion bars.
- **spark-sql-viz.css**: Replaced ~7 hardcoded colors with BS5 variables and custom `--spark-sql-*` variables for SQL visualization nodes, edges, and selection highlights.
- **table.js**: Replaced `#f9f9f9`/`#ffffff` striping colors with `var(--bs-tertiary-bg)`/`var(--bs-body-bg)`.
- **historypage.js**: Replaced `#fff` background color with `var(--bs-body-bg)`.

All visualization-specific colors are defined as custom CSS variables with both light and dark mode variants via `:root, [data-bs-theme="light"]` and `[data-bs-theme="dark"]` blocks.

### What is not changed
- Box-shadow `rgba(0,0,0,...)` values (shadows remain dark in both modes)
- Decorative arrow colors in scroll buttons (white on colored background)
- Minified CSS/JS files
- Structured streaming chart colors (D3 series colors work on both backgrounds)

Closes #SPARK-55853

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Contributor

@allisonwang-db allisonwang-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enables future dark mode support

Very excited for this!

@yaooqinn yaooqinn closed this in 0d0cce1 Mar 6, 2026
@yaooqinn yaooqinn deleted the SPARK-55853 branch March 6, 2026 03:24
@yaooqinn
Copy link
Member Author

yaooqinn commented Mar 6, 2026

Thank you @dongjoon-hyun @allisonwang-db, merged to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants