stylix icon indicating copy to clipboard operation
stylix copied to clipboard

gtk: dialog buttons in VSCode are always black

Open danth opened this issue 5 months ago • 7 comments

I assert that this issue is relevant for Stylix

  • [x] I assert that this is a bug and not a user error or support request.
  • [x] I assert that this is not a duplicate of an existing issue.

Description

Originally reported by @musjj in https://github.com/nix-community/stylix/issues/1239#issuecomment-2980596423.

Dialog boxes in VSCode always have black text on the buttons, rather than the theme color.

A workaround is to add the following to stylix.targets.gtk.extraCss:

.dialog-action-area > .text-button {
  color: @dialog_fg_color;
}

Not opening a pull request for this as this seems like an issue which should be fixed upstream, potentially in the adw-gtk3 theme.

flake.lock

Observed in several unstable versions after 25.05, by multiple people, so no specific flake.lock here.

Installation Method

NixOS

System Information

  • system: "x86_64-linux"
  • host os: Linux 6.12.34, NixOS, 25.11 (Xantusia), 25.11.20250627.30e2e28
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.28.4
  • nixpkgs: /nix/store/igmrb3hj6wr27ll3nlgjfaawf5jsjvji-source

Notify maintainers

@danth

danth avatar Jun 30 '25 13:06 danth

This also happens in Xournal++ (which is also a GTK app)

OsiPog avatar Jul 03 '25 23:07 OsiPog

This also happens in Xournal++ (which is also a GTK app)

I had originally thought it might be specific to Electron but this suggests that's not the case.

If we can narrow this down to GTK 3, then we could open an issue with the adw-gtk3 devs.

danth avatar Jul 04 '25 13:07 danth

Yes, this happens with gtk apps as well. Eg: Nemo file dialogs, tranmission file dialog (especially delete file dialog)

Image

This was with onedark-dark

idlip avatar Jul 09 '25 07:07 idlip

See also https://github.com/nix-community/stylix/issues/591#issuecomment-3049097223, this may actually be an issue in Stylix

danth avatar Jul 09 '25 12:07 danth

This is now also happening for tabs in Firefox GNOME theme (in my config at least), not sure if it's related

danth avatar Aug 18 '25 18:08 danth

This is still an issue for me. Could #1940 be extended to fix the colors in vscode?

elliott-farrall avatar Oct 19 '25 21:10 elliott-farrall

This issue seems to be caused by something different; I'm not sure what.

danth avatar Oct 20 '25 08:10 danth

This is now also happening for tabs in Firefox GNOME theme (in my config at least), not sure if it's related

For some reason this only happens when the gnome target is disabled.

LucasOe avatar Dec 16 '25 00:12 LucasOe

For some reason this only happens when the gnome target is disabled.

Seems like this line is responsible:

https://github.com/nix-community/stylix/blob/e6829552d4bb659ebab00f08c61d8c62754763f3/modules/gnome/hm.nix#L47-L48

I don't have polarity set in my config because I don't use automatically generated themes, so even with the GNOME target enabled that is setting it incorrectly for me. However, the Stylix polarity setting is only meant to be an input to the palette generator, not something which we actually pass to applications.

To fix this, we should do two things:

  • Stop using the polarity setting in the GNOME module. If a value is genuinely needed, derive it by inspecting the brightness of the actual color scheme rather than relying on the user to configure it.
  • Override FIrefox GNOME theme so that the text color does not depend on the DConf setting. It seems like even when I have the setting correct, the text is pure white rather than the foreground color from my theme.

danth avatar Dec 17 '25 00:12 danth

Not sure how related this is but I can't even enable targets.gnome due to a build error in the theme.

catppuccin-macchiato-gnome-shell-theme> Error: Undefined variable: "$panel_border_color".
catppuccin-macchiato-gnome-shell-theme>         on line 22 of data/theme/gnome-shell-sass/widgets/_panel.scss
catppuccin-macchiato-gnome-shell-theme>         from line 32 of data/theme/gnome-shell-sass/_widgets.scss
catppuccin-macchiato-gnome-shell-theme>         from line 7 of data/theme/gnome-shell-light.scss
catppuccin-macchiato-gnome-shell-theme>   Use --trace for backtrace.

elliott-farrall avatar Dec 17 '25 16:12 elliott-farrall