iantrich / text-divider-row

🗂 Text Divider Row
MIT License
104 stars 13 forks source link

Added ability to change margin #13

Closed rlaunch closed 2 years ago

rlaunch commented 3 years ago

Added the ability to specify custom margin CSS via the 'margin' argument. If margin argument is not provided then the default '1em 0' margin CSS is used.

rlaunch commented 3 years ago

Have pushed another commit which implements the alignment option. Unfortunately I could not find a way to do this using flex, so used a different method. Only limitation I found with it is that one of the two variables must be set to the correct background colour:

In my tests with a few different themes, this works fine.

2021-01-02 (2) 2021-01-02 (1)

iantrich commented 2 years ago

thanks!

sdrapha commented 2 years ago

how can I define my margin to be zero without the config option? I want to customize it per card, without relyong on the theme. I tried card-mod without any success whatsoever. any help? tks.

sdrapha commented 2 years ago

stupid me was trying to fix the margins using card-mod instead of card_mod that is why it didn't work. But still I lost an hour or more tryng to figure everything out. If there was an example in the readme would helped a lot.

I ended up with this:

      - type: entities
        entities: 
        - type: custom:text-divider-row
          text: OpenWeather
          card_mod:
            style: |
              :host {
                 height: 0px;
                 --text-divider-margin: 0px 0px;
               }

note that I had to set the height to zero otherwise the margin wouldn't shrink enough.