Skip to content

UI: Make the Dag pause toggle distinguishable in dark mode - #70203

Merged
choo121600 merged 1 commit into
apache:mainfrom
eddiesr93:fix-66759-dag-toggle-dark-mode
Jul 22, 2026
Merged

UI: Make the Dag pause toggle distinguishable in dark mode#70203
choo121600 merged 1 commit into
apache:mainfrom
eddiesr93:fix-66759-dag-toggle-dark-mode

Conversation

@eddiesr93

@eddiesr93 eddiesr93 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

In dark mode the Dag pause toggle is hard to make out: its off-state track uses
bg.emphasized, which in this palette lands within 0.05 oklch lightness of the page
background (0.08 in light mode), so only the white thumb reads and the pill has no
visible edge.

This gives the switch control a 1px inset ring so the shape is legible in both modes.

Why an inset shadow and not a border

Two earlier attempts, #67406 and #69159, added a border to the control and were closed
after review found the thumb was no longer centred and the horizontal layout shifted.
That is unavoidable with a border: the thumb's size and its checked travel are both
derived from --switch-height / --switch-width, so any box-model space the control
takes shrinks the content box the thumb sits in while its translate distance stays the
same. box-shadow: inset costs no layout space.

The thumb also stays concentric with the track's end cap — both are centred on (8, 8),
with radii 6.4 and 8. Measured in a running UI:

control thumb thumb gap T / B / leading
main 32×16 12.8×12.8 1.60 / 1.60 / 1.60
this PR 32×16 12.8×12.8 1.60 / 1.60 / 1.60

Before / after

Dags list, breeze start-airflow --dev-mode.

Dark mode — before, then after:

dark mode before

dark mode after

Light mode. The same problem is milder but present: against a striped row the
off-state track sits about 0.04 oklch from the row behind it, so the pill loses its edge
there too. That is why the ring is applied in both modes rather than only in dark.

light mode before

light mode after

closes: #66759


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.8)

Generated-by: Claude Code (Opus 4.8) following the guidelines


Drafted-by: Claude Code (Opus 4.8); reviewed by @eddiesr93 before posting

The off-state track uses bg.emphasized, which in this palette lands within
0.05 oklch lightness of the page background, so only the white thumb reads
and the pill has no visible edge.

An inset shadow is used rather than a border because the thumb's size and
its checked travel are both derived from --switch-height/--switch-width:
anything that takes space in the control's content box shrinks the box the
thumb sits in while its translate distance stays the same, which pushes it
off centre and past the end of the track.
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Jul 21, 2026

@dheerajturaga dheerajturaga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree in dark more this is not easy to make out. However Id leave the decision to merge to the UI maintainers

@choo121600 choo121600 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! It was a bit hard to see in dark mode ;)
Thanks for improving it!

@choo121600
choo121600 merged commit 83c0a9c into apache:main Jul 22, 2026
89 checks passed
@bbovenzi bbovenzi added this to the Airflow 3.3.1 milestone Jul 22, 2026
@bbovenzi bbovenzi added the backport-to-v3-3-test Backport to v3-3-test label Jul 22, 2026
vatsrahul1001 added a commit that referenced this pull request Aug 3, 2026
…70748)

The off-state track uses bg.emphasized, which in this palette lands within
0.05 oklch lightness of the page background, so only the white thumb reads
and the pill has no visible edge.

An inset shadow is used rather than a border because the thumb's size and
its checked travel are both derived from --switch-height/--switch-width:
anything that takes space in the control's content box shrinks the box the
thumb sits in while its translate distance stays the same, which pushes it
off centre and past the end of the track.

(cherry picked from commit 83c0a9c)

Co-authored-by: Eddie Roman <44783562+eddiesr93@users.noreply.github.com>
vatsrahul1001 added a commit that referenced this pull request Aug 5, 2026
…70748)

The off-state track uses bg.emphasized, which in this palette lands within
0.05 oklch lightness of the page background, so only the white thumb reads
and the pill has no visible edge.

An inset shadow is used rather than a border because the thumb's size and
its checked travel are both derived from --switch-height/--switch-width:
anything that takes space in the control's content box shrinks the box the
thumb sits in while its translate distance stays the same, which pushes it
off centre and past the end of the track.

(cherry picked from commit 83c0a9c)

Co-authored-by: Eddie Roman <44783562+eddiesr93@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-3-test Backport to v3-3-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dag toggle is very hard to distinguise in dark mode

5 participants