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

Waybar: only inject colors #429

Open
3elDU opened this issue Jun 14, 2024 · 7 comments
Open

Waybar: only inject colors #429

3elDU opened this issue Jun 14, 2024 · 7 comments
Labels
feature A new feature or a feature request

Comments

@3elDU
Copy link

3elDU commented Jun 14, 2024

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:

programs.waybar.style = ''
@define-color base00 ${base00}; @define-color base01 ${base01}; @define-color base02 ${base02}; @define-color base03 ${base03};
@define-color base04 ${base04}; @define-color base05 ${base05}; @define-color base06 ${base06}; @define-color base07 ${base07};
@define-color base08 ${base08}; @define-color base09 ${base09}; @define-color base0A ${base0A}; @define-color base0B ${base0B};
@define-color base0C ${base0C}; @define-color base0D ${base0D}; @define-color base0E ${base0E}; @define-color base0F ${base0F};

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.

@trueNAHO
Copy link
Collaborator

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 extraConfig might 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.

-- #395

@trueNAHO trueNAHO added technical debt Things which should be cleaned up or improved feature A new feature or a feature request and removed technical debt Things which should be cleaned up or improved labels Jun 14, 2024
@danth
Copy link
Owner

danth commented Jun 14, 2024

It seems we're trying to cater to two different groups of users:

  1. Those who expect the CSS to be fully functional without further coding
  2. 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.

@3elDU
Copy link
Author

3elDU commented Jun 15, 2024

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;

@trueNAHO
Copy link
Collaborator

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;?

@danth
Copy link
Owner

danth commented Jun 16, 2024

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.

@tbaumann
Copy link

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.

@3elDU
Copy link
Author

3elDU commented Jun 21, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or a feature request
Projects
None yet
Development

No branches or pull requests

4 participants