fix(css): fix desktop rename box styling on dark themes (#3843) by ronitgupta138 · Pull Request #3859 · linuxmint/nemo · GitHub
Skip to content

fix(css): fix desktop rename box styling on dark themes (#3843) - #3859

Open
ronitgupta138 wants to merge 1 commit into
linuxmint:masterfrom
ronitgupta138:fix/desktop-rename-dark-theme-styling
Open

ronitgupta138 wants to merge 1 commit into
linuxmint:masterfrom
ronitgupta138:fix/desktop-rename-dark-theme-styling

Conversation

@ronitgupta138

Copy link
Copy Markdown

Fixes #3843

Cause

When renaming an icon on the desktop with dark GTK themes (such as Adwaita-dark), the filename appears as near-white text on a white gradient background with an invisible black text caret.

This occurs due to a CSS cascade specificity conflict between the two shipped stylesheets:

  1. nemo-style-application.css defines:
    .nemo-desktop.view .entry,
    .nemo-desktop.view .entry:active,
    .nemo-desktop.view .entry:focus,
    .nemo-desktop.view .entry:backdrop {
        color: #000000;
        caret-color: #000000;
        background-image: -gtk-gradient(linear, ...);
    }
  2. nemo-style-fallback-mandatory.css defines:
    .nemo-window .nemo-window-pane widget.entry {
        color: @theme_fg_color;
        border-color: @theme_selected_bg_color;
        background-color: @theme_bg_color;
    }

Because the desktop window carries both .nemo-window/.nemo-window-pane and .nemo-desktop, the mandatory rule matches the desktop rename entry (widget.entry) with higher specificity (0,3,1 vs 0,3,0).

The mandatory rule overrides color (to @theme_fg_color, light in dark theme) and background-color (to @theme_bg_color, dark in dark theme), but omits background-image and caret-color. As a result:

  • The hardcoded white gradient from nemo-style-application.css is not overridden and is painted over @theme_bg_color, producing near-white text on a white gradient.
  • caret-color remains hardcoded to #000000, making the caret invisible against the dark background.

Solution

In gresources/nemo-style-fallback-mandatory.css:

  • Added background-image: none; and caret-color: @theme_fg_color; to .nemo-window .nemo-window-pane widget.entry.
  • Added background-image: none; to .nemo-window .nemo-window-pane widget.entry:selected for consistency across entry selection states.

Verification

  • Tested stylesheet parsing and GtkStyleContext resolution using GTK 3 (gi.repository.Gtk):
    • Verified EelEditableLabel widget path resolution (window.nemo-window.nemo-desktop-window > box.nemo-window-pane > box.nemo-desktop.view > widget.entry).
    • Confirmed under dark theme palette that background-image resolves to None in both normal and selected states, caret-color resolves to @theme_fg_color, and text/background colors properly adhere to theme tokens (@theme_fg_color / @theme_bg_color).
    • Validated that fallback mandatory stylesheet loads cleanly across both @theme_ and @ variable naming conventions handled by src/nemo-application.c.

When renaming an icon on the desktop, .nemo-window .nemo-window-pane widget.entry
in nemo-style-fallback-mandatory.css matches the rename entry with higher
specificity (0,3,1) than .nemo-desktop.view .entry (0,3,0) in
nemo-style-application.css.

Because the mandatory sheet only overrode color and background-color,
background-image and caret-color fell through to the hardcoded light-theme
defaults (#000000 caret and white linear gradient). On dark themes, this
caused white text to be rendered over a white gradient with an invisible
black caret.

Neutralize both leftovers by setting background-image: none and
caret-color: @theme_fg_color on .nemo-window .nemo-window-pane widget.entry,
and ensure background-image: none is also set on widget.entry:selected.

Fixes linuxmint#3843
Copilot AI balanced review requested due to automatic review settings October 15, 2026 18:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Desktop rename box: white text on a hardcoded white gradient with any dark theme (also black caret)

2 participants