aboutsummaryrefslogtreecommitdiff
path: root/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Declaration.js
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2018-11-08 00:43:05 +0800
committerruki <waruqi@gmail.com>2018-11-07 22:18:30 +0800
commit89e95b3f143682ed9a006991bacf45c9dcba4818 (patch)
tree4f44cf41b828577d583890bdd5a1c31e8491a6ba /node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Declaration.js
parentaa7f0199255277949790b41c56e8ec97dd4f0da4 (diff)
downloadxmake-docs-vuepress.tar.gz
xmake-docs-vuepress.zip
remove node_modulesvuepress
Diffstat (limited to 'node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Declaration.js')
-rw-r--r--node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Declaration.js84
1 files changed, 0 insertions, 84 deletions
diff --git a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Declaration.js b/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Declaration.js
deleted file mode 100644
index dce27e21..00000000
--- a/node_modules/renderkid/lib/renderKid/styles/rule/declarationBlock/_Declaration.js
+++ /dev/null
@@ -1,84 +0,0 @@
-// Generated by CoffeeScript 1.9.3
-var _Declaration;
-
-module.exports = _Declaration = (function() {
- var self;
-
- self = _Declaration;
-
- _Declaration.importantClauseRx = /(\s\!important)$/;
-
- _Declaration.setOnto = function(declarations, prop, val) {
- var dec;
- if (!(dec = declarations[prop])) {
- return declarations[prop] = new this(prop, val);
- } else {
- return dec.set(val);
- }
- };
-
- _Declaration.sanitizeValue = function(val) {
- return String(val).trim().replace(/[\s]+/g, ' ');
- };
-
- _Declaration.inheritAllowed = false;
-
- function _Declaration(prop1, val) {
- this.prop = prop1;
- this.important = false;
- this.set(val);
- }
-
- _Declaration.prototype.get = function() {
- return this._get();
- };
-
- _Declaration.prototype._get = function() {
- return this.val;
- };
-
- _Declaration.prototype._pickImportantClause = function(val) {
- if (self.importantClauseRx.test(String(val))) {
- this.important = true;
- return val.replace(self.importantClauseRx, '');
- } else {
- this.important = false;
- return val;
- }
- };
-
- _Declaration.prototype.set = function(val) {
- val = self.sanitizeValue(val);
- val = this._pickImportantClause(val);
- val = val.trim();
- if (this._handleNullOrInherit(val)) {
- return this;
- }
- this._set(val);
- return this;
- };
-
- _Declaration.prototype._set = function(val) {
- return this.val = val;
- };
-
- _Declaration.prototype._handleNullOrInherit = function(val) {
- if (val === '') {
- this.val = '';
- return true;
- }
- if (val === 'inherit') {
- if (this.constructor.inheritAllowed) {
- this.val = 'inherit';
- } else {
- throw Error("Inherit is not allowed for `" + this.prop + "`");
- }
- return true;
- } else {
- return false;
- }
- };
-
- return _Declaration;
-
-})();