Skip to content

Commit 5e8b4c9

Browse files
committed
add @supports support
1 parent 39e89a4 commit 5e8b4c9

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ Compiler.prototype.charset = function(node){
113113
return '@charset ' + node.charset + ';\n';
114114
};
115115

116+
/**
117+
* Visit supports node.
118+
*/
119+
120+
Compiler.prototype.supports = function(node){
121+
return '@supports '
122+
+ node.supports
123+
+ ' {\n'
124+
+ this.indent(1)
125+
+ node.rules.map(this.visit, this).join('\n\n')
126+
+ this.indent(-1)
127+
+ '\n}';
128+
};
129+
116130
/**
117131
* Visit keyframes node.
118132
*/

test/cases/supports.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
@supports (display: flex) {
3+
div {
4+
display: flex;
5+
}
6+
7+
div {
8+
something: else;
9+
}
10+
}

0 commit comments

Comments
 (0)