Skip to content

Commit f09fc7e

Browse files
committed
Accomodate to postcss-less@3
1 parent ff3c69b commit f09fc7e

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

lib/getOrderData.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ const calcRulePatternPriority = require('./calcRulePatternPriority');
88
module.exports = function getOrderData(expectedOrder, node) {
99
let nodeType;
1010

11-
if (node.type === 'decl') {
11+
if (isAtVariable(node)) {
12+
nodeType = 'at-variables';
13+
} else if (node.type === 'decl') {
1214
if (isCustomProperty(node.prop)) {
1315
nodeType = 'custom-properties';
1416
} else if (isDollarVariable(node.prop)) {
1517
nodeType = 'dollar-variables';
16-
} else if (isAtVariable(node.prop)) {
17-
nodeType = 'at-variables';
1818
} else if (isStandardSyntaxProperty(node.prop)) {
1919
nodeType = 'declarations';
2020
}

lib/isAtVariable.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
/**
2-
* Check whether a property is a @-variable
3-
*
4-
* @param {string} property
5-
* @return {boolean} If `true`, property is a @-variable
2+
* Check whether a property is a @-variable (Less)
63
*/
7-
'use strict';
84

9-
module.exports = function isAtVariable(property) {
10-
return property[0] === '@';
5+
module.exports = function isAtVariable(node) {
6+
return node.type === 'atrule' && node.variable;
117
};

0 commit comments

Comments
 (0)