Inherits from PXDeclarationContainer : NSObject
Declared in PXRuleSet.h

Overview

A PXRuleSet represents a single CSS rule set. A rule set consists of selectors and declarations. A specificity is associated with each rule set to assist in the calculation of weights and cascading of declarations.

Tasks

Properties

selectors

A nonmutable array of selectors.

@property (readonly, nonatomic) NSArray *selectors

Discussion

A nonmutable array of selectors.

When a selector consists of a comma-delimited list, each item is added to this rule set

Declared In

PXRuleSet.h

specificity

The specificity of this rule set as calculated based on the rule set’s selectors

@property (readonly, nonatomic) PXSpecificity *specificity

Discussion

The specificity of this rule set as calculated based on the rule set’s selectors

Declared In

PXRuleSet.h

targetTypeSelector

Returns the final selector which determines what target types will be selected

@property (readonly, nonatomic) PXTypeSelector *targetTypeSelector

Discussion

Returns the final selector which determines what target types will be selected

Declared In

PXRuleSet.h

Class Methods

ruleSetWithMergedRuleSets:

A class method used to merge multiple rule sets into a single rule set, taking specificity of each rule set into account. The resulting rule set’s selectors and specificity properties are undefined.

+ (id)ruleSetWithMergedRuleSets:(NSArray *)ruleSets

Parameters

ruleSets

An array of rule sets to merge

Discussion

A class method used to merge multiple rule sets into a single rule set, taking specificity of each rule set into account. The resulting rule set’s selectors and specificity properties are undefined.

Declared In

PXRuleSet.h

Instance Methods

addSelector:

Add a selector to the list of selectors associated with this rule set

- (void)addSelector:(id<PXSelector>)selector

Parameters

selector

The selector to add

Discussion

Add a selector to the list of selectors associated with this rule set

Declared In

PXRuleSet.h

matches:

Determine if a given element matches the selector associated with this rule set

- (BOOL)matches:(id<PXStyleable>)element

Parameters

element

The element to test

Discussion

Determine if a given element matches the selector associated with this rule set

Declared In

PXRuleSet.h