Waybar: only inject colors
The CSS that is shipped with stylix for waybar is not quite what I want, as I already have written my own styles for it. I only want for the colors to be prepended to the CSS, so that I would be able to use them.
It would be great if there would be an ability to only inject color definitions, as it is already being done:
https://github.com/danth/stylix/blob/73c6955b4572346cc10f43a459949fe646efbde0/modules/waybar/hm.nix#L36-L41
I'm not sure of what's the best practice to implement such behavior, as I, as the user set the waybar.style property, but stylix also has to write into there somehow. Perhaps a whole different paradigm is required for this, but I'm not the author of stylix to decide.
Perhaps a whole different paradigm is required for this, but I'm not the author of stylix to decide.
This is a somewhat already acknowledged problem:
the use of
extraConfigmight cause other potentially related issues. As discussed in #159 (comment), it makes it harder to override options, and as discussed in #388 (comment), it makes it easier to accidentally override Stylix options.-- https://github.com/danth/stylix/issues/395
It seems we're trying to cater to two different groups of users:
- Those who expect the CSS to be fully functional without further coding
- Those who want to customise the CSS
The best idea that comes to mind is adding a way to partially disable an individual target, so you still get the colors as variables but not applied to anything.
The best idea that comes to mind is adding a way to partially disable an individual target, so you still get the colors as variables but not applied to anything.
That is pretty much the behavior that I would expect, yeah, doing something like
stylix.targets.waybar.addCSS = false;
The best idea that comes to mind is adding a way to partially disable an individual target, so you still get the colors as variables but not applied to anything.
That is pretty much the behavior that I would expect, yeah, doing something like
stylix.targets.waybar.addCSS = false;
Is this not essentially disabling targets with stylix.targets.<TARGET>.enable = false;?
Is this not essentially disabling targets with
stylix.targets.<TARGET>.enable = false;?
It would keep the variable definitions part of the CSS, but not the opinionated part which applies those variables to certain areas of the UI.
I suppose you can just disable stylix for waybar and include the @define-color ... lines just the same as the home-manager module would do.
I suppose you can just disable stylix for waybar and include the
@define-color ...lines just the same as the home-manager module would do.
That's precisely what I did, for now. https://github.com/3elDU/nixos-config/blob/9894821719037a37be30cfbed296568963075183/home/wm/waybar.nix#L42-L47