@class — Authored class styles


Look Ma. No stylesheet changes

 --Test Subject

An early design principle was, Hands off the @class attribute. That's for user control. Recently, an approach was implemented that allows authors to define classes and associate specific CSS styles, all within a document.

The @style attribute maps to the oXml -oxy-style CSS property. This allows raw CSS to be passed to the CSS processor for the defined element.

Adding a @styleclass attribute on an element makes the @style value available for reuse. A little XPath handles the indirection from @class, through the preceding @styleclass, to @style:

Figure 11. @class markup

The first <t/> element defines the style for the class. Others reference the defined styles through the @class attribute

Figure 12. @class CSS

CSS associates the @style, @styleclass, and @class attributes

Figure 13. @class rendering

This figure demonstrates the CSS rendering through reference