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
Resolution issues #7
Comments
Thank you! I am aware of this problem and it is something I am planning to improve. However, I’m quite busy at the moment so don’t expect it too soon. The simplest solution is to remove the fifth card. It has been also mentioned on the forums |
Okay @KTibow, thanks for letting me know! 👍 |
Would this work if you used percentages instead of pixels? |
Yes! Don't know why I didn't think of that. Would you like to do some testing @KTibow? |
I can try that out. I'm worried that it might not end up being square, though. |
Yes, good point. Check this out. |
Okay, (note to self and anybody else) here's a slightly changed for simplicity example entry (with This is basically the plain YAML minus some stuffcards:
# First card
- icon: 'mdi:lamp'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
# Second card
- icon: 'mdi:vanity-light'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
# Third card
- icon: 'mdi:ceiling-light'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
# Fourth card
- icon: 'mdi:light-switch'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
# Fifth card
- icon: 'mdi:table-chair'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
type: horizontal-stack |
@N-l1 they look way too tiny in width. (Code here, any ideas?)cards:
- icon: 'mdi:lamp'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- width: 50%
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
- width: 50%
type: 'custom:button-card'
- icon: 'mdi:vanity-light'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- width: 50%
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
- width: 50%
type: 'custom:button-card'
- icon: 'mdi:ceiling-light'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- width: 50%
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
- width: 50%
type: 'custom:button-card'
- icon: 'mdi:light-switch'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- width: 50%
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
- width: 50%
type: 'custom:button-card'
- icon: 'mdi:table-chair'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- width: 50%
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
- width: 50%
type: 'custom:button-card'
type: horizontal-stack |
Interesting... I was thinking of doing something with relative lengths. |
Hmm. It looks like the icons are hidden. What I have so far now (WIP): Hidden for convenience by defaultcards:
- icon: 'mdi:lamp'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- position: relative
- height: 60px
- padding-top: 100%
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
- position: absolute
- top: 0
- right: 0
- bottom: 0
- left: 0
type: 'custom:button-card'
- icon: 'mdi:vanity-light'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- position: relative
- height: 60px
- padding-top: 100%
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
- position: absolute
- top: 0
- right: 0
- bottom: 0
- left: 0
type: 'custom:button-card'
- icon: 'mdi:ceiling-light'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- position: relative
- height: 60px
- padding-top: 100%
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
- position: absolute
- top: 0
- right: 0
- bottom: 0
- left: 0
type: 'custom:button-card'
- icon: 'mdi:light-switch'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- position: relative
- height: 60px
- padding-top: 100%
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
- position: absolute
- top: 0
- right: 0
- bottom: 0
- left: 0
type: 'custom:button-card'
- icon: 'mdi:table-chair'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
styles:
card:
- position: relative
- height: 60px
- padding-top: 100%
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
- position: absolute
- top: 0
- right: 0
- bottom: 0
- left: 0
type: 'custom:button-card'
type: horizontal-stack
|
Some promising results using this code. It seems to work on a smaller phone I tested! 🎉 Basically changing the margin (the height and width doesn't seem to change properly) when the screen gets smaller... Show codecards:
# First card
- icon: 'mdi:lamp'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
@media only screen and (max-width: 600px) {
ha-card {
margin: 3px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
# Second card
- icon: 'mdi:vanity-light'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
@media only screen and (max-width: 600px) {
ha-card {
margin: 3px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
# Third card
- icon: 'mdi:ceiling-light'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
@media only screen and (max-width: 600px) {
ha-card {
margin: 3px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
# Fourth card
- icon: 'mdi:light-switch'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
@media only screen and (max-width: 600px) {
ha-card {
margin: 3px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
# Fifth card
- icon: 'mdi:table-chair'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
@media only screen and (max-width: 600px) {
ha-card {
margin: 3px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
type: horizontal-stack |
@N-l1 fantastic! I'll start working on increasing the margin on larger screens. |
@N-l1 I've done that. I've also added extra left padding, so it aligns better. Next step is adding back the more specific stuff, like the shadowing. What do you think?cards:
- icon: 'mdi:lamp'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
margin-left: 6.5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
@media only screen and (max-width: 600px) {
ha-card {
margin: 3px;
margin-left: 4px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
@media only screen and (min-width: 1200px) {
ha-card {
margin: 8px;
margin-left: 11px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
- icon: 'mdi:vanity-light'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
@media only screen and (max-width: 600px) {
ha-card {
margin: 3px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
@media only screen and (min-width: 1200px) {
ha-card {
margin: 8px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
- icon: 'mdi:ceiling-light'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
@media only screen and (max-width: 600px) {
ha-card {
margin: 3px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
@media only screen and (min-width: 1200px) {
ha-card {
margin: 8px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
- icon: 'mdi:light-switch'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
@media only screen and (max-width: 600px) {
ha-card {
margin: 3px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
@media only screen and (min-width: 1200px) {
ha-card {
margin: 8px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
- icon: 'mdi:table-chair'
show_icon: true
show_name: false
style: |
ha-card {
margin: 5px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
@media only screen and (max-width: 600px) {
ha-card {
margin: 3px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
@media only screen and (min-width: 1200px) {
ha-card {
margin: 8px;
box-shadow:
{% if is_state('sun.sun', 'above_horizon') %}
-5px -5px 8px 0 rgba(255,255,255,.5),5px 5px 8px 0 rgba(0,0,0,.03);
{% elif is_state('sun.sun', 'below_horizon') %}
-5px -5px 8px 0 rgba(50, 50, 50,.5),5px 5px 8px 0 rgba(0,0,0,.15);
{% endif %}
}
}
styles:
card:
- width: 60px
- height: 60px
- border-radius: 15px
- background-color: var(--primary-background-color)
icon:
- color: var(--primary-text-color)
type: 'custom:button-card'
type: horizontal-stack |
Wonderful! Updating the code... |
Add resize abilities to Horizontal Buttons Card, part of issue #7.
Issue resolved as part of commit 1aee410! |
@filikun in order to solve this, customize the Media Queries:
Modify the max-width: 600px and the min-width: 1200px to change the thresholds. |
Looking at the screen shot i think @filikun may even remove both @media sections. The standard styling already fits perfectly. |
@Harry-1976 but then if it's landscape, or on a giant display it might not work. |
@KTibow True that. Your mod works for me. |
Hey, awesome style! I have a problem with resolutions though. My GF have a Samsung Galaxy S10e with a smaller display and you can see for yourself that the buttons get cropped. Is there any way around this? I'm no expert in with styling so I'm not sure what I can do.
https://imgur.com/a/T0Vixpr
The text was updated successfully, but these errors were encountered: