Luxor Network: Luxor - Luxilla - Petra - Installer DeLux - Luxor Contrib - Luxor Forum - The Memphis Sun
Luxor XUL Logo
Making Building Classic Desktop-Style UIs As Easy As Building Web Pages
Overview . Tag Reference . Cheat Sheet . CSS Reference . API Reference . FAQ . History . Upcoming . Gallery . Notes . Powered By Luxor . Contribute . Mailing Lists & Forums . Premium Support . Credits . Glossary . Site Search . The Memphis Sun . Download . Download Luxilla . Download Plugins . Download Contrib . Source . Javadoc . Team . Who's Who . Donate . Luxor @ Sourceforge

Luxor XUL CSS Reference

Overview - Why CSS?

Cascading Style Sheet (CSS) started as a W3C standard for styling web pages (that is, HTML tags) and evolved into a standard for styling arbitrary, made-up, not-yet-invented XML tags such as Luxor XUL tags.

Luxor XUL uses the CSS core to let you style XUL tags using well-documented, standardized name/value pairs (e.g. color: red; font-size: 150%; font-style: italic;) that you can look up at your public library instead of inventing hown-grown fonts, colors, border styles, length units and more.

Note, that CSS is not and archaic pre-XML-world dialect that is endangered by XSL/T. Instead both CSS and XSL/T will thrive side-by-side and complement each other. XSL/T, for example, excels in creating new documents from templates and XML data, but doesn't offer well-documented, standardized style properties that you can squeeze into XML tags and that are possibly cascaded/inherited to leafs and branches in the document tree.

Adding Styles to XUL

You can style XUL tags in two ways:

Inline styles. You can add style properties to individual XUL tags using the style attribute. Example:

<button style="width: 200px" label="Piranha" />

External style sheets. (Note: Not Yet Supported - Coming Soon) You can store style rules for reuse in separate, XML-free text documents also known as style sheets. Note, that your style rules no longer reside inside the XML tags they belong to, and you, therefore, need to use selectors to tell Luxor which XML tags you want to polish up with which style rules.

Selectors

Luxor supports three forms of selectors to match XUL tags and style rules.

Element selectors. Lets you attach styles to XUL tags. Example:

  toolbarbutton  { min-width: 50px; } 

Note, that you can group element selectors into a comma-separated list, so that the style properties apply to all listed tags. Example:

  password, text { min-width: 50px; } 

Class selectors. Using the class attribute you can group XUL tags into a class. Example:

  <label class="warning">You are in bear country.</label>

To attach a style to a particular class, append the class name to the XUL selector, separated by a period (.). Example:

  label.warning { color: red; }

To attach a style to all tags of particular class, leave out the leading tag name. Example:

  .warning { color: red; }

ID selectors. Using the id attribute you can assign a unique identifier to a XUL tag. Example:

  <label id="warning-bear-country">You are in bear country.</label>

To attach a style to the identified tag, use the id value preceded by a pound sign (#). Example:

  #warning-bear-country { font-weight: bold; }
Length Units

Luxor currently supports the length units below:

Pixels (px) Equals a pixel on your screen. Example:

min-width: 50px
Alphabetical Style Property List
Alphabetical Style Property Reference

height

Values: length
Inherited: No

Sets the height for an element. Note, that if the element is inside a flexible box (e.g. flex="1"), that is a box that shrinks or grows dynamically, height is ignored and min-height and max-height is used instead.

Examples:

  <vbox style="height: 200px">

max-height

Values: length
Inherited: No

Sets the maximum height an element is allowed to grow inside a flexible box. Note, that max-height is ignored inside non-flexible boxes and height is used instead.

Examples:

  <button style="max-height: 40px" label="Canary" />  

max-width

Values: length
Inherited: No

Sets the maximum width an element is allowed to grow inside a flexible box. Note, that max-width is ignored inside non-flexible boxes and width is used instead.

Examples:

  <button style="max-width: 50px" label="Canary" />  

min-height

Values: length
Inherited: No

Sets the minimum height an element is allowed to shrink inside a flexible box. Note, that min-height is ignored inside non-flexible boxes and height is used instead.

Examples:

  <button style="min-height: 40px" label="Canary" />  

min-width

Values: length
Inherited: No

Sets the minimum width an element is allowed to shrink inside a flexible box. Note, that min-width is ignored inside non-flexible boxes and width is used instead.

Examples:

  <button style="min-width: 50px" label="Canary" />  

width

Values: length
Inherited: No

Sets the width for an element. Note, that if the element is inside a flexible box (e.g. flex="1"), that is a box that shrinks or grows dynamically, width is ignored and min-width and max-width is used instead.

Examples:

  <button style="width: 120px" label="Canary" />  
  <hbox style="width: 400px;">
More Quick Links: Batik SVG · Velocity · Python · Jython · Groovy · JDOM · dom4j · Jaxen · XDoclet · Eclipse SWT · wx4j · Java Gnome · KDE/Qt Java · Kaffe · gcj · SableVM · IKVM · Mono · DotGNU · Gtk# · Qt# · Parrot · Mozilla · Relax NG
Hosted by SourceForge SourceForge Logo For questions related to the use of Luxor, please consult our web pages. If that fails, the luxor-xul-user mailinglist might help.
Please send comments on our web pages and the development of Luxor to our public luxor-xul-develop mailinglist.
Maintained by Luxor Team
Copyright © 2001, 2002, 2003, 2004, 2005 Luxor Foundation