Inherits from NSObject
Declared in PXStylesheet.h

Overview

A PXStylesheet typically corresponds to a single CSS file. Each stylesheet contains a list of rule sets defined within it.

A PXStylesheet typically corresponds to a single CSS file. Each stylesheet contains a list of rule sets defined within it.

Tasks

Other Methods

  •   origin

    A PXStylesheetOrigin enumeration value indicating the origin of this stylesheet. Origin values are used in specificity calculations.

    property
  •   errors

    A nonmutable array of error strings that were encountered when parsing the source of this stylesheet

    property
  •   filePath

    The string path to the file containing the source of this stylesheet

    property
  •   monitorChanges

    A flag to watch the file for changes. If file changes, then a call to sendChangeNotifation is made.

    property

Extension Methods

Properties

activeMediaQuery

The current media query that applies to any rule sets added to this stylesheet

@property (nonatomic, strong) id<PXMediaExpression> activeMediaQuery

Discussion

The current media query that applies to any rule sets added to this stylesheet

Declared In

PXStylesheet-Private.h

errors

A nonmutable array of error strings that were encountered when parsing the source of this stylesheet

@property (nonatomic, strong) NSArray *errors

Discussion

A nonmutable array of error strings that were encountered when parsing the source of this stylesheet

Declared In

PXStylesheet.h

filePath

The string path to the file containing the source of this stylesheet

@property (nonatomic, strong) NSString *filePath

Discussion

The string path to the file containing the source of this stylesheet

Declared In

PXStylesheet.h

mediaGroups

A nonmutable array of media groups that are contained within this stylesheet

@property (readonly, nonatomic, strong) NSArray *mediaGroups

Discussion

A nonmutable array of media groups that are contained within this stylesheet

Declared In

PXStylesheet-Private.h

monitorChanges

A flag to watch the file for changes. If file changes, then a call to sendChangeNotifation is made.

@property (nonatomic, assign) BOOL monitorChanges

Discussion

A flag to watch the file for changes. If file changes, then a call to sendChangeNotifation is made.

Declared In

PXStylesheet.h

origin

A PXStylesheetOrigin enumeration value indicating the origin of this stylesheet. Origin values are used in specificity calculations.

@property (readonly, nonatomic) PXStylesheetOrigin origin

Discussion

A PXStylesheetOrigin enumeration value indicating the origin of this stylesheet. Origin values are used in specificity calculations.

Declared In

PXStylesheet.h

ruleSets

A nonmutable array of rule sets that are contained within this stylesheet

@property (readonly, nonatomic, strong) NSArray *ruleSets

Discussion

A nonmutable array of rule sets that are contained within this stylesheet

Declared In

PXStylesheet-Private.h

Class Methods

currentApplicationStylesheet

A class-level getter returning the current application-level stylesheet. This value may be nil

+ (PXStylesheet *)currentApplicationStylesheet

Discussion

A class-level getter returning the current application-level stylesheet. This value may be nil

Declared In

PXStylesheet-Private.h

currentUserStylesheet

A class-level getter returning the current user-level stylesheet. This value may be nil

+ (PXStylesheet *)currentUserStylesheet

Discussion

A class-level getter returning the current user-level stylesheet. This value may be nil

Declared In

PXStylesheet-Private.h

currentViewStylesheet

A class-level getter returning the current view-level stylesheet. This value may be nil

+ (PXStylesheet *)currentViewStylesheet

Discussion

A class-level getter returning the current view-level stylesheet. This value may be nil

Declared In

PXStylesheet-Private.h

styleSheetFromFilePath:withOrigin:

Allocate and initialize a new styleheet for the specified path and stylesheet origin

+ (id)styleSheetFromFilePath:(NSString *)filePath withOrigin:(PXStylesheetOrigin)origin

Parameters

filePath

The string path to the stylesheet file

origin

The specificity origin for this stylesheet

Discussion

Allocate and initialize a new styleheet for the specified path and stylesheet origin

Declared In

PXStylesheet-Private.h

styleSheetFromSource:withOrigin:

Allocate and initialize a new stylesheet using the specified source and stylesheet origin

+ (id)styleSheetFromSource:(NSString *)source withOrigin:(PXStylesheetOrigin)origin

Parameters

source

The CSS source for this stylesheet

origin

The specificity origin for this stylesheet

Discussion

Allocate and initialize a new stylesheet using the specified source and stylesheet origin

Declared In

PXStylesheet-Private.h

Instance Methods

addKeyframe:

Add a keyframe animation to this stylesheet

- (void)addKeyframe:(PXKeyframe *)keyframe

Parameters

keyframe

The keyframe to add to the stylesheet

Discussion

Add a keyframe animation to this stylesheet

Declared In

PXStylesheet-Private.h

addRuleSet:

Add a new rule set to this stylesheet

- (void)addRuleSet:(PXRuleSet *)ruleSet

Parameters

ruleSet

The rule set to add. Nil values are ignored

Discussion

Add a new rule set to this stylesheet

Declared In

PXStylesheet-Private.h

initWithOrigin:

Initialize a new stylesheet instance and set its stylesheet origin

- (id)initWithOrigin:(PXStylesheetOrigin)origin

Parameters

origin

The specificity origin for this stylesheet

Discussion

Initialize a new stylesheet instance and set its stylesheet origin

Declared In

PXStylesheet-Private.h

keyframeForName:

Retrieve the keyframe for the specified name. This may return nil

- (PXKeyframe *)keyframeForName:(NSString *)name

Parameters

name

The name of the keyframe

Discussion

Retrieve the keyframe for the specified name. This may return nil

Declared In

PXStylesheet-Private.h

namespaceForPrefix:

Return the namespace URI for the specified prefix. If prefix is nil or an empty string, then the default namespace URI will be returned, if one has been defined

- (NSString *)namespaceForPrefix:(NSString *)prefix

Parameters

prefix

The namespace prefix

Discussion

Return the namespace URI for the specified prefix. If prefix is nil or an empty string, then the default namespace URI will be returned, if one has been defined

Declared In

PXStylesheet-Private.h

ruleSetsMatchingStyleable:

Return a list of rule sets whose selectors match against a specified element

- (NSArray *)ruleSetsMatchingStyleable:(id<PXStyleable>)element

Parameters

element

The element to match against

Discussion

Return a list of rule sets whose selectors match against a specified element

Declared In

PXStylesheet-Private.h

setURI:forNamespacePrefix:

Register a namespace URI for a given prefix. If the prefix is nil or an empty string, then this method sets the default namespace URI.

- (void)setURI:(NSString *)uri forNamespacePrefix:(NSString *)prefix

Parameters

uri

The URI (as a string) for the namespace

prefix

The namespace prefix to associate with the namespace URI

Discussion

Register a namespace URI for a given prefix. If the prefix is nil or an empty string, then this method sets the default namespace URI.

Declared In

PXStylesheet-Private.h