nix icon indicating copy to clipboard operation
nix copied to clipboard

Support separate light/dark themes

Open samhh opened this issue 1 year ago • 4 comments

I've migrated my programs.zed-editor to take advantage of #359 (thank you!) and had to override the light theme given currently catppuccin only supports a single "flavour" which is implicitly applied across both light and dark modes: https://github.com/samhh/dotfiles/commit/9ca1a63680ef71638ad9612c37181bef06fb4f29#diff-87b22b9d53b9e4c7e5bf904535ac70f0ef2566611199d4cf240ad1704423b58dR87-R89

Ideally, given the likes of Zed support specifying separate light and dark themes, we'd be able to optionally configure a different flavour for each. Presumably then there'd need to be some notion of a default where that dichotomy doesn't exist.

samhh avatar Dec 21 '24 13:12 samhh

It would be cool to see this. Though it would be interesting. One thing to note is only some ports would be capable of using the dark/light themes. Which may make it hard to implement.

A potential idea would be to modify the catppuccinLib.mkCatppuccinOptions to handle this, however it would make a bit of a grey area around the global flavour option.

Prior art in userstyles: https://github.com/catppuccin/userstyles/blob/f90308af39acd7843372d1134965a826d4aa5534/template/catppuccin.user.css#L13-14

isabelroses avatar Dec 21 '24 14:12 isabelroses

in my opinion ports that support both light and dark themes should include latte as the light mode variant by default, but there should also be a global or local option to disable this (resulting in the global flavour option being used for both light and dark)

for example: catppuccin.lightDarkEnable = true;

theme = {
  light = "Catppuccin Latte";
  dark = "Catppuccin " + catppuccinLib.mkUpper cfg.flavor;
};

catppuccin.lightDarkEnable = false;

theme = {
  dark = "Catppuccin " + catppuccinLib.mkUpper cfg.flavor;
  dark = "Catppuccin " + catppuccinLib.mkUpper cfg.flavor;
};

this could of course be shortened with an if statement but I don't know nix

42willow avatar Dec 31 '24 00:12 42willow

in my opinion ports that support both light and dark themes should include latte as the light mode variant by default, but there should also be a global or local option to disable this (resulting in the global flavour option being used for both light and dark)

for example: catppuccin.lightDarkEnable = true;

theme = {
  light = "Catppuccin Latte";
  dark = "Catppuccin " + catppuccinLib.mkUpper cfg.flavor;
};

catppuccin.lightDarkEnable = false;

theme = {
  dark = "Catppuccin " + catppuccinLib.mkUpper cfg.flavor;
  dark = "Catppuccin " + catppuccinLib.mkUpper cfg.flavor;
};

this could of course be shortened with an if statement but I don't know nix

This seems like a weird solution to the problem. What if I use mocha as my dark theme and frappe as my light theme? That solution wouldn't work for me. The actual solution would be to add separate light and dark flavor options, and then a default flavor option for either light or dark wheb only one theme can be set.

uncenter avatar Dec 31 '24 01:12 uncenter

@uncenter ah ok, wasn't aware anyone really did that - and that does make more sense. light mode flavour can fallback to the dark mode one when unset

42willow avatar Dec 31 '24 06:12 42willow