Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style changes are not reverted after disabling targets #930

Open
strangeglyph opened this issue Feb 28, 2025 · 4 comments
Open

Style changes are not reverted after disabling targets #930

strangeglyph opened this issue Feb 28, 2025 · 4 comments

Comments

@strangeglyph
Copy link

Hi everyone,

I recently tried to give stylix a shot. However, the settings made the firefox menu text ridiculously large:

Firefox UI and Github UI

I tried to revert the changes by disabling the targets, and even setting autoEnable to false, but the large font size remains. Similarly, some color changes made to the shell remain. On the other hand, terminal and console changes are reverted as expected.

Here is my stylix config:

{ pkgs, config, ... }:

let pastel-dark-theme = rec {
  # snip
};
in
{
  stylix = {
    enable = true;
    autoEnable = false;

    base16Scheme = pastel-dark-theme;
    polarity = "dark";

    image = config.lib.stylix.pixel "base01";
    imageScalingMode = "fill";

    fonts = with pkgs; {
      emoji = {
        name = "Noto Sans Nerd Font";
        package = nerdfonts.override { fonts = [ "Noto" ]; };
      };
      monospace = {
        name = "SauceCodePro Nerd Font";
        package = nerdfonts.override { fonts = [ "SourceCodePro" ]; };
      };
      serif = {
        name = "Noto Serif Nerd Font";
        package = nerdfonts.override { fonts = [ "Noto" ]; };
      };
      sansSerif = {
        name = "Noto Sans Nerd Font";
        package = nerdfonts.override { fonts = [ "Noto" ]; };
      };
      sizes = {
        applications = 16;
        desktop = 12;
        popups = 16;
        terminal = 12;
      };
    };

    opacity = {
      applications = 1.0;
      desktop = 0.0;
      popups = 0.8;
      terminal = 0.8;
    };
  };

  home-manager.sharedModules = [{
    stylix.autoEnable = false;
    stylix.targets = {
      waybar.enable = false;
      sway.enable = false;
      swaylock.enable = false;
      firefox.enable = false;
      alacritty.enable = false;
    };
  }];
}
@trueNAHO
Copy link
Collaborator

I tried to revert the changes by disabling the targets, and even setting autoEnable to false, but the large font size remains. Similarly, some color changes made to the shell remain. On the other hand, terminal and console changes are reverted as expected.

Since it is impossible for Stylix to guarantee hot-reloading, make sure to restart affected applications. The safest option is to re-login or simply reboot.

the settings made the firefox menu text ridiculously large:

Most GUI applications primarily rely on the stylix.fonts.sizes.applications value:

      sizes = {
        applications = 16;
        desktop = 12;
        popups = 16;
        terminal = 12;
      };

Otherwise, the fonts themselves could be larger than "regular" fonts:

    fonts = with pkgs; {
      emoji = {
        name = "Noto Sans Nerd Font";
        package = nerdfonts.override { fonts = [ "Noto" ]; };
      };
      monospace = {
        name = "SauceCodePro Nerd Font";
        package = nerdfonts.override { fonts = [ "SourceCodePro" ]; };
      };
      serif = {
        name = "Noto Serif Nerd Font";
        package = nerdfonts.override { fonts = [ "Noto" ]; };
      };
      sansSerif = {
        name = "Noto Sans Nerd Font";
        package = nerdfonts.override { fonts = [ "Noto" ]; };
      };

Can you reproduce this with other fonts?

@strangeglyph
Copy link
Author

Since it is impossible for Stylix to guarantee hot-reloading, make sure to restart affected applications. The safest option is to re-login or simply reboot.

Tried that and it sadly didn't help either. Also tried disabling stylix altogether (and rebooting), still no change.

Can you reproduce this with other fonts?

It reproduces with DejaVu as well.

Most GUI applications primarily rely on the stylix.fonts.sizes.applications value:

I've tried resetting fonts.sizes.applications (and fonts.sizes.notifications too, for good measure) to 12, to no avail.

I also tried doing that alongside re-enabling the firefox target, in case the firefox settings weren't reset because stylix was ignoring it, but that didn't help either

@strangeglyph
Copy link
Author

Playing around some more, I also noticed that the cursor size in firefox is significantly larger (by maybe 50%) than in other applications. So I guess the DPI scaling of firefox got messed up along the way? Somehow?

@TroubleDog54
Copy link

TroubleDog54 commented Feb 28, 2025

Hello,

I am also experiencing this issue. When I enabled Stylix, everything (GNOME, LibreWolf, cursor, fonts, etc.) increased in size. I tried disabling Stylix to revert back, but the scaling issue still remains. I am using Stylix on home-manager standalone, Debian testing.

A workaround (for GNOME users at least) is to run dconf reset -f /org/gnome, which resets all GNOME settings to the default. This seemed to have fixed the issue.

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

No branches or pull requests

3 participants