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

Fix two sensor graph footer issues #111

Merged
merged 1 commit into from
Oct 4, 2024
Merged

Conversation

The0x539
Copy link
Contributor

@The0x539 The0x539 commented Oct 1, 2024

Before: image
After: image

  • If a (non-open) footer isn't full width, there is a gap between the .info and .footer elements that gets filled with the background-color (which is also what determines the inner-color color, so we can't just set it to black).
    • Fixed by using flexbox to make the footer element (but not the graph inside) grow to fill the gap.
  • The graph draws on top of the inner corner, causing subtle discoloration.
    • Fixed by using overflow: hidden to clip the graph to the black region.

I originally discovered the first issue by creating a horizontal stack of two sensors at the end of a vertical stack. I noticed the second issue while investigating the first.

I may have put these rules in a more specific rule than would be ideal, but as far as I know this is the only situation with this issue. Graphs as headers have completely different brokenness that I'm less interested in personally investigating.

Test case:

type: sensor
graph: line
entity: sensor.husky_battery_level
card_mod:
  class: middle-right
layout_options:
  grid_columns: 3
  grid_rows: 3

@th3jesta th3jesta merged commit 1b2c86a into th3jesta:master Oct 4, 2024
1 check passed
@th3jesta
Copy link
Owner

th3jesta commented Oct 4, 2024

Excellent! I can probably employ this method in other card types, as well. It's way less janky than some of the fixes I've implemented for similar issues.

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.

2 participants