Advertisement
ninhvanthang

Custom button card style

Jan 3rd, 2025
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.46 KB | Source Code | 0 0
  1. type: custom:button-card
  2. entity: switch.kitchen_switch_2_2
  3. icon: mdi:vanity-light
  4. name: Đèn bàn ăn
  5. label: Bếp
  6. color: rgb(0,0,0)
  7. aspect_ratio: 1/1
  8. custom_fields:
  9.   switch: ""
  10.   switch_btn: ""
  11. tap_action:
  12.   action: toggle
  13. show_label: true
  14. size: 32px
  15. styles:
  16.   custom_fields:
  17.     switch:
  18.       - position: absolute
  19.       - top: 15px
  20.       - right: 15px
  21.       - width: 20px
  22.       - height: 12px
  23.       - border-radius: 10px
  24.       - background: rgba(255,255,255,0.3)
  25.       - z-index: 111
  26.     switch_btn:
  27.       - position: absolute
  28.       - top: 17px
  29.       - right: 25px
  30.       - width: 8px
  31.       - height: 8px
  32.       - border-radius: 10px
  33.       - background: rgba(255,255,255,0.6)
  34.       - z-index: 111
  35.       - transition: all 0.3s
  36.   card:
  37.     - font-size: 12px
  38.     - background-color: '#142a37'
  39.     - padding: 15px
  40.     - '--mdc-ripple-color': '#dcb213'
  41.     - '--mdc-ripple-press-opacity': 0.7
  42.   img_cell:
  43.     - justify-content: flex-start
  44.     - align-items: flex-start
  45.   icon:
  46.     - height: auto
  47.     - color: white
  48.   name:
  49.     - justify-self: start
  50.     - font-weight: bold
  51.   label:
  52.     - justify-self: start
  53. state:
  54.   - value: 'on'
  55.     color: '#0a1249'
  56.     styles:
  57.       card:
  58.         - background-color: '#dcb213'
  59.       name:
  60.         - color: white
  61.       label:
  62.         - color: white
  63.       custom_fields:
  64.         switch:
  65.           - background: '#0a1249'
  66.         switch_btn:
  67.           - right: 17px
  68.           - background: white
  69.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement