Load an external style sheet into Flex
I’m surprised I haven’t tried this before but you can’t load an external style sheet into Flex. The Adobe documentation mentions loading external CSS files, but they always mean loading a style sheet before you compile your SWF which isn’t what I’d call a true external style sheet.
Thankfully Ruben has written a class that will do just that.
Flex’s implementation of style sheets is really wacky, every time I set paddingTop, paddingLeft, paddingBottom, paddingRight all to say 10px I go mildly insane because a) why can’t I just write it once ‘padding: 10px’? and b) why deviate from the CSS the rest of the world is used to, ‘padding-top’ etc.?




Like this post? subscribe to the feed.






Just for a bit of sanity, you can indeed use padding-top, padding-left, etc in Flex. It mostly converts dashes into camel case for you :) But I do agree with the non-shortcut madness. Drives me batty!
Comment by Kyle — January 28, 2008 @ 8:04 pm
Hey Kyle, Sweet! I didn’t know about the dash conversion, still within a MXML tag it will bug out (I guess one more reason to put everything in styles) :)
Comment by Alastair — January 28, 2008 @ 11:47 pm