Temperature Colour State Changes - More than one colour - Card-Mod

Chaps

Sorry I’ve read around 10-15 threads on the same subject and I just can’t get this working

I want a temperature sensor text to change colour on the result
I can get this to work with two options, but not three options

THIS WORKS and goes red over 30 value

  - entity: sensor.zigbee_ihseno_temperature_sensor_solar_panel_temperature
    name: Temperature Solar Panel
    card_mod:
      style: |
        :host {
          color: {% if states('sensor.zigbee_ihseno_temperature_sensor_solar_panel_temperature') | int(0) > 30 %}red{% else %}blue{% endif %};
        }

If I then try to enter a third variable, I somehow need to introduce minimum and maximum values on the same line, but I just can’t get the syntax to work. Can someone help please

THIS ONLY PICKS UP THE FIRST OPTION; GREEN, Whatever the result

entities:
  - entity: sensor.template_sensor_temperature_solar_panel_outside_differemce
    card_mod:
      style: |
        :host {
         color:
           {% if states('sensor.template_sensor_temperature_solar_panel_outside_differemce') | int(0) > 10 %}green
           {% elif states(sensor.template_sensor_temperature_solar_panel_outside_differemce) | int(0) > 20 %}blue
           {% elif states(sensor.template_sensor_temperature_solar_panel_outside_differemce) | int(0) > 30 %}red
           {% endif %}
           ;
           }

Any help greatly appreciated.

Chaps

I figured it out more than by trial and error
I’m sure there is a smarter way of doing this, but for anyone who stumbles across this post

{% if states('sensor.template_sensor_temperature_solar_panel_outside_differemce') | float > 0 and states('sensor.template_sensor_temperature_solar_panel_outside_differemce') | float < 11 %}
green
{% elif states('sensor.template_sensor_temperature_solar_panel_outside_differemce') | float > 10 and states('sensor.template_sensor_temperature_solar_panel_outside_differemce') | float < 21 %}
orange
{% elif states('sensor.template_sensor_temperature_solar_panel_outside_differemce') | float > 20 and states('sensor.template_sensor_temperature_solar_panel_outside_differemce') | float < 59 %}
red
{% endif %}