Requires

Provides

License:
MIT
Authors:
Thomas Aylott
  1. 14
;(function(exports){

  1. 18
var UNDEF = {undefined:1}

  1. 21
  2. 22
  3. 23
  4. 24
  5. 25
var SheetParser = UNDEF[typeof require] ? exports.SheetParser : require('./SheetParser.CSS').SheetParser exports.Sheet = Sheet

  1. 32
  2. 33
  3. 34
  4. 35
  5. 36
  6. 37
  7. 38
  8. 39
  9. 40
  10. 41
  11. 42
  12. 43
  13. 44
  14. 45
  15. 46
  16. 47
  17. 48
  18. 49
  19. 50
  20. 51
  21. 52
  22. 53
  23. 54
  24. 55
  25. 56
  26. 57
  27. 58
  28. 59
  29. 60
Sheet.version = '1.0.2 dev' function Sheet(cssText){ if (this instanceof Sheet) this.initialize(cssText) else return Sheet.from(cssText) } Sheet.from = function(cssText){ return new Sheet(cssText) } Sheet.prototype = { parser: SheetParser.CSS, initialize: function(cssText){ this.cssText = cssText || '' this.style = this.rules = this.cssRules = this.parser.parse(this.cssText) var self = this }, update: function(){ var cssText = '', i = -1, rule, rules = this.style || this.rules || this.cssRules while ((rule = rules[++i])){ if (typeof rule == 'object'){

cssRule

  1. 62
  2. 63
  3. 64
if (this.update) rule.cssText = this.update.call(rule) cssText += rule.cssText = rule.selectorText + '{' + rule.cssText + '}' } else {

style key/value

  1. 66
  2. 67
  3. 68
  4. 69
  5. 70
  6. 71
  7. 72
  8. 73
  9. 74
  10. 75
  11. 76
  12. 77
  13. 78
  14. 79
  15. 80
  16. 81
cssText += rule + ':' cssText += rules[rule] + ';' } } if (rules.selectorText) return rules.cssText = rules.selectorText + '{' + cssText + '}' return rules.cssText = cssText } } Sheet.prototype.toString = Sheet.prototype.update }(typeof exports != 'undefined' ? exports : this));