How can we apply rotation to the icon on a button? I've tried various styles with no effect. It seems transform is ignored when applied to image or icon level in button component.
We can rotate the whole button with position.rotate property, or a transform:rotate style, but that doesn't give the desired effect. If there's no way to rotate just the icon, we'll remove it and layer an icon component on top the button, but we'd like to avoid that if there is a way to rotate the built-in icon on a button.
Thanks @victordcq! I figured this looked like a bug, but don't have a web background--need to spend some time wrapping my mind around CSS.
We need dynamic rotation (using this in a view as template with rotation set in view parameter). I've already got it done with an icon overlaid, but am curious if there is a way to inject this transform directly in a property on the button so we can create it in an expression that takes the degrees from a parameter on the view? I tried a few variations under image/icon/style/backgroundImage, but didn't have any success.
I guess another way would be to create styles with various rotations and then swap between the styles--almost always want 0, 90, -90, or 180deg, which this solution would work fine for.
You're going to have to be more specific because I see style settings propagate down - except for fill because there is a more-specific (and therefore higher priority by CSS rules) style applied in the theme files.
In this screenshot you can (sort of) see that the button has a Named Style attached. This Named Style includes fill and stroke, but only stroke is used on the <svg> node because of the .ia_button--primary svg rule defined in light.css.
Oh. You can't rotate elements of a flex container, and the icon and label within the button are within a flex <div>. If you wrap the Icon in your example in a Flex Container you'd see similar (ignored) behavior.
Note the Flex Container (which works as row or column wrapping the icon)
I guess a couple questions:
Why does this still work (Note that the arrow is right, but the rotation has it pointing left, I was too lazy to make a gif again, but it does the same thing)
Why would the above-listed "style injection" achieve this by rotating any element with the included class + svg?
I don't know that we're aware of this. I'll open a new ticket to investigate. It looks like settings applied at the button level are correctly inherited, but the actual props.image.style isn't having the desired effect.
The most satisfying feeling (probably only on our side) is having your thread title updated to include the bug/ticket number. Because it means your problem will get solved eventually! lol
Thanks for taking a look at this Cody.
In the meanwhile, @victordcq's cheaty style injection will still work.