Skip to content

Give the round menu buttons a translucent fill - #611

Open
Octopustank wants to merge 1 commit into
corecoding:mainfrom
Octopustank:fix/round-button-translucent-fill
Open

Octopustank wants to merge 1 commit into
corecoding:mainfrom
Octopustank:fix/round-button-translucent-fill

Conversation

@Octopustank

@Octopustank Octopustank commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The three round buttons at the bottom of the popup (Refresh, System Monitor,
Preferences) carry the generic .button class, whose background the shell theme
resolves into an opaque colour: st-mix(#ffffff, #36363a, 9%) in the dark
variant, st-mix(#222226, #fafafb, 12%) in the light one.

That mix is the theme's foreground composited over its own popup colour, and
once resolved it stops tracking that colour. With the stock opaque popup there
is nothing to see. With a translucent one — a see-through shell theme, or a blur
effect such as blur-my-shell's — the controls around these buttons follow the
backdrop while the three discs stay flat, which is what draws the eye.

This is worth fixing now because blur-my-shell 76, which unifies its blur
backends, is published on extensions.gnome.org for GNOME Shell 46 to 51, and its
popup blur is on by default. A blurred, translucent popup is therefore what
those users get out of the box, rather than something only seen on a
development build.

The theme already styles its own popup controls as translucent tints:

control dark variant background
.notification-button rgba(255, 255, 255, 0.15)
.modal-dialog-button rgba(255, 255, 255, 0.10)
.toggle-switch (track) rgba(255, 255, 255, 0.15)
.button / .icon-button st-mix(...) — opaque

.button is the exception among popup controls, and these three are the only
buttons in the Vitals popup that adopt it.

Change

Keep the theme's expression rather than its resolved result: the same foreground
at the same percentage, as an alpha layer.

variant theme's .button the same expression as alpha result over the popup colour
dark st-mix(#ffffff, #36363a, 9%) rgba(255, 255, 255, 0.09) 72 — the theme's #48484c
light st-mix(#222226, #fafafb, 12%) rgba(34, 34, 38, 0.12) 224 — the theme's #e0e0e1

Over the popup colour the theme mixes against, this lands on the theme's own
value. Over any other surface it keeps the same offset, which is how the
theme's translucent controls behave — in the dark variant the disc gets lighter
along with the backdrop instead of staying a flat patch.

The two variants tint in opposite directions, up from #36363a and down from
#fafafb, and an extension stylesheet cannot see which one is loaded: St's CSS
has no media queries and no handle on the variant. So extension.js adds the
class using getStyleVariant(), the function the shell itself uses to choose
between gnome-shell-dark.css and -light.css:

let styleClass = 'button vitals-button-action';
const variant = Main.getStyleVariant();
if (variant !== '')
    styleClass += ` vitals-glass-${variant}`;

getStyleVariant() returns 'dark', 'light', or '' for a session mode with
no colour scheme of its own; every mode the shell ships inherits
prefer-dark. If it ever returns something that matches no class, the buttons
keep the theme's .button fill — the current look — rather than fail.

The variant can also change while the session runs: switching between Light and
Dark in Appearance reloads the shell stylesheet without a restart. The class is
therefore reassigned when the menu opens, so the fill follows the switch the
next time the popup is shown.

Hover and active are the theme's st-lighten(+4%) / st-lighten(+9%) steps
(st-darken in the light variant) expressed as alpha: 0.14 and 0.20 on top of
0.09 in the dark variant, 0.17 and 0.23 on top of 0.12 in the light one. Every
interactive state is restated because the theme's .button:hover, :active and
:focus outrank a bare class. :focus keeps the base fill on purpose: the
theme's accent focus ring is !important and still draws, so the ring marks
keyboard focus while the fill stays translucent.

Measured with only the stylesheet swapped, same session, popup and backdrop:

state backdrop the theme's resolved fill this expression
dark variant 115 72 — 43 darker than the surface: a flat plate 128 — 13 lighter, in step with the system menu's round buttons (14 on a backdrop of the same tone)
light variant 236 224 — 12 darker 212 — 24 darker, the offset the theme itself uses over its own popup

Over the popup colours the theme mixes against, both give the same pixel: 72
on #36363a, 224 on #fafafb.

The same expression holds across shell versions. I resolved the theme's
.button fill and popup colour from the compiled stylesheet shipped with GNOME
Shell 45, 46, 47, 48, 49 and 50 — extracted from the Fedora package for each
release, so it is what those shells actually load — and the base fill matches
within 1/255 in both variants, the hover and active steps within 2/255 from 46
on. Shell 45 wrote those two steps as a mix toward white rather than as a
lightness step, so there they drift by up to 9/255, visible only while a button
is hovered or pressed.

Screenshots

Evidence is posted in the comments below, as before/after pairs. Each pair was
captured by swapping in exactly one stylesheet state (upstream main vs this
branch) and keeping the same session, popup and backdrop, so the images
correspond to the diff rather than to whatever happened to be loaded at the
time.

Environment: GNOME Shell 50.6; blur-my-shell 76 from extensions.gnome.org, with
popup blur on and override-background enabled (it owns the popup background).
Nothing here depends on a particular blur extension — any translucent popup
background produces the same mismatch.

Related

Follow-up work to #600. The geometry and the layering stay as merged; what
changes is only how the fill is expressed, so a translucent popup no longer
leaves the discs opaque.

#599 reported that these buttons borrow message-list-clear-button. That borrow
is gone, but the other half of the issue still stands: the buttons clash with a
restyled popup, because the class that replaced it, .button, resolves to an
opaque fill. This addresses that half in the form a translucent surface can use.

Notes

stylesheet.css carries the fills; extension.js picks the variant class and
reapplies it when the menu opens. No schema, prefs or locale changes, and no
version bump (EGO owns submission versioning).

Under the high contrast theme the fill also applies, and is darker than that
theme's own .button (47 instead of 74 on its #1a1a1a popup). The 1 px inset
border that delineates controls there comes from the theme and is untouched, so
the outline stays the same and only the fill behind it is dimmer.

@Octopustank

Octopustank commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author
compare

The theme's .button background is a resolved mix: its foreground at 9% over the
popup colour in the dark variant, 12% in the light one. Resolved, that colour
stops tracking the surface it was mixed against, so with a translucent popup the
three discs stay flat while the controls around them follow the backdrop.

Keep the same foreground percentage as an alpha layer instead. Over the popup
colour the theme mixes against, it lands on the theme's own value; over any
other surface it keeps the same offset, the way the theme's other translucent
popup controls already behave.

The two variants tint in opposite directions and an extension stylesheet cannot
tell which one is loaded, so the class is picked with the shell's own
getStyleVariant().
@Octopustank
Octopustank force-pushed the fix/round-button-translucent-fill branch from 0584a9f to fb3defa Compare October 20, 2026 14:51

This branch has not been deployed

No deployments
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