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

Add css property to widgets #100

Merged
merged 2 commits into from
Sep 18, 2023
Merged

Add css property to widgets #100

merged 2 commits into from
Sep 18, 2023

Conversation

matt1432
Copy link
Contributor

This PR is basically a copy of this commit but for AGS instead of EWW.

It allows setting CSS of subnodes such as this scale in EWW:

(scale :value song_pos
       :min 0
       :max song_length
       :orientation "h"
       :onchange "playerctl -p Spot position {}"
       :css "highlight { background-color: ${button_accent}; }
             slider { background-color: ${button_accent}; }
             trough { background-color: rgba(${button_accent}, 0.4); }")

It would be like this in AGS:

export const PositionSlider = (player, params) => Slider({
    ...params,
    className: 'position-slider',
    css: `highlight { background-color: ${button_accent}; }
          slider { background-color: ${button_accent}; }
          trough { background-color: ${button_accent}; }`,
    hexpand: true,
    drawValue: false,
...

@matt1432
Copy link
Contributor Author

@Aylur Is there anything missing before you'd want to merge this PR?

@Aylur Aylur merged commit 0bd14ef into Aylur:main Sep 18, 2023
1 check passed
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.

2 participants