Hi all,
I’d like to ask if there’s any difference in style definition between picture-elements’ state-icon and icon, or bug potentially? I’ve got the following code:
The calculation for size may not happen on the fly so it defaults to the upper left corner of the image. Just use 25% and 25% and it should work.
Is it a bug? Maybe. It could be by design, it could be a bug. If you want it fixed, write up the issue. If you just want a working card, use 25% and 25% assuming that the size of your card is 200px x 200px.
Thank you for the reply. Well actually I had had the idea of 25% 25% and other calculations and it kinda helps under certain circumstances, but do not solve the issue for all use cases. For example, if I have a centered state-icon on the card on computer, it drifts left and top on mobile phone. The other interesting thing is that if I remove iron-icon-width and iron-icon-height, the icon is properly centered on all devices but too small.
I would say so. Also, if you want to get around this, there are plenty of custom cards that do what you are doing. For example, the custom:button-card would handle this.
OK, thanks for your help. I am using button-card as well but we’ll see what developers say on the issue. I prefer to use build-in features over the add-ons when possible.