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

Popup Card Inconsistencies #23

Open
apop880 opened this issue May 8, 2019 · 1 comment
Open

Popup Card Inconsistencies #23

apop880 opened this issue May 8, 2019 · 1 comment

Comments

@apop880
Copy link

apop880 commented May 8, 2019

I found a couple of formatting issues with the popup card versus a standard more-info card.

  1. The gap between the "X" and the card title is smaller than the gap in the standard card. I was able to add the following to the <style> section to correct it, but not sure if there's a more efficient fix:
app-toolbar [main-title] {
  --ha-more-info-app-toolbar-title_-_margin-left: 16px;
  --ha-more-info-app-toolbar-title_-_line-height: 1.3em;
  --ha-more-info-app-toolbar-title_-_max-height: 2.6em;
  --ha-more-info-app-toolbar-title_-_overflow: hidden;
  --ha-more-info-app-toolbar-title_-_display: -webkit-box;
  --ha-more-info-app-toolbar-title_-_-webkit-line-clamp: 2;
  --ha-more-info-app-toolbar-title_-_-webkit-box-orient: vertical;
  --ha-more-info-app-toolbar-title_-_text-overflow: ellipsis;
  margin-left: var(--ha-more-info-app-toolbar-title_-_margin-left);
  line-height: var(--ha-more-info-app-toolbar-title_-_line-height);
  max-height: var(--ha-more-info-app-toolbar-title_-_max-height);
  overflow: var(--ha-more-info-app-toolbar-title_-_overflow);
  display: var(--ha-more-info-app-toolbar-title_-_display);
  -webkit-line-clamp: var(--ha-more-info-app-toolbar-title_-_-webkit-line-clamp);
  -webkit-box-orient: var(--ha-more-info-app-toolbar-title_-_-webkit-box-orient);
  text-overflow: var(--ha-more-info-app-toolbar-title_-_text-overflow);
}
  1. On a desktop or tablet, the style of the popup card matches a standard more-info, but on a phone where the popup fills the screen, the header colors don't match a standard card. I applied the following code in the <style> section to fix:
@media all and (max-width: 450px), all and (max-height: 500px) {
  app-toolbar {
      color: var(--text-primary-color);
      background-color: var(--primary-color);
  }
}
  1. On a mobile device, the card shows its shadow by default, which is not the behavior on the standard card. I was not able to figure out a way to update card-tools to correct this and resorted to using card-modder, but it would probably be good to match the default behavior of the more-info screen if that's possible.

I'm happy to open a PR if you'd prefer but I figure there are likely better ways to fix these items. My solution was pretty quick and dirty.

@apop880
Copy link
Author

apop880 commented May 9, 2019

Just to add, the issue with the spacing after the X doesn't seem to be entirely fixed by my code above. It is good on a PC now, and it's good in Chrome developer tools if I change to a phone resolution, but it's still not right on my actual phone.

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

No branches or pull requests

1 participant