UNPKG

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