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

Added ability to change margin #13

Merged
merged 7 commits into from
Dec 17, 2021
Merged

Added ability to change margin #13

merged 7 commits into from
Dec 17, 2021

Conversation

rlaunch
Copy link
Contributor

@rlaunch rlaunch commented Jan 1, 2021

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
Copy link
Contributor Author

rlaunch commented Jan 2, 2021

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:

  • --ha-card-background
  • --card-background-color

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

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

README.md Outdated Show resolved Hide resolved
@iantrich
Copy link
Owner

thanks!

@iantrich iantrich merged commit d8e7915 into iantrich:master Dec 17, 2021
@sdrapha
Copy link

sdrapha commented Jan 5, 2022

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
Copy link

sdrapha commented Jan 5, 2022

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.

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

Successfully merging this pull request may close these issues.

3 participants