Skip to content

Commit 8b5c90f

Browse files
committed
fix keyframes declaration newlines
1 parent 89f7f22 commit 8b5c90f

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

examples/keyframes.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
@-webkit-keyframes fade {
22
from {
33
opacity: 0;
4+
foo: 'bar';
45
}
56
to {
67
opacity: 1;
8+
bar: 'baz';
79
}
810
}

examples/keyframes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ var parse = require('css-parse')
99
, read = fs.readFileSync
1010
, css = read('examples/keyframes.css', 'utf8');
1111

12-
console.log(stringify(parse(css), { compress: true }));
12+
console.log(stringify(parse(css), { compress: false }));

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Compiler.prototype.keyframe = function(node){
110110
+ ' {\n'
111111
+ node.declarations.map(function(node){
112112
return ' ' + self.declaration(node);
113-
}).join(';')
113+
}).join(';\n')
114114
+ '\n }\n'
115115
};
116116

@@ -128,7 +128,7 @@ Compiler.prototype.rule = function(node){
128128

129129
return node.selector
130130
+ ' {\n'
131-
+ node.declarations.map(this.declaration.bind(this)).join('\n')
131+
+ node.declarations.map(this.declaration.bind(this)).join(';\n')
132132
+ '\n}';
133133
};
134134

@@ -141,5 +141,5 @@ Compiler.prototype.declaration = function(node){
141141
return node.property + ':' + node.value;
142142
}
143143

144-
return ' ' + node.property + ': ' + node.value + ';';
144+
return ' ' + node.property + ': ' + node.value;
145145
};

test/cases/keyframes.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
@keyframes fade {
22
from {
33
opacity: 0;
4-
opacity: 1;
4+
opacity: 1
55
}
66

77
to {
8-
opacity: 1;
8+
opacity: 1
99
}
1010
}

test/cases/media.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
@media screen, projection {
22
html {
33
background: #fffef0;
4-
color: #300;
4+
color: #300
55
}
66

77
body {
88
max-width: 35em;
9-
margin: 0 auto;
9+
margin: 0 auto
1010
}
1111
}
1212

1313
@media print {
1414
html {
1515
background: #fff;
16-
color: #000;
16+
color: #000
1717
}
1818

1919
body {
2020
padding: 1in;
21-
border: 0.5pt solid #666;
21+
border: 0.5pt solid #666
2222
}
2323
}

test/cases/rules.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
tobi {
22
name: 'tobi';
3-
age: 2;
3+
age: 2
44
}
55

66
loki {
77
name: 'loki';
8-
age: 1;
8+
age: 1
99
}

0 commit comments

Comments
 (0)