Skip to content

Themes: Windows contrast themes and Reduce Transparency on every platform - #322

Merged
rdrake merged 4 commits into
developfrom
theme-a11y
Nov 21, 2026
Merged

rdrake merged 4 commits into
developfrom
theme-a11y

Conversation

@rdrake

@rdrake rdrake commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Item 3 of the theme-structure review.

What changes

  • Windows contrast themes (forced colours). A block at the end of style.css:
    • takes the ps scene out of the page, and themeScene.ts stops its frame loop too;
    • drops every blur;
    • uses outlines in system colours where the app shows state with only a fill or a shadow: keyboard focus, the composer's focus, the open conversation;
    • paints selected and active items (a selected tab or segment, a checked radio row, a pressed control, the active context-menu and autocomplete rows, the active user) in Highlight with HighlightText;
    • draws a channel mention's bar in the highlight colour;
    • outlines badges.
  • Reduce Transparency on every platform, as html[data-reduce-transparency] (helpers/systemAccessibility.ts), next to the motion and contrast attributes.
    • Chromium (Windows, Android, desktop browsers) reads prefers-reduced-transparency; the Android app follows the system's high-contrast text as well.
    • WebKit has no such query, so in the iOS and macOS apps the shell reports the setting and its changes as Transparency, from SeancePlugin.swift and Bridge.swift. A change outranks a late startup reply.
    • ps.css and macos.css key their solid fallbacks on the attribute instead of the media query. ps's own-row card under reduced transparency sets only its fill, so the "Highlighted row" band stays on it.
    • Shared surfaces turn solid too: the macOS image viewer and the media tools over a video.
  • Project rules. CLAUDE.md and themes.md now say that reduced transparency is read from the attribute, and that forced colours is the one media query. The theme contract's attribute table lists it.

Verification

  • pnpm test passes (lint, typecheck, mocha).
  • test/themes/ps.ts now:
    • reads rules scoped by the attribute;
    • checks that no reduced-transparency rule takes the own-row band's image away.
  • tools/scenarios/forced-colors.mjs, new, passes in Chromium (11 checks). Under ps it checks:
    • reduced transparency: the attribute is set, the sidebar loses its blur and its fill turns opaque;
    • forced colours: the scene is hidden, nothing is blurred, the open conversation and the composer bar are outlined, keyboard focus shows a ring, the active context-menu row and the selected Settings tab take the system's highlight colours.
  • The Swift compiles on a Mac:
    • macOS: swift build, and a full macOS app build;
    • iOS: xcodebuild for the Simulator and for a device.
  • Two review rounds; their findings are fixed here.

Not done

  • Not yet tried by hand: switching Reduce Transparency in the iOS and macOS apps to see the page follow live. The bridge compiles, but this check needs a device.
  • Not run under Windows WebView2 or Linux WebKitGTK.
  • With Reduce Transparency on, the Apple apps' first paint can show glass for one native round-trip, before the shell answers. Motion and contrast from the shell behave the same today.
  • test/themes/ps.ts checks the reduced-transparency rules by selector, not declaration by declaration.

@rdrake
rdrake marked this pull request as ready for review November 21, 2026 01:58
…form

Forced colours (Windows' contrast themes, in the Windows app's WebView2 and
every Windows browser) drops shadows and fills, which is how many controls
show focus and state. A block at the end of style.css restates them as
outlines in system colours (keyboard focus, the composer, the open
conversation, selected segments, mentions, badges), takes the ps scene out
of the page and stops its frame loop, and drops every blur.

Reduce Transparency becomes html[data-reduce-transparency], like Reduce
Motion: WebKit has no prefers-reduced-transparency, so ps.css's and
macos.css's media blocks never applied on iOS, macOS or Linux. The query
still sets it where Chromium has it; the iOS and macOS shells report the
system setting and its changes through a Transparency plugin.
Under forced colours, what is chosen (a selected segment or tab, the
context-menu row or completion the arrow keys reached) takes the system's
selection colours, and the keyboard focus is a ring outside the control,
so a focus on a selected segment still shows; the marks are sized in rem.
In the Android app, the shell's live high-contrast report stands for
Reduce Transparency, which Chromium derives from it and WebView reads only
at startup. A change the Apple shell reports outranks its startup status
reply. The media toolbar, the Mac image viewer and ps's user-list headings
go solid too. The scenario checks the menu's active row and the sidebar's
opaque fill; the docs say which browsers see the setting.
A selected tab's own button (Settings, Oper) takes the selection's text
colour, not the theme's. Under Reduce Transparency the toolbar over an
image or video is on black at full opacity, and an audio preview's keeps
the row it sits on. A change the Android shell reports outranks its
startup status reply. The scenario checks the selected Settings tab's
label; the docs name the engines that see the setting.
@rdrake
rdrake merged commit 2dee1ac into develop Nov 21, 2026
10 checks passed
@rdrake
rdrake deleted the theme-a11y branch November 21, 2026 03:37

This branch was previously deployed

1 inactive deployment
github-pages — deb44278 Deployed Nov 21, 2026 by rdrake via deploy #1395
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.

1 participant