Skip to content

Keep primary and destructive buttons readable on light accents - #14

Open
piotrkowski wants to merge 1 commit into
ianswope:masterfrom
piotrkowski:fix/suggested-action-contrast
Open

piotrkowski wants to merge 1 commit into
ianswope:masterfrom
piotrkowski:fix/suggested-action-contrast

Conversation

@piotrkowski

@piotrkowski piotrkowski commented Oct 11, 2026 •

Copy link
Copy Markdown

The global button rule sets background-color: transparent at APPLICATION priority, which also clears libadwaita's fill on .suggested-action and .destructive-action. Their text color (accent_fg_color / destructive_fg_color) is left as is, so with a light accent the label is dark on dark.

The Everforest palette from the omarchy.rs tests hits this: #7fbbb3 is above the on_color threshold, so the label is black on a transparent button. It affects every primary action, e.g. Connect an account, Save and sign in, Edit.

This gives both classes their fill back. button.suggested-action joins the existing button:active, button:checked rule, since inverse video is how the stylesheet already emphasizes a control. .destructive-action gets the same treatment in its own colors, for the same reason: a light red such as Catppuccin's #f38ba8 already gets black destructive_fg_color from on_color, which is black on a transparent button. Like a checked button, a filled one keeps its fill on hover.

Before / after (Everforest):

before / after

Checked with cargo check --no-default-features, fmt --check, clippy -D warnings and test --all-targets.

@piotrkowski piotrkowski changed the title Keep the fill on suggested and destructive action buttons Keep primary and destructive buttons readable on light accents Oct 11, 2026
The global `button` rule clears every button's fill to give controls the
terminal look: flat ground and a hairline. That includes `.suggested-action`
and `.destructive-action`, but their label keeps the colour libadwaita picks
for the fill, `accent_fg_color` and `destructive_fg_color`. On a light accent
that colour is black, so on a dark theme the primary action reads dark on
dark. Everforest, the palette in the Omarchy tests, does it to Connect an
account, Save and sign in and Edit; Catppuccin's light red does the same to
the delete buttons.

Both get their fill back. The primary action joins the pressed and checked
selectors, since inverse video is already how this stylesheet emphasises a
control, and the destructive one gets the same treatment in its own colours.
@piotrkowski
piotrkowski force-pushed the fix/suggested-action-contrast branch from e74f5cb to 3d8f73a Compare October 11, 2026 19:01
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