Changement couleur text Card-Mod

Bonjour,

J’ai rendu mes cards légérement transparent avec Card-Mod.

Du coup le texte des valeurs n’est plus suffisamment lisible

J’aimerai changé la couleur de texte de mes Cards en blanc,

voici le code utilisé d’une de mes card pour essayé de la changer.

card_mod:
  style: |
    ha-card {
      color: white;
      background-color: rgba(10,10,10,0.8);
      box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) );
    }

Voici une capture d’écran pour comprendre pourquoi changer la couleur

merci

Salut…
Quelle est la question ? Quel est le problème ?

Hello,

Sans code et sans savoir quel type de card tu utilises, c’est d’autant plus compliqué.

Partage nous ton code complet, ce sera plus simple.

En résumé, j’ai rendu mes cards légèrement transparent avec card-mod, du coup les valeurs ne sont plus lisible.

J’aimerai changé le texte de valeurs en Blanc par exemple

Voici le code d’une de mes cards

square: true
columns: 7
type: grid
cards:
  - type: custom:mushroom-light-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: light.shelly_plus_1_cuisine
    tap_action:
      action: toggle
    fill_container: true
    use_light_color: false
    name: Cuisine
    layout: vertical
  - type: custom:mushroom-light-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: light.shelly_plus_1_salon
    tap_action:
      action: toggle
    fill_container: true
    name: Salon
    layout: vertical
  - type: custom:mushroom-light-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: light.shelly_plus_1_sejour
    tap_action:
      action: toggle
    name: Séjour
    fill_container: true
    layout: vertical
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.shelly_shellyplus1_441793aa8310
    tap_action:
      action: toggle
    name: Prise PC
    fill_container: true
    layout: vertical
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.shelly_shellyplus1_441793aa958c
    tap_action:
      action: toggle
    name: Chargeur
    fill_container: true
    layout: vertical
    icon: ''
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.shelly_shellyplus1_441793aa2e64
    icon: mdi:bell-ring
    tap_action:
      action: toggle
    name: Sonnette
    fill_container: true
    layout: vertical
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.meross_etage_outlet
    tap_action:
      action: toggle
    fill_container: true
    layout: vertical
    name: Étage
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.smart_switch_21012152451866290d3348e1e947b528_outlet_4
    tap_action:
      action: toggle
    fill_container: true
    layout: vertical
    name: TV
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.smart_switch_21012152451866290d3348e1e947b528_outlet_5
    tap_action:
      action: toggle
    fill_container: true
    layout: vertical
    name: Denon
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.smart_switch_21012152451866290d3348e1e947b528_outlet_3
    tap_action:
      action: toggle
    fill_container: true
    layout: vertical
    name: Sub
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.smart_switch_21012152451866290d3348e1e947b528_outlet_2
    tap_action:
      action: toggle
    fill_container: true
    layout: vertical
    name: Led TV
    icon_color: orange
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.smart_switch_21012152451866290d3348e1e947b528_outlet_6
    tap_action:
      action: toggle
    fill_container: true
    layout: vertical
    name: USB
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.chauffage_hall_outlet
    tap_action:
      action: toggle
    fill_container: true
    layout: vertical
    icon: mdi:heat-wave
    name: Chauffage Hall
    icon_color: red
  - type: custom:mushroom-entity-card
    card_mod:
      style: |
        ha-card {
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }
    entity: switch.smart_switch_21012152451866290d3348e1e947b528_outlet
    tap_action:
      action: toggle
    fill_container: true
    layout: vertical
    name: Multiprise TV
    icon: ''
    icon_color: green

Et le thème mushroom-light-card n’a pas une version dark ?

Essaye de voir si custom:mushroom-light-card peut être remplacé par custom:mushroom-dark-card

Cela pourrait remplacer la couleur de ton texte en blanc

Essaye

    card_mod:
      style: |
        ha-card {
          color: white;
          background-color: rgba(10,10,10,0.8);
          box-shadow: var( --ha-card-box-shadow, 0px 2px 1px -1px rgba(255, 255, 255, 0.2), 0px 1px 1px 0px rgba(255, 255, 255, 0.14), 0px 1px 3px 0px rgba(255, 255, 255, 0.12) ); 
        }

:interrobang:
je suis mal réveiller ou c’est le même code ?

avec rgba et augmente l’opacité (1.2) si c’est pas assez.

card_mod:
  style: |
    ha-card {
      color: rgba(255,255,255,1.2);
      ...
1 « J'aime »

C’est bien le même effectivement (j’ai besoin d’un café)

1 « J'aime »

Merci mais cela ne change rien

card_mod:
  style: |
    ha-card {
      color: rgba(255,255,255,1.8) !important;
      ...

Peu être comme ca ?

non plus, rien ne change et oui je met bien le ;

Accessoirement en faisant un thème mushroom custom 1 fois plutôt que un card-mod à la main dans chaque élément de carte, ça simplifierai aussi le quotidien

Pas tous compris mais c’st une card Mushroom

Dans mushroom, tu as des cartes ET des thèmes que tu peux appliquer sur ces cartes.

En passant par ça, tu évite de faire la modification à la main dans le code yaml

Je viens de tester avec ta card et ton code, j’ai juste changé le capteur et le nom et à mon avis, c’est ton thème qui pose problème. Car avec mon thème perso c’est good

image

1 « J'aime »

mon theme ?? , c’est celui par defaut, juste un Jpg en fond et carte transluside

Je viens d’installé Mushroom Theme, et ensuite ?

Je viens d’installé Mushroom Theme, et ensuite ?

Je n’ai rien en plus

Bah en thème par défaut…

en clair

en sombre

Donc en gros, tu veux faire du sombre en réglage clair

Donc cela vient bien de ton réglage du thème

Oui, il est en clair et il faut qu’il passe en sombre :wink: