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

Adding a "pressed" and "depressed" state #13

Open
Savjee opened this issue Mar 19, 2020 · 7 comments
Open

Adding a "pressed" and "depressed" state #13

Savjee opened this issue Mar 19, 2020 · 7 comments

Comments

@Savjee
Copy link
Owner

Savjee commented Mar 19, 2020

Feedback by fitim

@domoson
Copy link

domoson commented Mar 29, 2020

It would be awesome to have a way to visualize "on" and "off" state of an entity, like in "Most used" here: https://github.com/N-l1/lovelace-soft-ui/raw/master/images/UI_lights_page_dark_theme.png

Great job so far!

@Savjee
Copy link
Owner Author

Savjee commented Mar 30, 2020

Thanks for the feedback! I was thinking of adding support for templates to icon_color.
Would this be an acceptable solution for you?

@domoson
Copy link

domoson commented Mar 30, 2020

Same comment, with better formatting:

Wow, thanks for the prompt response!

Yes, template for icon_color would definitely be helpful, but what would be even better is:

  1. in addition to template-able icon_color / font_color: implement default behavior (mainly for switches and/or lights that support on/off state), e.g. by default set icon_color = var(--primary-color) if state==='on'; else var(--text-disabled-color) [these CSS variables are only suggestions, not sure what is best practice]
  2. have an even better visual representation of on/off using this "3D pressed down" effect (different style box shadow) as in the screenshot I posted earlier

If I can support in any of this with my very limited JS / CSS experience, let me know :-)

@Savjee
Copy link
Owner Author

Savjee commented Apr 18, 2020

Thanks for the suggestions.

I've just implemented your first suggestion in the dev branch and will push it live soon. I decided to handle it like this:

  • By default, the text color is used as icon color.
  • User can change icon_color with a HEX code or template
  • User can set icon_color to auto, in which case it will look at the state of the entity

Makes sense?
(Working on pressed/depressed state)

@domoson
Copy link

domoson commented Apr 20, 2020

Sounds like exactly what I envisioned :) This and the pressed/depressed update will be a game changer. Thanks a lot!

@MEKadan
Copy link

MEKadan commented Feb 24, 2022

Is there a solution for this already?

@Savjee
Copy link
Owner Author

Savjee commented Feb 25, 2022

@MEKadan No not yet. I was struggling a bit to make it work for both light and darkmode. Suggestions are welcome!

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

No branches or pull requests

3 participants