Skip to content

Commit

Permalink
Add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vovkasm committed Dec 18, 2016
1 parent 667b407 commit 78788ad
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/stylesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,29 @@ function makeRuleCtx (name, rest) {
return { name, rest }
}

/**
* Represents collections of all style rules.
*
**/
class Stylesheet {
constructor () {
this.rules = {}
}
/**
* Adds "default" lower priority rules to style sheet
*
* @param rules {Object} - key-value pairs, key is a selector, value is rule object
**/
addDefaultRules (rules) {
for (let selector in rules) {
this._addRule(selector, rules[selector], 0)
}
}
/**
* Adds rules to style sheet
*
* @param rules {Object} - key-value pairs, key is a selector, value is rule object
**/
addRules (rules) {
for (let selector in rules) {
this._addRule(selector, rules[selector], 1)
Expand Down

0 comments on commit 78788ad

Please sign in to comment.