Skip to content

feat: dark and light theme support#442

Open
isabelroses wants to merge 1 commit into
mainfrom
isabel/treewide/dark-light-support
Open

feat: dark and light theme support#442
isabelroses wants to merge 1 commit into
mainfrom
isabel/treewide/dark-light-support

Conversation

@isabelroses

Copy link
Copy Markdown
Member

Perhaps a oversight but a understandable one seeing as we currently only have 1 reactive theme, zed. But that may change with the addition of ghostty!

closes #420

The idea here was to introduce darkFlavor and lightFlavor in a very none breaking way, such that they both default to config.catppuccin.flavor rather then mocha and latte respectively.

@isabelroses
isabelroses requested a review from getchoo December 31, 2024 08:33
Comment thread modules/global.nix
Comment on lines +29 to +39
darkFlavor = lib.mkOption {
type = catppuccinLib.types.flavor;
default = config.catppuccin.flavor;
description = "Global Catppuccin dark flavor";
};

lightFlavor = lib.mkOption {
type = catppuccinLib.types.flavor;
default = config.catppuccin.flavor;
description = "Global Catppuccin light flavor";
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not too big a fan of this API. I think it'd be better to have a single enum option defining whether or not to use dark mode, and continuing using the local flavor option in modules (which should be fine since both can still be overridden on a per-module basis if you'd like light mode with a different-than-global flavor for example)

i.e., this would become

{
  # Or maybe name it `mode`? I dunno
  theme = lib.mkOption {
    type = lib.types.oneOf [ "light" "dark" ];
    default = dark;
    description = "Global Catppuccin theme type";
    example = lib.literalExpression "light";
  };
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I see the idea, but i assume some people like macOS users would be more wanting to have the dark and light options since they are not enforced into declarative light/dark.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh and totally forgot for ghostty which is a single string, making it a bit hard to do that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not too sure how else to generalize this API then. Having dynamic light/dark is virtually exclusive to macOS, and most apps will just not support it; I don't know where else this would really be used besides Ghostty and Zed

If we can configure either of those two to use a "dynamic" mode, I would be fine with that being a third option in this enum -- and those two ports having their own exclusive light/darkFlavor options. Otherwise I don't think this is a good fit here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Having dynamic light/dark is virtually exclusive to macOS

you can now have a light/dark switching on linux more modernly. so maybe we could achieve this now. and is becoming more common of a option like in fish. we also support nixos modules which are websites so they would naturally have light/dark toggles.

i think the enum isn't a great approach tho since it makes the api much more complex than it needs to be. and we would have to maybe introduce new options. for example the fish port supports dynamic theming but only with latte light mode. which compared to userstyles feels regressive.

Comment thread modules/home-manager/zed-editor.nix Outdated
Comment thread modules/home-manager/zed-editor.nix Outdated
Comment thread modules/home-manager/zed-editor.nix
@different-name

Copy link
Copy Markdown
Contributor

Perhaps a oversight but a understandable one seeing as we currently only have 1 reactive theme, zed. But that may change with the addition of ghostty!

If Firefox Userstyles gets merged, that'd be another - currently setting both light and dark to the same flavor

@hackardoX

This comment was marked as spam.

@HeitorAugustoLN

Copy link
Copy Markdown
Member

This would be really neat for #549, since COSMIC has support for automatically switching themes when it's day or night

@avycado13

This comment was marked as spam.

@isabelroses
isabelroses force-pushed the isabel/treewide/dark-light-support branch from 88c9409 to 1299c61 Compare May 26, 2026 18:49
@isabelroses
isabelroses force-pushed the isabel/treewide/dark-light-support branch from 1299c61 to 6f18993 Compare May 26, 2026 19:01
@isabelroses isabelroses added this to the 26.11 milestone May 26, 2026
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.

Support separate light/dark themes

6 participants