How can I have a constant in a Flex application which I could apply at several places in a Flex CSS file? For example I may have a background color which is the same in several UI components and then I would like to have this color set in only one place and reused in all style clauses. Something like …
public static const myColor = "#00FF00"
...
component1
{
backgroundColor: myColor
}
component2 {
backgroundColor: myColor
}
This is what I use. Check out the StylesheetMixin class on Snipplr.
This is what it looks like in use:
ColorPalette
Stylesheet
Flex 3 equivalent:
Sample Application
I have palettes for:
Works with Flex 3 and 4.