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

border-radius fixes for state-badge #23212

Merged

Conversation

ildar170975
Copy link
Contributor

Breaking change

Proposed change

update & media_player fix:
border-radius now applied even if image is overridden:
this logic

      if (domain === "update") {
        this.style.borderRadius = "0";
      } else if (domain === "media_player" || domain === "camera") {
        this.style.borderRadius = "8%";
      }

was moved to another place to be executed independently on this.overrideImage === undefined.

camera fix:
before:
image

after:
image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@wendevlin wendevlin merged commit d71b29d into home-assistant:dev Dec 20, 2024
15 checks passed
@ildar170975 ildar170975 deleted the state-badge-media-player-fix branch December 20, 2024 16:32
@DigiLive
Copy link

DigiLive commented Jan 5, 2025

Since the border-radius is now applied to the element itself, it can't be overridden anymore with the style attribute. E.g. an element at a Picture elements card:

type: state-icon
entity: camera.camera_wk
title: null
style:
  top: 32.71%
  left: 51.52%
  border-radius: 50% # Doesn't work anymore.
  text-align: center
  background-color: rgba(255, 255, 255, 0.3)
tap_action:
  action: more-info

@ildar170975
Copy link
Contributor Author

it can't be overridden anymore with the style attribute

I will think about a possible customization.
Meanwhile - use card-mod:

  - type: state-icon
    entity: camera.demo_camera
    style:
      top: 32%
      left: 40%
    card_mod:
      style: |
        state-badge {border-radius: 50% !important;}

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

Successfully merging this pull request may close these issues.

3 participants