securityos/node_modules/stylelint/lib/utils/isScssVariable.js

22 lines
436 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
'use strict';
/**
* Check whether a property is SCSS variable
*
* @param {string} property
* @returns {boolean}
*/
module.exports = function isScssVariable(property) {
// SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value))
if (property.startsWith('$')) {
return true;
}
// SCSS var within a namespace (e.g. namespace.$var: x)
if (property.includes('.$')) {
return true;
}
return false;
};