Holds a set of selector styles. A selector is something like .name or #name.
Public Member Functions | |
StyleSheet (Document document) | |
Creates an empty stylesheet that belongs to the given document. More... | |
StyleSheet (Document document, string text) | |
Creates a new stylesheet that belongs to the given document. Sets the given css text to it. More... | |
Css.SelectorStyle | GetStyleBySelector (string selector) |
Attempts to get a style from this sheet by selector. More... | |
void | AddModified (string selector, Css.SelectorStyle style) |
Adds a modified form of the given selector. E.g. style might be the input:hover style. That style is a modified form of the "input" selector. More... | |
List< Css.SelectorStyle > | GetModifiers (string selector) |
Gets all the modified forms of the given selector. E.g. selector could be "input", in which case there may be ":hover",":focus" etc. More... | |
SelectorStyle | StartSelector (string selector, string modifier) |
Creates a new selector block for the given selector/modifier combo. More... | |
void | ParseCss (string css) |
Keeps reading selectors and their properties until a > or the end of the css is reached. More... | |
Public Attributes | |
Document | Document |
The html document that this sheet belongs to. More... | |
Dictionary< string, List < Css.SelectorStyle > > | ModifiedSelectors |
A lookup of the selectors that have modified forms. E.g. input:hover will add the selector to a key of "input". More... | |
Dictionary< string, Css.SelectorStyle > | Selectors =new Dictionary<string,Css.SelectorStyle>() |
A lookup of the selectors contained in this sheet to their parsed styles. More... | |
Private Member Functions | |
bool | TryReadBlockComment (MLLexer lexer, char currentCharacter) |
Attempts to read a block comment from the given lexer. More... | |
|
inline |
Creates an empty stylesheet that belongs to the given document.
document | The html document that this sheet belongs to. |
|
inline |
Creates a new stylesheet that belongs to the given document. Sets the given css text to it.
document | The html document that this sheet belongs to. |
text | Some css text structured into selectors and their properties that should be set into this stylesheet. |
|
inline |
Adds a modified form of the given selector. E.g. style might be the input:hover style. That style is a modified form of the "input" selector.
selector | The modified selector, e.g. "input". |
style | The style. |
|
inline |
Gets all the modified forms of the given selector. E.g. selector could be "input", in which case there may be ":hover",":focus" etc.
selector | The selector to search for. |
|
inline |
Attempts to get a style from this sheet by selector.
selector | The selector to lookup. |
|
inline |
Keeps reading selectors and their properties until a > or the end of the css is reached.
css | The css text to parse. |
|
inline |
Creates a new selector block for the given selector/modifier combo.
|
inlineprivate |
Attempts to read a block comment from the given lexer.
lexer | The lexer to read it from. |
currentCharacter | The next character in the lexer. |
Document PowerUI.Css.StyleSheet.Document |
The html document that this sheet belongs to.
Dictionary<string,List<Css.SelectorStyle> > PowerUI.Css.StyleSheet.ModifiedSelectors |
A lookup of the selectors that have modified forms. E.g. input:hover will add the selector to a key of "input".
Dictionary<string,Css.SelectorStyle> PowerUI.Css.StyleSheet.Selectors =new Dictionary<string,Css.SelectorStyle>() |
A lookup of the selectors contained in this sheet to their parsed styles.