Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to align row label? #185

Open
magune opened this issue Jul 18, 2024 · 1 comment
Open

How to align row label? #185

magune opened this issue Jul 18, 2024 · 1 comment

Comments

@magune
Copy link

magune commented Jul 18, 2024

I have spent several hours trying to get a number of rows, where each row starts with the room name and to the right there are some buttons to control scene in that room.

But I cannot figure out how to make the leftmost column having a fixed size with left-aligned text, to make all rows having the same layout:

image

Right now the code looks like this, but I have tried many versions that also didnt work:

          - type: entities
            entities:
              - type: "custom:paper-buttons-row"                    
                buttons:
                  - name: Hela lägenheten
                    icon: false
                    styles:
                      name:
                        justify-self: flex-start 
                  - entity: script.allmana_rum_mysbelysning
                    name: false
                    icon: mdi:lightbulb-on-10   

                  - entity: script.allmana_rum_mysbelysning
                    name: false                      
                    icon: mdi:lightbulb-on-50
                  - entity: script.allmana_rum_mysbelysning
                    name: false                      
                    icon: mdi:lightbulb-off-outline
              - type: "custom:paper-buttons-row"
                styles:
                  justify-content: flex-start                   
                buttons:
                  - entity: script.allmana_rum_mysbelysning
                    name: Sovrum
                    icon: false
  ....

I can get the text left aligned, or having the text at a fixed width, but not both at the same time.

Any suggestions would be most appreciated!

@magune
Copy link
Author

magune commented Jul 18, 2024

This finally solved it:

image
         - type: entities
            entities:
              - type: "custom:paper-buttons-row"                      
                buttons:
                  - name: Hela lägenheten
                    icon: false
                    styles:
                      button:
                        text-align: left
                        width: 150px
                        justify-content: flex-start                                
                      name:
                        justify-content: flex-start 
                        text-align: left                            
                      icon:
                        --mdc-icon-size: 40px # make the icon bigger.                            
                  - entity: script.allmana_rum_mysbelysning
                    name: false
                    icon: mdi:lightbulb-on-10   
                    styles:                     
                      icon:
                        --mdc-icon-size: 32px # make the icon bigger.                            
                  - entity: script.allmana_rum_mysbelysning
                    name: false                      
                    icon: mdi:lightbulb-on-50
                  - entity: script.allmana_rum_mysbelysning
                    name: false                      
                    icon: mdi:lightbulb-off-outline
              - type: "custom:paper-buttons-row"
                buttons:
                  - entity: script.allmana_rum_mysbelysning
                    name: Sovrum
                    icon: false
                    styles:
                      button:
                        text-align: left
                        width: 150px
                        justify-content: flex-start                                
                      name:
                        justify-content: flex-start 
                        text-align: left                            
                      icon:
                        --mdc-icon-size: 40px # make the icon bigger.  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant