Magic Mirror - Theme, Styling Help

Hello all, Merry Christmas…

I’d like a card / cards (guessing this is going to need to be custom made), that will reveal lines 1 by 1. Each line would fade from 0 - 100, and slightly shift downward as it fades in.
For each line, I’d like to be able to list a friendly name, and in some cases a state. EG: “80% Phone Battery”. As the states of items affect it’s visibility, when additional lines need to show or hide, this would animated in / out in the same way.

This will be for a non interactive ‘Magic Mirror’ dashboard…

Where I’m at:

  • I have worked out what I want to show and when.
  • I’m created a visual UX design and this is being tweaked as I see what does and does not work.
  • I’ve got the information showing on a dashboard, when desired.
  • I’ve got most of the hardware ready (acrylic 2 way mirror, bright tablet, wooden frame).

What I need to do:

  • Help with implementing theme / card styles / layout / animation. Pointers are also great, but I am probably not as techy as a lot of you and while I can get my head around basic code, also struggle with basic code.
  • Find something like the HA Tile card that will make it easier for me to style my lozenge cards.
  • Create or find a weather card that will show the weather now, and at 18:00 this day.
  • Create or find an entity that can provide the likelihood of precipitation today.

Design Principles:

  • This is not touchscreen. The relevant information should surface itself without interaction.
  • Keep it simple. Everything must justified itself. (The mirror is next to my front door, so only information that is useful there).
  • Bold bright colours as it needs to shine through the reflections.
  • Focus on the basics working well.

Thankyou in advance for any assistance.


Examples of where it’s at:


Mockup of what I’d like to animation to feel like.


Mockup of what I’d like to achieve.


The mirror I will be adapting.



Test of info showing through actual acrylic (I’ll use black vinyl or something to stop the edge of the screen being visible.


Acrylic two way mirror, that will replace the current mirror in the earlier picture

1 Like

So I’m trying to get the styling working for my list of items to show. I’m struggling with the CSS a bit. Despite not needing a button I’ve gone with the Custom Button Card as feel it offers a lot of flexibility, but am struggling to get things aligned as I’d like:

This is where I’d like to get to (visual mockup):
image

This is where I’m at (produced by below code):
image

I can’t seem to get the text to all push up to the left. I know this is basic CSS, but can’t seem to get my head around it.

The code is rather repetitive, but before I trying an improve that, just wanted to get something that was matching my design.

Any help very much appreciated.

type: custom:button-card
name: Mirror
entity: sensor.mirror_battery_level
show_icon: false
show_state: true
show_label: true
label: .
custom_fields:
  charging: |
    [[[
      var charging = states['binary_sensor.mirror_is_charging'].state

      return `${charging}`
    ]]]
styles:
  grid:
    - grid-template-areas: "\"l s n charging\""
    - grid-template-rows: min-content
    - grid-template-columns: min-content
  card:
    - padding: 0px
    - background: black
  name:
    - justify-self: start
    - align-self: start
    - text-align: left
    - font-size: 32px
    - font-weight: 800
    - color: red
    - padding: 0px
  state:
    - justify-self: end
    - align-self: end
    - text-align: left
    - font-size: 32px
    - font-weight: 800
    - color: red
    - padding: 0px
  label:
    - justify-self: end
    - align-self: end
    - text-align: left
    - font-size: 32px
    - font-weight: 800
    - color: red
    - padding: 0px
  custom_fields:
    charging:
      - justify-self: start
      - align-self: end
      - text-align: left
      - font-size: 32px
      - font-weight: 800
      - color: red
      - padding: 0px

Ok, so I’m getting there. Gradually…

I’ve got my custom button card showing what I want:

image

I’m now trying to write a theme with the help of Gemini, but it’s not quite getting me where I need to be:

magic_mirror:
  # Base colors
  primary-color: "#FF0000" # Adjust as needed
  accent-color: "#FF0000" # Adjust as needed

  # Text styles
  text-primary-color: "#FF000000 !important"
  text-primary-font-family: sans-serif !important"
  text-primary-font-size: 64px !important"
  text-primary-font-weight: 1000 !important"

  # Button-card specific styles
  button-card-text-color: "#FF0000"
  button-card-font-family: sans-serif
  button-card-font-size: 64px
  button-card-font-weight: 1000

  # Button-card specific styles (correct prefix)
  custom-button-card-text-color: "#FF0000"
  custom-button-card-font-family: sans-serif
  custom-button-card-font-size: 64px
  custom-button-card-font-weight: 1000

  ha-card span.name:
    color: "#FF0000 !important"
    font-family: sans-serif !important"
    font-size: 64px !important"
    font-weight: 1000 !important"

  # Card backgrounds
  card-background-color: "#000000"

  # Other elements (customize as you like)
  app-header-background-color: "#000000"
  app-header-text-color: "#FF0000"
  sidebar-background-color: "#000000"
  sidebar-text-color: "#FF0000"
  paper-listbox-background-color: "#000000"
  paper-item-icon-color: "#FF0000"

  # Remove padding (if needed, be specific with selectors)
  paper-card-inner-padding: 0px
  ha-card-padding: 0px

  # This is the important part!
  body-background-color: "#00ff00"

It seems to be this part that is causing the issue:

  ha-card span.name:
    color: "#FF000000 !important"
    font-family: sans-serif !important"
    font-size: 64px !important"
    font-weight: 1000 !important"

I’m adding this in as the styles are not applying to the custom button card for the most part.

I feel it maybe the indentation that is not valid?