Repository navigation
Todo
Description
This issue tracks problems with Windows contrast themes (CSS forced colors mode). It starts with one finding. More will be added after an audit of RStudio under contrast themes.
Related issues
- High Contrast mode issues (Windows) #12589: the earlier umbrella issue for Windows high contrast mode, closed 2026-06-18.
- Checkbox state invisible with Windows Contrast Themes enabled #18493 and Image-based checkmarks ignore Windows contrast themes #18494: checkbox states and image-based checkmarks in contrast themes, both fixed.
- Windows Dark Theme overrides RStudio IDE Theme #15052 (open): with a contrast theme on, the theme's colours override the editor theme's. Whether that is intended still needs a decision.
System details
RStudio Edition : Desktop or Server
RStudio Version : with #19832
OS Version : Windows 11
R Version : any
Split buttons' two halves can't be told apart
#19832 draws the menu half of a split button (such as the Open button's recent files in the main toolbar) as a chevron, set off from its button by a hairline. Toolbar buttons are also shaded on hover. In a contrast theme, neither shows:
- The hairline is the
background-colorof a::beforepseudo-element (.toolbarButtonMenuOnly:beforeinthemeStyles.css). Forced colors replaces it with the theme'sCanvascolour, keeping its 20% alpha, so it disappears against the toolbar. - The hover and pressed shades are
linear-gradientbackground images, which forced colors sets tonone.
Measured in Chromium with forced colors emulated (page.emulateMedia({ forcedColors: 'active' })), not yet on Windows:
| Off | Forced colors | |
|---|---|---|
| Hairline colour | rgba(0, 0, 0, 0.2) |
rgba(255, 255, 255, 0.2) on a white toolbar |
| Hovered button's background image | linear-gradient(rgba(0, 0, 0, 0.08), ...) |
none |
Notes on fixing
- Drawing the hairline as a 1px
border-leftwould let forced colors map it to a visible system colour. - A hover style for contrast themes needs a
@media (forced-colors: active)block. As the comment above the@supportsblock inthemeStyles.cssexplains, such a block has to be passed through GWT unparsed, and only@externalclass names can be used inside it..toolbarand.toolbarButtonare obfuscated, so this needs either external class names on toolbar buttons or a class set from Java.
Activity