AvengeMedia / AvengeMedia/DankMaterialShell
GTK3 dynamic theming: light-mode accent is mapped to primary_fixed_dim and sits at 1.62:1 against the window background
- Dominant language
- QML
- Stars
- 8.1k
- Forks
- 515
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 102
Description
### Compositor
Niri
### Distribution
Fedora
### If Other, please specify
_No response_
### Select your Installation Method
Distro Packaging
### Was this your original Installation method?
Yes
### If no, specify
_No response_
### dms doctor -vC
Click to expand
(`dms doctor -v`, relevant sections)
- Operating System: Fedora Linux 44 (Forty Four), amd64, Wayland
- DMS CLI: dms v1.6.1 · DMS Shell: v1.6.1 · Quickshell 0.3.1 (Fedora COPR avengemedia/quickshell)
- Compositor: niri 26.04
- matugen: Installed · adw-gtk3: Installed (GTK3 dynamic theming, user copy)
### Description
In light mode, DMS renders GTK3 colours from `quickshell/matugen/templates/gtk-light-colors.css`, which maps the accent onto `primary_fixed_dim`:
```css
@define-color accent_color {{colors.primary_fixed_dim.default.hex}};
@define-color accent_fg_color {{colors.on_primary_fixed.default.hex}};
@define-color accent_bg_color {{colors.primary_fixed_dim.default.hex}};
```
`primary_fixed_dim` is tone 80 and the light window surface is tone 98, so the accent lands at about 1.6:1 against the window background whatever the wallpaper. Measured on two different wallpapers:
| palette | accent (`primary_fixed_dim`) | window bg | contrast | `primary` on the same bg |
|---|---|---|---|---|
| blue | `#9ecafc` | `#f8f9ff` | 1.62:1 | `#33618d` — 6.18:1 |
| orange | `#feb877` | `#fff8f5` | 1.62:1 | `#86521a` — 6.18:1 |
The dark GTK3 template (`gtk-colors.css`) and the GTK4 template both use `primary`. Selected rows stay readable because `accent_fg_color` is `on_primary_fixed` (10:1 on the accent), but everything adw-gtk3 draws in the accent directly on the window background — links, check/radio/switch fills, focus outlines — is barely visible in light mode. The mapping is unchanged on `master`.
A user stylesheet in `~/.config/gtk-3.0/gtk.css` that redefines the three colours with `primary` / `on_primary` restores 6.18:1 for host apps, which points at the template mapping as the cause; it has to be maintained outside DMS, and on this setup it does not reach Flatpak GTK3 apps.
### Expected Behavior
In light mode the GTK3 accent should use `primary` / `on_primary`, as `gtk-colors.css` and the GTK4 template already do, so accent-coloured elements reach ~6:1 against the window background.
### Steps to Reproduce
1. Use GTK3 dynamic theming (user copy of adw-gtk3 present) and switch DMS to light mode.
2. Open any GTK3 app (e.g. xarchiver or LibreOffice) and look at a checked checkbox, a link, or a focused entry.
3. In `~/.local/share/themes/adw-gtk3/gtk-3.0/gtk.css`, the `BEGIN DMS OVERRIDE` block sets `accent_bg_color` to the `primary_fixed_dim` value.
### Error Messages/Logs
_No response_ — nothing is logged; the defect is visual.
### Screenshots/Recordings
_No response_
Contributor guide
Research direction
Start with quickshell/matugen/templates/gtk-light-colors.css and compare its accent mappings with gtk-colors.css and the GTK4 template. Update the light GTK3 accent mapping as described, then regenerate the theme and inspect a GTK3 app such as xarchiver or LibreOffice in light mode. Done means accent elements are visibly readable and use the expected primary palette values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- design, desktop
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100