linuxmint / linuxmint/mint-themes

Mint-Y GTK4: text selection is invisible in spin buttons (wrong CSS selector)

Open Beginner friendly
#555 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
265
Forks
137
PR merge metrics
No merged PRs in 30d

Description

Hi there,

mint-themes 2.3.8, Linux Mint 22.3, GTK 4.

Selecting text inside a GtkSpinButton shows no selection highlight. The text stays on the plain background, while the same gesture in a GtkEntry next to it is highlighted normally. Reproducible in any GTK4 app; gtk4-widget-factory
(package gtk-4-examples) is enough.

The generated sheet has, at /usr/share/themes/Mint-Y/gtk-4.0/gtk.css lines 3037,
3044 and 3051
(same in the -Sand/-dark variants, gtk-dark.css lines 3034/3041/3048):

entry > text > selection, spinbutton text > text > selection, … {
  background-color: #c5a07c; }

spinbutton text > text > selection is one text too many for a horizontal spin button, whose node tree is spinbutton > text > selection, so the selector matches nothing.

It looks like the SCSS appends > text > selection to a variable that already expands to "entry, spinbutton text".

GTK4's own default theme handles both shapes:

spinbutton.vertical > text > text > selection,
spinbutton:not(.vertical) > text > selection,
entry > text > selection { … }

(from /org/gtk/libgtk/theme/Default/Default-light.css, extracted with gresource extract /usr/lib/x86_64-linux-gnu/libgtk-4.so.1 …)

Adding the spinbutton:not(.vertical) > text > selection branch to the three rules (normal, color:, and :disabled) fixes it. Application-side workaround,

For reference:

spinbutton > text > selection {
  background-color: @theme_selected_bg_color;
  color: @theme_selected_fg_color;
}

The content of the bug report was generated by AI, but I checked it and it seems correct to me.
I haven't checked whether this issue is present in other themes.

Have a great day.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the SCSS that generates the selection rules appearing in gtk-4.0/gtk.css around lines 3037, 3044, and 3051, plus the corresponding gtk-dark.css and -Sand/-dark variants. Check the selector against gtk4-widget-factory, update the three normal, colored, and disabled rules, and verify that horizontal spin-button text selection is visible.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
design, desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.