Custom Card-mod help with weather-forecast

Hey.
After update from 0.105.4 to 0.106.5 my style for weather isnt working.

Code:

Copy to clipboard

- card:
    entity: weather.smhi_home
    type: weather-forecast
  style: |
    ha-card {
      --ha-card-background: rgba(50,50,50,0.0);
      background-repeat: no-repeat;
      background-size: 100% 100%;
      border: solid 2px rgba(100,100,100,0.5);
      border-radius: 20px;
      box-shadow: 3px 3px rgba(0,0,0,0.4);
      --primary-text-color: #999999;
      overflow: hidden;
    }
  type: 'custom:mod-card'

Error message: Cannot assign to read only property β€˜style’ of object β€˜#’

Whats wrong? Help please!

The colour value needs to be in quotes:

--primary-text-color: '#999999';

didnt work

I can remove that line completly and still the same error.

This is working for me in 0.106.5, no need for type: 'custom:mod-card':

path: test_dev
title: Test dev

cards:
  - type: weather-forecast
    entity: weather.neuilly_plaisance
    style: |
      ha-card {
        --ha-card-background: rgba(50,50,50,0.0);
        background-repeat: no-repeat;
        background-size: 100% 100%;
        border: solid 2px rgba(100,100,100,0.5);
        border-radius: 20px;
        box-shadow: 3px 3px rgba(0,0,0,0.4);
        --primary-text-color: #999999;
        overflow: hidden;
      }

weather_mod

2 Likes

Thanks olijouve!

Works!