Hi, I’m trying to place an oh-icon
in my widget with the same height as a simple ‘oh-button’. This works perfectly in firefox with
- component: oh-icon
config:
icon: if:simple-icons:spotify
height: calc(var(--f7-button-height) - var(--f7-button-border-width, 0) * 2)
color: var(--f7-button-fill-bg-color, var(--f7-theme-color))
But in chrome-based browsers, including the android app, the icon size (width & height) is always set to 100%. No difference, if I use the above or just height: var(--f7-button-height)
(setting it to a fixed size such as 28px
works though).
Any idea how to fix this?
Full widget code:
uid: widget_card_spotify
tags: []
props:
parameters:
parameterGroups: []
timestamp: Sep 16, 2023, 11:05:01 PM
component: f7-card
config:
style:
background-image: ="url('"+items['Spotify_Albumcover_Url'].state+"')"
background-size: cover
background-position-y: center
slots:
default:
- component: f7-card-content
config:
style:
backdrop-filter: brightness(50%)
border-radius: var(--f7-card-border-radius)
slots:
default:
- component: f7-row
slots:
default:
- component: oh-icon
config:
icon: if:simple-icons:spotify
height: calc(var(--f7-button-height) - var(--f7-button-border-width, 0) * 2)
color: var(--f7-button-fill-bg-color, var(--f7-theme-color))
- component: oh-button
config:
text: =items['Spotify_Wiedergabegeraet'].state
fill: true
round: true
action: options
actionItem: Spotify_Geraete_Aktiv
- component: f7-row
slots:
default:
- component: f7-col
slots:
default:
- component: f7-row
slots:
default:
- component: Label
config:
text: =items['Spotify_Titel'].state
style:
color: white
font-weight: 800
padding: 20px 0px 0px 0px
- component: f7-row
slots:
default:
- component: Label
config:
text: =items['Spotify_Kuenstler'].state
style:
color: white
font-weight: 600
padding: 2px 0px 0px 0px
- component: f7-col
config:
style:
position: relative
height: 64px
slots:
default:
- component: oh-link
config:
action: command
actionItem: Spotify_Fernbedienung
actionCommand: '=(items["Spotify_Fernbedienung"].state=="PLAY") ? "PAUSE": "PLAY"'
style:
position: absolute
right: 0
bottom: 0
height: 40px
width: 40px
background: var(--f7-button-fill-bg-color,var(--f7-theme-color))
border-radius: 20px
slots:
default:
- component: oh-icon
config:
icon: '=(items["Spotify_Fernbedienung"].state=="PLAY") ? "if:mdi:pause": "if:mdi:play"'
height: 28px
color: white
- component: f7-row
config:
style:
padding: 12px 0px 0px 0px
justify-content: left
slots:
default:
- component: oh-link
config:
action: command
actionItem: Spotify_Fernbedienung
actionCommand: PREVIOUS
style:
padding-right: 2px
slots:
default:
- component: oh-icon
config:
icon: if:mdi:skip-previous-outline
color: white
height: 28px
- component: Label
config:
text: =items['Spotify_Titellaufzeit_mss'].state
style:
color: white
font-weight: 400
width: 30px
padding: 3px 2px 0px 2px
text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5)
- component: f7-progressbar
config:
progress: = 100 * (Number.parseInt(items['Spotify_Titellaufzeit_ms'].state) / Number.parseInt(items['Spotify_Titellaenge_ms'].state))
style:
width: 150px
--f7-progressbar-height: 3px
margin: 12px 5px 0px 5px
- component: Label
config:
text: =items['Spotify_Titellaenge_mss'].state
style:
color: white
font-weight: 400
width: 30px
padding: 3px 2px 0px 2px
text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5)
- component: oh-link
config:
action: command
actionItem: Spotify_Fernbedienung
actionCommand: PREVIOUS
slots:
default:
- component: oh-icon
config:
icon: if:mdi:skip-next-outline
color: white
height: 28px
- component: oh-link
config:
action: options
actionItem: Spotify_Playlists
style:
margin-left: auto
slots:
default:
- component: oh-icon
config:
icon: if:mdi:playlist-music
color: white
height: 28px