enotbay

Bubble Card Collapsible Stack

Sep 9th, 2025
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.19 KB | Source Code | 0 0
  1. type: custom:mod-card
  2. card:
  3.   type: vertical-stack
  4.   cards:
  5.     - type: custom:bubble-card
  6.       card_type: button
  7.       button_type: switch
  8.       entity: sensor.lights_on_count
  9.       show_state: false
  10.       button_action: {}
  11.       sub_button:
  12.         - tap_action:
  13.             action: navigate
  14.             navigation_path: "#lights"
  15.           entity: sensor.lights_on_count
  16.           show_state: true
  17.           show_background: true
  18.           state_background: true
  19.     - type: conditional
  20.       conditions:
  21.         - condition: state
  22.           entity: binary_sensor.washing_machine_running
  23.           state: "off"
  24.       card:
  25.         type: custom:bubble-card
  26.         card_type: button
  27.         button_type: switch
  28.         entity: binary_sensor.washing_machine_running
  29.         icon: mdi:washing-machine
  30.         show_state: true
  31.         show_last_changed: true
  32.     - type: conditional
  33.       conditions:
  34.         - condition: state
  35.           entity: binary_sensor.dryer_running
  36.           state: "off"
  37.       card:
  38.         type: custom:bubble-card
  39.         card_type: button
  40.         button_type: switch
  41.         entity: binary_sensor.dryer_running
  42.         icon: mdi:tumble-dryer
  43.         show_state: true
  44.         show_last_changed: true
  45. grid_options:
  46.   columns: 24
  47.   rows: auto
  48. card_mod:
  49.   style:
  50.     hui-vertical-stack-card$: |
  51.      hui-card {
  52.         position: relative;
  53.         border-radius: 20px;
  54.         transition: all 0.3s ease;
  55.       }
  56.       /* Stacked (only when next card is visible) */
  57.       hui-card:not([hidden]) ~ hui-card:not([hidden]) {
  58.         margin-top: -45px;
  59.         box-shadow: 0 -5px 10px rgba(100,100,100,0.1);
  60.       }
  61.       /* Blur all but the last visible */
  62.       hui-card:has(~ hui-card:not([hidden])) {
  63.         filter: blur(0.6px);
  64.       }
  65.       /* The last/top visible card stays clear */
  66.       hui-card:not(:has(~ hui-card:not([hidden]))) {
  67.         filter: none;
  68.         background: var(--card-background-color);
  69.       }
  70.       /* On hover/active → unstack and clear ALL */
  71.       :host(:hover) hui-card,
  72.       :host(:active) hui-card {
  73.         margin-top: 0 !important;
  74.         box-shadow: none !important;
  75.         filter: none !important;
  76.       }
Advertisement
Add Comment
Please, Sign In to add comment