You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-dev@incubator.apache.org by Jeanne Waldman <je...@oracle.com> on 2006/06/13 21:05:08 UTC
[Proposal] skinning platform, agent, and language features
Hi there,
I would like to add some new features to the skinning portion of
Trinidad, and I wanted to make sure no one had any concerns.
Basically, I'd like to allow the skinning person to define styles that
are specific to a platform, an agent, and/or a language. Today in
Trinidad, the user can create a different skin for each combination, and
write skin-switching logic to switch between the skins depending upon
the platform, the agent, and the language the request is coming from. I
think that could get complicated, and seems hard to maintain.
I am proposing that we create skinning syntax for specifying styles for
a specific platform, agent, and/or language. The syntax for platform
and agent will follow css2's @media syntax, and the syntax for the
language support will use css2's existing :lang() pseudo-class (but
we'll parse it into our internal data-structure).
Here is an example of using @platform and @agent:
/* if platforms is windows or ppc and if the agent is ie, then use ie's
hand cursor for the column's sortable header text
*/
@platform windows, ppc {
@agent ie {
af|column::sortable-header-text {
cursor: hand;
}
}
}
Here is an example of using the :lang pseudo-class.
/* change the default font family when the language is ja or zh-TW */
.AFDefaultFontFamily:alias:lang(ja),
.AFDefaultFontFamily:alias:lang(zh-TW) {
font-family:Albany WTJ, Dialog;
}
The @agent feature is particularly useful if the skinning person is
creating components that use ie-specific or gecko-specific css styles.
They can use @agent ie {} for the ie-specific styling and @agent gecko
{} for the gecko-specific styling, and when Trinidad parses the skinning
css file and creates the css2 file that the page links to, it will only
add the style selectors/properties for the particular
platform/agent/language. Note that the css2 file that we generate from
the skinning css file is specific to the end user's platform/agent/language.
Let me know if you have any questions, comments, or concerns. I'll open
an issue and start implementing it if no one has any major concerns.
Thanks!
Jeanne