Sha256: 3c5cd79ef63c28e37c06827b405a736671e739bd926171eb1e4a2939cca33a6b
Contents?: true
Size: 742 Bytes
Versions: 23
Compression:
Stored size: 742 Bytes
Contents
'use strict'; const hasInterpolation = require('../utils/hasInterpolation'); /** * Check whether a selector is standard * * @param {string} selector * @returns {boolean} */ module.exports = function (selector) { // SCSS or Less interpolation if (hasInterpolation(selector)) { return false; } // SCSS placeholder selectors if (selector.startsWith('%')) { return false; } // Less :extend() if (/:extend(\(.*?\))?/.test(selector)) { return false; } // Less mixin with resolved nested selectors (e.g. .foo().bar or .foo(@a, @b)[bar]) if (/\.[a-z0-9-_]+\(.*\).+/i.test(selector)) { return false; } // ERB template tags if (selector.includes('<%') || selector.includes('%>')) { return false; } return true; };
Version data entries
23 entries across 23 versions & 1 rubygems