Skip to content

Commit f2db919

Browse files
committed
Merge pull request #23 from csscomb/m.atrules
stick-brace: at-rules support added
2 parents 6fb8ccd + 8d67b8b commit f2db919

3 files changed

Lines changed: 53 additions & 2 deletions

File tree

lib/options/stick-brace.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ module.exports = {
2020
* @param {node} node
2121
*/
2222
process: function(nodeType, node) {
23-
if (nodeType === 'selector') {
23+
if (nodeType === 'selector' || nodeType === 'atruler') {
2424
for (var i = node.length; i--;) {
2525
var nodeItem = node[i];
26-
if (nodeItem[0] === 'simpleselector') {
26+
if (nodeItem[0] === 'simpleselector' || nodeItem[0] === 'atrulerq') {
2727
if (nodeItem[nodeItem.length - 1][0] === 's') nodeItem.pop();
2828
nodeItem.push(['s', this._value]);
2929
break;

test/integral.expect.css

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,32 @@ a, b, i /* foobar */
1515
border-bottom: 1px solid red;
1616
}
1717

18+
@media all /* media */
19+
{ /* foobar */
20+
.input__control
21+
{
22+
color: #000;
23+
font-size: 100%;
24+
margin: 0;
25+
position: relative;
26+
width: 100%;
27+
z-index: 3;
28+
}}
29+
30+
@media screen and (min-width: 35em) /* screen */,
31+
print and (min-width: 40em) /* print */
32+
{ /* foobar */
33+
.input__control
34+
{
35+
-moz-box-sizing: border-box;
36+
background: none;
37+
border: 0;
38+
box-sizing: border-box;
39+
outline: 0;
40+
padding: 0.4em 0;
41+
}
42+
}
43+
1844
/* Фигурные скобки. Вариант 2 */
1945
div
2046
{

test/integral.origin.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,31 @@ a, b, i /* foobar */ {
1212
border-bottom:1px solid red;
1313
}
1414

15+
@media all /* media */
16+
{ /* foobar */
17+
.input__control
18+
{
19+
color: #000;
20+
font-size: 100%;
21+
margin: 0;
22+
position: relative;
23+
width: 100%;
24+
z-index: 3;
25+
}}
26+
27+
@media screen and (min-width: 35em) /* screen */,
28+
print and (min-width: 40em) /* print */ { /* foobar */
29+
.input__control
30+
{
31+
-moz-box-sizing: border-box;
32+
background: none;
33+
border: 0;
34+
box-sizing: border-box;
35+
outline: 0;
36+
padding: 0.4em 0;
37+
}
38+
}
39+
1540
/* Фигурные скобки. Вариант 2 */
1641
div
1742
{

0 commit comments

Comments
 (0)