🔹 Card-mod - Super-charge your themes!

Appreciated the work here, but I am running into a few issues. With 0.116.4 I use this theme file to get this result:

But, with 0.117.1 (and using your latest code snippet above), it now looks like this:

Issues:

  • Sidebar header is really compressed on top
  • View container goes on behind the paper tabs bar
  • The top header in de main window has a very persistent 64px top padding that disappears with a hard refresh, but is back as soon as you change tabs once and go back to the previous tab.
Google Light Theme:
  # Card mod stuff
  card-mod-theme: Google Light Theme
  header-height: 0px # Change this to 0px for header on the bottom. You're 1/3 there.
  card-mod-root-yaml: |
    paper-tabs$: |
      /* Uncomment this for header on the bottom. You're 2/3 there. */
      #selectionBar {
        bottom: unset !important;
      }
    ha-app-layout$: |
      #contentContainer {
        padding-top: 0px;
      }
    .: |
      ha-tabs {
        height: var(--header-height);
      }
      app-header {
        --header-height: 48px;
      }
      /* This moves the header up. */
      app-header {
        transform: translate3d(0px, -48px, 0px);
      }
      /* Let's change the background. */
      app-header, app-toolbar {
        background: transparent !important;
        color: #A9A9A9 !important;
      }
      /* We're still going to need a way to see that we're in edit mode. */
      app-header.edit-mode {
        padding-bottom: calc(var(--ha-card-border-width, 2px) * 2);
        border-bottom: var(--ha-card-border-width, 2px) solid var(--primary-color);
      }
      /* This changes the color of the currently selected tab. */
      ha-tabs {
        --paper-tabs-selection-bar-color: #D2691E !important;
      }
      paper-tab[aria-selected=true] > ha-icon {
        color: #FF8C00 !important;
      }
      paper-tab[aria-selected=true] {
        color: #D2691E !important;
      }
      /* This hides the help button. */
      a.menu-link[target="_blank"] {
        display: none;
      }
      /* This makes the plus color the same as the background. */
      #add-view {
        color: var(--primary-background-color);
      }
      /* This hides the title. */
      [main-title] {
        display: none;
      }
      /* This hides the app-toolbar in edit mode. */
      app-toolbar.edit-mode {
        height: 0;
      }
      /* This moves the edit mode buttons back in. */
      app-toolbar.edit-mode > mwc-icon-button {
        position: absolute;
        left: 0;
        top: 0;
        z-index: 1;
      }
      app-toolbar.edit-mode > ha-button-menu {
        position: absolute;
        right: 0;
        top: 0;
        z-index: 1;
      }
      /* This adds a bit more padding, mainly for unused entities. */
      app-header.edit-mode > div {
        padding-left: 5px;
      }
      /* Uncomment this for header on the bottom. You're 3/3 there. */
      app-header {
        top: calc(100vh - 60px) !important;
        bottom: 0 !important;
        transform: unset !important;
      }
#and everything of the original theme

Hi,

NowI have this. Modified what I can. Only one thing what I don’t know how to solve.

#
# iOS Dark Mode Theme
#

  # This is MIT license because why not
