stylix: add stylix.{colors,fonts,image}.enable options
i use stylix in conjunction with pywal clone wallust (c.f. #99), using the latter to dynamically swap colors out, while using stylix for typography.
currently tho, stylix doesn't really allow use for just one of those two.
it would be nice if such a use-case were supported tho.
would you be open to a PR adding such a toggle stylix.colors.enable?
i use stylix in conjunction with pywal clone wallust (c.f. #99), using the latter to dynamically swap colors out, while using stylix for typography. currently tho, stylix doesn't really allow use for just one of those two. it would be nice if such a use-case were supported tho. would you be open to a PR adding such a toggle
stylix.colors.enable?
IIRC, this use case was already very briefly mentioned once somewhere, but I do not know where. Either way, adding guards for explicit and major Stylix functionalities would surely be great. For example, we could add the following guards:
-
stylix.colors.enable- Disables all color scheme declarations. Since some of our Mustache templates couple colors with related functionalities, like border radius or border width, we could guard all of it or first decouple them. Considering that decoupling functionalities probably takes a while, it might be better for this guard to disable all of it together for now.
-
stylix.fonts.enable- Disables all font declarations.
-
stylix.image.enable- Allows extracting the color scheme from the image without setting it anywhere. Although, this naming convention is convenient and consistent with the Nix
.enableconvention, this introduces a breaking change sincestylix.imageis an option and not an attribute set. We should reconsider how to handle this.
- Allows extracting the color scheme from the image without setting it anywhere. Although, this naming convention is convenient and consistent with the Nix
We should reconsider how to handle this.
Potentially rename the option to wallpaper (a more fitting name, and so we can gracefully handle image for backwards compatibility). At the same time as adding an enable option, the new format should be future proofed in case support for slideshows/animations/videos is added.
However, I personally prefer setting the values to null rather than having a separate enable option - this has the added benefit of causing an error if a module doesn't respect enable = false and tries to use the value anyway.
However, I personally prefer setting the values to
nullrather than having a separate enable option - this has the added benefit of causing an error if a module doesn't respectenable = falseand tries to use the value anyway.
Yes, setting the values to null seems more ergonomic than setting a related enable option to false.
we need this
we need this
We know.
Progress on this is currently blocking on the treewide mkTarget migration, although https://github.com/nix-community/stylix/pull/1721 already implements this on a target level.
Feel free to submit PRs or help unblock https://github.com/nix-community/stylix/pull/1340.