Menu

Changes to Style Syntax

Dave Brondsema SourceForge Editorial Staff

Changes to Style Syntax

Closed 12/12/2008

Issue

Style metadata is declared on components, but the majority of styles are honored by the skin. Do we need a new syntax/mechanism for declaring styles on skins and having them be settable on component tags? Currently, custom style values can only be set on CSS stylesheets.

For example, a custom button skin declares a new "fizzle" style. Setting the style directly on the component tag doesn't work:

    <Button 
     skinClass="CustomButtonSkin" 
     fizzle="true" /> <!-- ERROR: Cannot resolve attribute "fizzle" -->

The workaround is to set the style in a stylesheet:

<Style>
    .myStyle {
        fizzle: true;
    }
</Style>

<Button skinClass="CustomButtonSkin" styleName="myStyle" />

The other problem with declaring style metadata on components is if a custom skin doesn't support a given style, setting the style attribute has no effect (it doesn't cause any problems, but just doesn't do anything).

Recommendation

Keep the existing mechanism and make no new changes.

In Halo, styles were a primary mechanism for visual customization, and every component had numerous style definitions. In Gumbo, styles play a much smaller role. Gumbo components only support text styles and a handful of color styles.

Since styling is playing a smaller role, and the number of style properties has been significantly reduced, it's fine to stick with our current mechanism of declaring style metadata on the components.


Related

Wiki: Flex 4

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.