Align Sub buttons of several button cards #1185
-
GoalHi, Source Yamltype: vertical-stack
cards:
- type: custom:bubble-card
card_type: pop-up
hash: "#pihole"
name: Pi-hole
icon: mdi:pi-hole
width_desktop: 600px
show_state: false
button_type: state
entity: binary_sensor.pi_hole_status
show_attribute: false
attribute: friendly_name
sub_button:
- entity: binary_sensor.pi_hole_status
state_background: false
show_name: false
show_state: true
show_attribute: false
tap_action:
action: call-service
target: {}
service: pi_hole.disable
- entity: binary_sensor.pi_hole_status
state_background: false
icon: mdi:timer-10
name: aus
show_name: true
tap_action:
action: perform-action
perform_action: pi_hole.disable
target: {}
data:
duration: 10s
show_name: true
- type: custom:bubble-card
card_type: button
button_type: state
name: DNS Blockierung
icon: mdi:shield-check
entity: switch.pi_hole
show_state: true
show_name: true
styles: |-
.bubble-sub-button-container {
padding-right: 40px !important;
}
sub_button:
- entity: sensor.pi_hole_werbungen_heute_blockiert
name: Blockiert
show_state: true
show_icon: true
icon: mdi:block-helper
show_name: false
state_background: false
- entity: sensor.pi_hole_werbungsanteil_heute_blockiert
name: Blockrate
show_state: true
show_icon: true
icon: mdi:percent
state_background: false
card_layout: large-2-rows
- type: custom:bubble-card
card_type: button
button_type: state
name: DNS Anfragen
icon: mdi:dns
entity: sensor.pi_hole_dns_abfragen_heute
show_state: true
show_name: true
sub_button:
- entity: sensor.pi_hole_dns_abfragen_weitergeleitet
name: Weitergeleitet
show_state: true
show_icon: true
icon: mdi:arrow-right
state_background: false
- entity: sensor.pi_hole_dns_abfragen_zwischengespeichert
name: Cache
show_state: true
show_icon: true
icon: mdi:database
state_background: false
styles: |-
.bubble-sub-button-container {
padding-right: 40px !important;
}
card_layout: large-2-rows
- type: custom:bubble-card
card_type: button
button_type: state
name: Clients
icon: mdi:account-group
entity: sensor.pi_hole_eindeutige_dns_clients
show_state: true
show_name: true
sub_button:
- entity: sensor.pi_hole_eindeutige_dns_domains
name: Domains
show_state: true
show_icon: true
icon: mdi:web
show_name: false
state_background: false
- entity: sensor.pi_hole_blockierte_domains
name: Blockliste
show_state: true
show_icon: true
icon: mdi:playlist-remove
state_background: false
show_name: false
card_layout: large-2-rows
styles: |-
.bubble-sub-button-container {
padding-right: 40px !important;
} Which step did you already try?This one moves the sub buttons but seems dependent on the name of the container.
.bubble-sub-button-container {
padding-right: 40px !important;
}
This also works, but then I have to manually figure out px per px until it fits.
Also if you have a changing value in the container, like I have in one card with the weather, it moves the buttons when the text of the container changes.
.bubble-sub-button-1 {
transform: translate(-20px) !important; /* Verschiebt den ersten Sub-Button */
}
.bubble-sub-button-2 {
transform: translate(-20px) !important; /* Verschiebt den zweiten Sub-Button */
}
ProblemThe problem is always that I have to manually move every single sub-button. How can I solve this? Thanks and regards Read the documentation
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
With this modification, applied to each Bubble Card, you align all the sub-buttons.
If this solves your problem, mark this as solved and close the discussion. |
Beta Was this translation helpful? Give feedback.
-
On a card with more then 2 sub buttons. How can I additionally control the space between 1,2 and 3,4 while having the overall fixed position from left? |
Beta Was this translation helpful? Give feedback.
With this modification, applied to each Bubble Card, you align all the sub-buttons.
If this solves your problem, mark this as solved and close the discussion.