How do you style skin parts independently from styling the overall component? For example, making the Panel title "bold" while the rest of the text in the Panel is "normal".
See these bugs for more background:
https://bugs.adobe.com/jira/browse/SDK-19726
https://bugs.adobe.com/jira/browse/SDK-19447
pending…
This is the current approach used by the Gumbo components. The majority of styles are defined once, on the global selector. If a skin part requires a different style, it is hard-coded into the skin.
Example:
global {
font-weight: normal; /* global font weight */
}
FxPanelSkin.mxml
<Skin>
...
<!-- Panel title is bold. -->
<TextBox id="titleField" fontWeight="bold" />
....
</Skin>
Pros:
Cons:
Use the new advanced CSS features added to Flex 4 for specifying styles. For example, the Panel titleField is made bold with the following selector:
Example:
Panel #titleField {
font-weight: bold;
}
Pros:
Cons:
This is the solution used for most Halo components.
Example:
FxPanel {
titleFieldStyleName: panelTitleField;
}
.titleFieldStyleName {
font-weight: bold;
}
Pros:
Cons:
This is the solution used by some Halo components like FormItem/FormItemLabel.
Example:
PanelTitleTextBox {
font-weight: bold;
}
Pros:
Cons:
Solution #1, for the following reasons:
A 3rd party developer could easily create a theme that uses advanced CSS (ie proposal #2), if desired.