Xinf API Reference
Back | Index
class xinf.style.StyleSheet

A CSS-like stylesheet.

DOCME: Best, describe where xinf (still) lacks from CSS-2.

See also: CSS 2 Specification

function new( ?_rules:Iterable<StyleRule> ) :Void
Create a new StyleSheet, either empty or filled with the rules given in rules.
function parseCSS( data:String ) :Void
Parse a textual CSS stylesheet to the end of this StyleSheet.
function add( rule:StyleRule ) :Void
Add a single StyleRule to the end of this StyleSheet.
function addMany( _rules:Iterable<StyleRule> ) :Void
Add a number of StyleRules to the end of this StyleSheet.
function match( e:Stylable ) :Dynamic

Match the given object e against the rules found in this, or the default, StyleSheet.

Matching styles are aggregated into a single dynamic object, with the property values still unparsed text (as returned by StyleParser.parseToObject().

Priorities are not as elaborate as stipulated by CSS2: simply, rules that come last always have higher priority.

Rules from the DEFAULT StyleSheet are also applied (with lower priority than the ones found in this StyleSheet).

static var DEFAULT :StyleSheet
The default stylesheet. It is always applied, with lowest priority.
Back | Index