Cannot figure out how to remove this card background with card_mod


Im’ trying to use a tailwindCSS card embedded in a grid card, to make a welcome message. I’ll admit I don’t have a great grasp on how card_mod operates, but I was able to make it work on other cards. I’ve tried everything I can think of with card_mod to remove the background from the left card. Tried it in the card config, and in the overall dashboard config. I’ve pasted my page yaml below.

views:
  - type: sections
    sections:
      - type: grid
        cards:
          - square: false
            type: grid
            cards:
              - type: custom:tailwindcss-template-card
                content: >
                  <div class="flex">
                    <div class="flex flex-col">
                      <div class=" text-5xl font-light">
                        Good {{states('sensor.time_of_day_description')}}, Palmer family.
                      </div>
                      <div class="text-5xl font-light">
                        {% set t = state_attr('weather.forecast_home', 'temperature') %} {% set fc =
                  state_attr('weather.forecast_home', 'forecast') %} {% set map
                  = {

                  'partlycloudy': 'partly cloudy', 'clear': 'clear', 'cloudy':
                  'cloudy', 'rainy':

                  'rainy' } %} {% set cond = states('weather.forecast_home') %}
                  {% set is_day =

                  is_state('sun.sun', 'above_horizon') %} {% set dn = 'day' if
                  is_day else 'night'

                  %} {% set icon = { 'sunny': 'clear-day', 'clear-night':
                  'clear-night',

                  'partlycloudy': 'partly-cloudy-' ~ dn, 'cloudy': 'cloudy',
                  'overcast':

                  'overcast', 'fog': 'fog-' ~ dn, 'mist': 'mist', 'haze':
                  'haze-' ~ dn, 'smoke':

                  'smoke', 'dust': 'dust-' ~ dn, 'windy': 'wind',
                  'windy-variant': 'wind',

                  'rainy': 'rain', 'pouring': 'rain', 'drizzle': 'drizzle',
                  'hail': 'hail',

                  'snowy': 'snow', 'snowy-rainy': 'sleet', 'lightning':
                  'thunderstorms-' ~ dn,

                  'lightning-rainy': 'thunderstorms-' ~ dn ~ '-rain',
                  'exceptional':

                  'not-available' }.get(cond, 'not-available') %} {% set w =

                  states('weather.forecast_home') %} 

                        It is {{ t | round(0) }}° and {{ map.get(states('weather.forecast_home'),
                        states('weather.forecast_home')) }}{% if fc and
                        fc[0].precipitation_probability | default(0) > 40 %}. It might rain
                        later.{% endif %}. 
                        <img
                        style="display: inline-block; height: 70px; width: auto"
                        src="/local/weather_icons/{{ icon }}.svg"
                      />
                      </div>
                      <div class="font-bold text-2xl">
                        {% set events = state_attr('calendar.family',
                  'events') %} {% set count = events | length if events else 0
                  %}
                        You have {{ 'no' if count == 0 else count }} event{{ '' if count == 1 else
                        's' }} today.
                      </div>
                    </div>
                  </div>
                ignore_line_breaks: true
                always_update: false
                parse_jinja: true
                code_editor: Ace
                entities: []
                bindings: []

Post a short code with you card-mod attempt to remove a background.

This is what should work. This works on other cards, but not a tailwindcss card, as I’m guessing there is some other thing overriding changes to shadowRoot with tailwindcss being injected too.

card_mod: 
  style: |
    ha-card {
      background: none;
    }

What version of card-mod do you use?

  1. Just installed it from HACS.

Try with classic 3.4.6 just in case.
4.x messed up with some custom cards.

3.4.6 - solid.

type: custom:tailwindcss-template-card
content: |
  <div>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam in quam semper, vestibulum velit ut, faucibus est. Suspendisse commodo, tortor et varius pretium, est tortor mollis mauris, in fringilla felis arcu quis lacus. Aenean placerat risus sed nulla egestas, quis pellentesque tortor ultrices. Cras vel sem eu libero commodo tempus. Pellentesque mi erat, mattis id lectus nec, ullamcorper porta sapien.
  </div>
card_mod:
  style: |
    ha-card {background: red;}

Can confirm that tailwind card is broken in card-mo 4.x.x. Thisis due to this card removing everything in its shadowRoot on render, hence breaking in 4.x.x as card-mod patching is at hui-card level not ha-card.

I have created issue - [Bug]: Cannot apply card-mod to custom:tailwindcss-template-card · Issue #592 · thomasloven/lovelace-card-mod · GitHub

Bizarre, I reinstalled from 3.4.6, and pasted in exactly the card_mod entry you have there, still not working. There must be something else messed up on my system

Make sure you purged a browser cache.
And remove a card-mod entry from dashboard resources (not needed until you need a “cast”)

Can you explain what you mean by “until you need a cast”?