Skip to main content
Legend
November 19, 2012
Answered

Alternatives to load stylesheet...

  • November 19, 2012
  • 1 reply
  • 455 views

Hi,

I need to be able to swap out styles en masse across the whole application in a mobile project.

Obviously, that would be easy anywhere else... styleManager.loadStylesheet or similar.

But in mobile...

I think I am resigned to compiling a single, big stylesheet with lots of variations, but I still need a succinct way to swap out everything across the whole app... something like FlexGlobals.topLevelApplication.styleName = "bob";

Anybody got any nifty way of writing CSS so as to allow me to do this in one fell swoop?

Thanks,

G

This topic has been closed for replies.
Correct answer Gaius Coffey

OK, easy.

Define a style for everything:

* {

}

Then:

styleManager.getStyleDeclaration("*").setStyle(<property>,<value>);

Seems to affect the whole app globally, so means easy to make big switches after just a little bit of CSS organisation.

G

1 reply

Gaius CoffeyAuthorCorrect answer
Legend
November 28, 2012

OK, easy.

Define a style for everything:

* {

}

Then:

styleManager.getStyleDeclaration("*").setStyle(<property>,<value>);

Seems to affect the whole app globally, so means easy to make big switches after just a little bit of CSS organisation.

G