Text color not changing with card-mod

I am using card-mod to change the background of a card. The background color works just fine, but the problem is when my device goes into dark mode, the text turns white and is unreadable against the yellow background. I tried specifying a color black for the text but its not working.

card:
  type: custom:mushroom-template-card
  primary: Take Out the Trash!
  secondary: ''
  icon: mdi:trash-can
  icon_color: black
  tap_action:
    action: none
  hold_action:
    action: none
  double_tap_action:
    action: none
  card_mod:
    style: |
      ha-card {
        --ha-card-background: yellow;
        color: black;
      }