react-css-components
Version:
Define styled React components using CSS based module format
22 lines (17 loc) • 492 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isComponent = isComponent;
exports.isVariant = isVariant;
/**
* @copyright 2016-present, React CSS Components team
*
*/
var COMPONENT_RE = /^[a-zA-Z_0-9]+$/;
function isComponent(node) {
return node.type === 'rule' && COMPONENT_RE.exec(node.selector) && node.parent && node.parent.type === 'root';
}
function isVariant(node) {
return node.type === 'rule' && node.selector.charAt(0) === ':';
}