# Hey there! Thanks for helping out in my Teletype!
# Things to do:
# Let's add a bottom padding to the edit mode header. ✅
# Let's hide the main title. ✅
# Let's make the plus color the same as the background. ✅
# Let's hide the help button. ✅
# Let's change the color of selected tabs. ✅
# Let's set the app-toolbar height to 0 in edit mode. ✅
# Let's move the buttons down in edit mode. ✅
ios-dark-mode:
  card-mod-theme: ios-dark-mode
  header-height: 48px
  card-mod-root-yaml: |
    ha-tabs$: |
    .: |
      /* Styles for not mobile */
      @media (orientation: landscape) {
        ha-tabs::after {
          font-size: 20px;
          content: "{{ states('sensor.date') }} {{ states('sensor.date_hu') }}, {{ state_attr('calendar.magyar_nevnapok', 'message') }} névnap, {{ states('sensor.time') }}";
          text-transform: none;
          white-space: pre;
        }
      }
      /* Let's get going! */
      /* We still need this, because we need to compact edit mode. */
      app-header {
        transform: translate3d(0px, -48px, 0px);
      }
      /* Let's change the background. */
      app-header, app-toolbar {
        background: url('/local/homekit-bg-4.jpeg') !important;
        color: var(--primary-text-color) !important;
      }
      /* We're still going to need a way to see that we're in edit mode. */
      app-header.edit-mode {
        padding-bottom: calc(var(--ha-card-border-width, 2px) * 2);
        border-bottom: var(--ha-card-border-width, 2px) solid var(--primary-color);
      }
      /* This changes the color of the currently selected tab. */
      ha-tabs {
        --paper-tabs-selection-bar-color: var(--primary-color) !important;
      }
      paper-tab[aria-selected=true] {
        color: var(--primary-color) !important;
      }
      /* This hides the help button. */
      a.menu-link[target="_blank"] {
        display: none;
      }
      /* This makes the plus color the same as the background. */
      #add-view {
        color: var(--primary-background-color);
      }
      /* This hides the title. */
      [main-title] {
        display: none;
      }
      /* This hides the app-toolbar in edit mode. */
      app-toolbar.edit-mode {
        height: 0;
      }
      ha-button-menu {
        right: -25px !important;
        color: rgb(74, 27, 43);
      /* This moves the edit mode buttons back in. */
      app-toolbar.edit-mode > mwc-icon-button {
        position: absolute;
        left: 0;
        top: 0;
        z-index: 1;
      }
      app-toolbar.edit-mode > ha-button-menu {
        position: absolute;
        right: 0;
        top: 0;
        z-index: 1;
      }
      /* This adds a bit more padding, mainly for unused entities. */
      app-header.edit-mode > div {
        padding-left: 5px;
      }
      
  # Global
  background-image: 'center / cover no-repeat fixed url("/local/homekit-bg-4.jpeg")'
  primary-color: "#FF9F09"  # from Apple systemOrange dark mode
  light-primary-color: "#B6B6C1"  # light gray (icons on left menu)
  primary-background-color: "#2c2c2e"  # systemGray5 dark mode
  secondary-background-color: rgba(25, 25, 25, 0.7)
  divider-color: "#98989d"  # from Apple systemGray dark mode
  accent-color: rgba(255, 159, 9, 1)
  # Text
  primary-font-family: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif"
  paper-font-common-base_-_font-family: "var(--primary-font-family)"
  paper-font-common-code_-_font-family: "var(--primary-font-family)"
  paper-font-body1_-_font-family: "var(--primary-font-family)"
  paper-font-subhead_-_font-family: "var(--primary-font-family)"
  paper-font-headline_-_font-family: "var(--primary-font-family)"
  paper-font-caption_-_font-family: "var(--primary-font-family)"
  paper-font-title_-_font-family: "var(--primary-font-family)"
  primary-text-color: "#FFF"
  secondary-text-color: "#d3d3d3"
  text-primary-color: "#FFF"
  disabled-text-color: "#555"  # XXX: https://github.com/basnijholt/lovelace-ios-dark-mode-theme/issues/2
  text-dark-color: "#FFF"
  # Sidebar Menu
  sidebar-background-color: var(--primary-background-color)
  sidebar-icon-color: var(--light-primary-color)
  sidebar-text-color: "#F1F1F1"
  sidebar-selected-background-color: var(--primary-background-color)
  sidebar-selected-icon-color: "#FFF"
  sidebar-selected-text-color: var(--sidebar-selected-icon-color)
  # States and Badges
  state-icon-color: "#FFF"
  state-icon-active-color: rgba(255, 214, 10, 1)
  paper-item-icon-active-color: rgba(255, 214, 10, 1)
  state-icon-unavailable-color: var(--disabled-text-color)
  # Sliders
  paper-slider-knob-color: "#FFF"
  paper-slider-knob-start-color: var(--paper-slider-knob-color)
  paper-slider-pin-color: var(--paper-slider-knob-color)
  paper-slider-active-color: "#0984ff"  # from Apple systemBlue dark mode
  paper-slider-secondary-color: var(--paper-slider-knob-color)
  paper-slider-container-color: rgba(255, 255, 255, 0.5)
  paper-slider-font-color: "#000"
  ha-slider-background: none !important
  # Labels
  label-badge-background-color: "#23232E"
  label-badge-text-color: "#F1F1F1"
  label-badge-red: rgba(255, 159, 9, 0.7)  # from Apple systemOrange dark mode
  # Cards
  card-background-color: var(--secondary-background-color)  # Unused entities table background
  paper-listbox-background-color: var(--primary-background-color)
  ha-card-border-radius: 20px
  ha-card-background: rgba(10, 10, 10, 0.4)
  paper-card-background-color: var(--ha-card-background)
  code-editor-background-color: var(--disabled-text-color)
  # Toggles
  paper-toggle-button-checked-button-color: "#484848"
  paper-toggle-button-checked-bar-color: "#484848"
  paper-toggle-button-unchecked-button-color: var(--paper-toggle-button-checked-button-color)
  paper-toggle-button-unchecked-bar-color: var(--disabled-text-color)
  # Table row
  table-row-background-color: var(--primary-background-color)
  table-row-alternative-background-color: var(--secondary-background-color)
  # Switches
  switch-checked-color: "#30d257"  # XXX: remove when https://github.com/home-assistant/home-assistant-polymer/pull/4203 is in HA
  switch-checked-track-color: "#30d158"  # from Apple systemGreen dark mode
  switch-checked-button-color: "#FFF"
  # Other
  paper-dialog-background-color: rgba(55, 55, 55, 0.8)  # e.g., background of more-info
  paper-item-icon-color: white  # also should mini-media-player icon white (but doesn't work by itself)
  more-info-header-background: rgba(25, 25, 25, 0.5)
  lumo-body-text-color: var(--primary-text-color)  # see https://github.com/basnijholt/lovelace-ios-dark-mode-theme/issues/42
  app-header-background-color: rgba(155, 155, 155, 0.8)
  markdown-code-background-color: "#464646"
  # Custom
  mcg-title-letter-spacing: .15em
  mini-media-player-base-color: white
  mini-media-player-icon-color: white
  # mini-media-player-artwork-opacity: 0.7  # causing some bug


Need the time and date close to the right. Not need that unused space.

1 Like

Do you still need a edit mode button?

Edit mode 3 dot is there close to the right but changed the color and not see.

ha-button-menu {
        right: -25px !important;
        color: rgb(74, 27, 43);

I need that yes. But dont need that unused space on red circle. Before 117 update it is working good with this I think:

/* This leaves space for the buttons on the right of the tabs bar.
         Change 112px to 56px if you don't use voice icon. */
      paper-tabs {
          margin-right: 20px !important;

But now it is not working.

So do I need to have to put this in the wiki?
paper-tabs
ha-tabs

Ok, I change it and nothing happend:

/* This leaves space for the buttons on the right of the tabs bar.
         Change 112px to 56px if you don't use voice icon. */
      ha-tabs {
          margin-right: 20px !important;
      }

Try

position: absolute;
left: 0;
right: 20px;

This is change now but too much. The time last character disappered.

Can you send a screenshot? You can increase the right variable if needed.

With this setup:

/* This leaves space for the buttons on the right of the tabs bar.
         Change 112px to 56px if you don't use voice icon. */
      ha-tabs {
          position: absolute;
          left: 0;
          right: 5px;
      }

The 3 dot now on the left side.

Prior to 0.117 this:

  card-mod-card: |
    ha-card.top-level-card div.card-header {
      padding-top: 0px;
      padding-bottom: 28px;
    }

Used to shift the card names up to be in line with my other cards. Now it has no effect. Can anyone see why?

Was changed from div to h1

1 Like

Thanks Kendell. I couldn’t see the forest for the trees. I was looking at the class not the div/h1

I was ultimately able to solve this myself (by trial and error, not wisdom). This does all I need:

  # Card mod stuff
  card-mod-theme: Google Light Theme
  header-height: 48px 
  card-mod-root-yaml: |
    ha-app-layout$: |
      #contentContainer {
        padding-top: 0px !important;
        padding-bottom: 48px !important;
      }
    .: |
      ha-tabs {
        height: var(--header-height);
        --paper-tabs-selection-bar-color: var(--primary-color) !important;
        color: var(--app-header-text-color) !important;
      }
      paper-tab[aria-selected=true] > ha-icon, paper-tab[aria-selected=true] {
        color: var(--primary-color) !important;
      }
      /* This hides the help button, menu button and title */
      a.menu-link[target="_blank"], ha-button-menu, [main-title] {
        display: none;
      }
      app-header {
        top: calc(100vh - 48px) !important;
        bottom: 0 !important;
        transform: unset !important;
      }
  # End card-mod, back to the original theme:
1 Like

It is possible to hide the hamburger and The 3 dots?

Yes, it is. display: none; ha-menu-button ha-button-menu

Thank you Kendall!
The 3 dots hide, but the sidebar toggle no.

  card-mod-theme: slate
  header-height: 48px
  card-mod-root-yaml: |
    ha-app-layout$: |
      #contentContainer {
        padding-top: 0px !important;
        padding-bottom: 48px !important;
      }
    .: |
      ha-tabs {
        height: var(--header-height);
        --paper-tabs-selection-bar-color: var(--button-card-background-color-on) !important;
        color: var(--app-header-text-color) !important;
      }
      paper-tab[aria-selected=true] > ha-icon, paper-tab[aria-selected=true] {
        color: var(--button-card-background-color-on) !important;
      }
      /* This hides the help button, menu button and title */
      a.menu-link[target="_blank"], ha-button-menu, [main-title] {
        display: none;
      }
      ha-menu-button {
        display: none;
      }

      app-header {
        top: calc(100vh - 65px) !important;
        bottom: 0 !important;
        transform: unset !important;
      }

Can you put your full theme file for testing? Also sorry for your spellcheck kendallkendell

Sorry Kendell :relaxed:
I will give a coffee or a beer for this!

My theme is here

---
#------------------------------------------------------------
# Slate
#------------------------------------------------------------
slate:
  # Main colors
  primary-color: "#3E80B0"
  accent-color: "#ff0000"
  dark-primary-color: "#e0e1e1"
  light-primary-color: "#e0e1e1"
  # Text colors
  primary-text-color: "#e0e1e1"
  text-primary-color: "var(--primary-text-color)"
  secondary-text-color: "rgba(224, 225, 225, 0.3)"
  disabled-text-color: "#777777"
  label-badge-border-color: "green"
  # Sidebar
  sidebar-icon-color: "#9e9e9e"
  # Background colors
  primary-background-color: "#222627"
  secondary-background-color: "#434b4d"
  divider-color: "rgba(0, 0, 0, .12)"
  table-row-background-color: "#292929"
  table-row-alternative-background-color: "#292929"
  # Nav Menu
  paper-listbox-color: "#777777"
  paper-listbox-background-color: "#222627"
  paper-grey-50: "var(--primary-text-color)"
  paper-grey-200: "#222222"
  # Paper card
  paper-card-header-color: "#252b2d"
  paper-card-background-color: "#222627"
  paper-dialog-background-color: "#2d3538"
  paper-item-icon-color: "#9da0a2"
  paper-item-icon-active-color: "#3182b7"
  paper-item-icon_-_color: "green"
  paper-item-selected_-_background-color: "#ff0000"
  paper-tabs-selection-bar-color: "green"
  # Labels
  label-badge-red: "var(--primary-color)"
  label-badge-text-color: "var(--primary-text-color)"
  label-badge-background-color: "#222222"
  # Switches update
  switch-checked-color: "#7a7d7f"
  switch-unchecked-button-color: "#3b4041"
  switch-unchecked-track-color: "#0c0d0d"
  # paper-toggle-button-checked-bar-color: '#009FFF'
  # Sliders
  paper-slider-knob-color: "#a4abb1"
  paper-slider-knob-start-color: "#a4abb1"
  paper-slider-pin-color: "#626a6f"
  paper-slider-active-color: "#626a6f"
  paper-slider-container-color: "#202020"
  paper-slider-secondary-color: "var(--secondary-background-color)"
  paper-slider-disabled-active-color: "var(--disabled-text-color)"
  paper-slider-disabled-secondary-color: "var(--disabled-text-color)"
  #paper-slider-height: '3px'
  # Google colors
  google-red-500: "#bf3838"
  google-green-500: "#5b8d47"
  # Changes to fix history/logbook menus
  lumo-primary-text-color: "#2980b9"
  lumo-secondary-text-color: "#2980b9"
  lumo-primary-color: "#2980b9"
  # Calendar day numbers
  lumo-body-text-color: "#e0e1e1"
  # Calendar/Date-Picker Background
  lumo-base-color: "#222222"
  # Month/Year header
  lumo-header-text-color: "var(--lumo-body-text-color)"
  # DayOfWeek Header
  lumo-tertiary-text-color: "var(--lumo-body-text-color)"
  lumo-shade: "#222222"
  lumo-shade-90pct: "rgba(34, 34, 34, .9)"
  lumo-shade-80pct: "rgba(34, 34, 34, .8)"
  lumo-shade-70pct: "rgba(34, 34, 34, .7)"
  lumo-shade-60pct: "rgba(34, 34, 34, .6)"
  lumo-shade-50pct: "rgba(34, 34, 34, .5)"
  lumo-shade-40pct: "rgba(34, 34, 34, .4)"
  lumo-shade-30pct: "rgba(34, 34, 34, .3)"
  lumo-shade-20pct: "rgba(34, 34, 34, .2)"
  lumo-shade-10pct: "rgba(34, 34, 34, .1)"
  lumo-shade-5pct: "rgba(34, 34, 34, .05)"
  lumo-tint-5pct: "#222222"
  # fix for device configuration screen
  card-background-color: "var(--paper-card-background-color)"

  # Cards
  ha-card-border-radius: "5px"
  #ha-card-box-shadow: None

  # Button Card
  button-card-icon-color-on: "#2c688d"
  button-card-name-color-on: rgba(37,37,37,0.8)
  button-card-state-color-on: rgba(37,37,37,0.8)
  button-card-lock-color-on: rgba(37,37,37,1)
  button-card-label-color-on: rgba(37,37,37,1)
  button-card-background-color-on: rgba(245, 245, 245, 0.96)

  button-card-icon-color-off: "#969696"
  button-card-name-color-off: rgba(150,150,150,0.8)
  button-card-state-color-off: rgba(150,150,150,0.8)
  button-card-lock-color-off: rgba(150,150,150,0.8)
  button-card-label-color-off: rgba(150,150,150,0.8)
  button-card-background-color-off: rgba(255, 255, 255, 0.14)

  scene-card-icon-color: "#969696"
  scene-card-name-color: rgba(150,150,150,0.8)
  scene-card-state-color: rgba(150,150,150,0.8)
  scene-card-lock-color: rgba(150,150,150,0.8)
  scene-card-label-color: rgba(150,150,150,0.8)
  scene-card-background-color: rgba(255, 255, 255, 0.08)

  # Graph Card
  graph-card-line-color: "#ec9600"

  # Markdown
  markdown-title-color: rgba(192,192,192,1)
  markdown-text-color: rgba(192,192,192,1)

  card-mod-theme: slate
  header-height: 48px
  card-mod-root-yaml: |
    ha-app-layout$: |
      #contentContainer {
        padding-top: 0px !important;
        padding-bottom: 48px !important;
      }
    .: |
      ha-tabs {
        height: var(--header-height);
        --paper-tabs-selection-bar-color: var(--button-card-background-color-on) !important;
        color: var(--app-header-text-color) !important;
      }
      paper-tab[aria-selected=true] > ha-icon, paper-tab[aria-selected=true] {
        color: var(--button-card-background-color-on) !important;
      }
      /* This hides the help button, menu button and title */
      a.menu-link[target="_blank"], ha-button-menu, [main-title] {
        display: none;
      }
      ha-menu-button {
        display: none;
      }

      app-header {
        top: calc(100vh - 65px) !important;
        bottom: 0 !important;
        transform: unset !important;
      }

display: none !important.