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

Rato of height and width of an background-image #1216

Open
Gordon746 opened this issue Feb 7, 2025 · 0 comments
Open

Rato of height and width of an background-image #1216

Gordon746 opened this issue Feb 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@Gordon746
Copy link

Steps to reproduce the behavior:

I use a cover-button with Subbuttons, but want to replace the icons by an image. This works:

.bubble-sub-button-2 {
      background-image: url("/local/pictures/lamelle_offen.svg");
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
      border-radius: 50%;      
      ha-icon {
       color: transparent! important;
       }
}

Adding a border though by

      border-style: solid;
      border-color: red;
      border-width: 4px;

stretches the background-image in the horizontal dimensions (the height remains constant)

Image

Expected behavior
Maybe it's not a bug but a bad coding of mine? Anyways, I can prevent the stretching by adding 'width 1px':

  ha-icon {
       color: transparent! important;
       width: 1px;
      }
Image

YAML
So this code works, but I don't know weather this is future proof:

  .bubble-sub-button-2 {
      background-image: url("/local/pictures/lamelle_offen.svg");
      background-size: contain;
      background-repeat: no-repeat;
      background-position: center;
      border-radius: 50%;      
      border-style: solid;
      border-color: red;
      border-width: 8px;
      ha-icon {
       color: transparent! important;
       width: 1px;
      }
}

Thank you very much! 🍻

@Gordon746 Gordon746 added the bug Something isn't working label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant