1 | const hashColorPattern = /^#[0-9a-fA-F]{6}$|^#[0-9a-fA-F]{3}$/;
|
2 | const unpaddedFractionalNumbersPattern = /\.[0-9]/;
|
3 |
|
4 | const isMixinToken = (token) => {
|
5 | const [, symbol] = token;
|
6 | const [char] = symbol;
|
7 |
|
8 | return (
|
9 | (char === '.' || char === '#') &&
|
10 | // ignore hashes used for colors
|
11 | hashColorPattern.test(symbol) === false &&
|
12 | // ignore dots used for unpadded fractional numbers
|
13 | unpaddedFractionalNumbersPattern.test(symbol) === false
|
14 | );
|
15 | };
|
16 |
|
17 | module.exports = { isMixinToken };
|