Changing css properties for selector at runtime

898 Views Asked by At

I have a css that defines de skin-class for a custom component, like this :

view|PlaceHolderView {
    skin-class:ClassReference('view.skin.PlaceHolderSkin');
}

Is there a way to change that value at runtime, so that all instances of the component switch skin?

1

There are 1 best solutions below

0
On BEST ANSWER

I found the answer to my question after a bit more digging around.

var dec:CSSStyleDeclaration = styleManager.getStyleDeclaration('view.PlaceHolderView')
dec.setStyle('skinClass', MyOtherSkinClass);
styleManager.setStyleDeclaration('view.PlaceHolderView', dec, true);