3
tree.Rule = function (name, value, important, index, currentFileInfo, inline) {
5
this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
6
this.important = important ? ' ' + important.trim() : '';
8
this.currentFileInfo = currentFileInfo;
9
this.inline = inline || false;
11
if (name.charAt(0) === '@') {
13
} else { this.variable = false }
16
tree.Rule.prototype = {
18
accept: function (visitor) {
19
this.value = visitor.visit(this.value);
21
toCSS: function (env) {
22
if (this.variable) { return "" }
25
return this.name + (env.compress ? ':' : ': ') +
26
this.value.toCSS(env) +
27
this.important + (this.inline ? "" : ";");
31
e.filename = this.currentFileInfo.filename;
36
eval: function (env) {
37
var strictMathsBypass = false;
38
if (this.name === "font" && env.strictMaths === false) {
39
strictMathsBypass = true;
40
env.strictMaths = true;
43
return new(tree.Rule)(this.name,
46
this.index, this.currentFileInfo, this.inline);
49
if (strictMathsBypass) {
50
env.strictMaths = false;
54
makeImportant: function () {
55
return new(tree.Rule)(this.name,
58
this.index, this.currentFileInfo, this.inline);
62
})(require('../tree'));