Nerwyn/service-call-tile-feature

Sliders empty at zero value

Closed this issue · 1 comments

Is your feature request related to a problem? Please describe.
Hello, I am trying to use the custom slider feature to show battery percentage and some power consumption, and even if their value is zero, I can still see a little bit of slider colored.

Describe the solution you'd like
Could be possibile to set the minimum color filler at zero (empty)? maybe adding a new thumb tipe "none"
For this entityes I am not using the tap action (set to none), so is not necessary to have always some place to click on the slide.

image

Thank you

You can do this using CSS styles and templates.

{% if value == config.range[0] %}
input::-webkit-slider-thumb {
  visibility: hidden;
}
input::-moz-range-thumb {
  visibility: hidden;
}
{% endif %}

You may also want to reduce the slider thumb width to make the jump from the minimum range value to it's next step less jarring.

:host {
  --thumb-width: 4px;
}