UNPKG

689 BJavaScriptView Raw
1'use strict';
2
3const hasInterpolation = require('../utils/hasInterpolation');
4
5/**
6 * Check whether a property is standard
7 *
8 * @param {string} property
9 * @returns {boolean}
10 */
11module.exports = function (property) {
12 // SCSS var (e.g. $var: x), list (e.g. $list: (x)) or map (e.g. $map: (key:value))
13 if (property.startsWith('$')) {
14 return false;
15 }
16
17 // Less var (e.g. @var: x)
18 if (property.startsWith('@')) {
19 return false;
20 }
21
22 // Less append property value with space (e.g. transform+_: scale(2))
23 if (property.endsWith('+') || property.endsWith('+_')) {
24 return false;
25 }
26
27 // SCSS or Less interpolation
28 if (hasInterpolation(property)) {
29 return false;
30 }
31
32 return true;
33};