I want to animate an icon component to rotate. I think I should be able to get this done with a CSS style. I created a blank style called Rotation and added the following to my CSS stylesheet:
@keyframes runRotate {
from {transform: rotate(0deg);}
to {transform: rotate(-359deg);}
}
.psc-Rotation{
-webkit-animation: runRotate 2s linear infinite;
}
To apply the style, I had to add the "classes" section to the icon's style group (why it's not there to begin with is odd, but adding it manually works). But, after applying the style the icon is not rotating.
There is nothing special about my View, this method doesn't require a theme or stylesheet. Not sure what's going on, maybe create a new View and start over.
Using the supplied style rules, and after placing classes: Rotation into my style object, my Icon immediately began rotating in place as expected (8.1.24).
Sorry for the confusion, but I meant using the original rules you had supplied in the first post my Icon was working correctly. I suspect you're running into a (minor) known issue where changes to the stylesheet resource are not always picked up by View resources until either the project is saved, or the View is closed and re-opened. This is because the View obtains the stylesheet when the View is opened, and doesn't listen for changes appropriately. Using the original rule from the first post, try saving your project again and see if it works.
Also, as a side-note:
If you define a rule for a selector in stylesheet.css, and assign that "class" to the object, you actually don't even need to make a Style Class in Perspective; the defined classname ("Spin" in your example) will be applied to the component regardless of the existence of a matching Perspective Style.
In the following screenshot, you can see I have no RedStroke Style resource.
Thank you for the reply @pturmel, can you please tell me, how we will know the "ia_symbolComponent" we need to use?
little bit confused in those areas, how we will find each object, and how we need to give, Sorry I'm a beginner in this part. Can you please help?