How to use the css-select.pseudos function in css-select

To help you get started, we’ve selected a few css-select examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spritejs / sprite-core / lib / modules / dom / selector.js View on Github external
exports.querySelectorAll = querySelectorAll;
exports.querySelector = querySelector;
exports.isMatched = isMatched;
exports.compile = compile;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _utils = require("../../utils");

var CSSselect = require('css-select');

CSSselect.pseudos.hover = function (next) {
  return !!next.attr('__internal_state_hover_');
};

CSSselect.pseudos.active = function (next) {
  return !!next.attr('__internal_state_active_');
};

function isTag(elem) {
  return elem.nodeType === 1 || typeof elem.nodeType === 'string';
}

function getChildren(elem) {
  if (elem.scene_) {
    return [elem.scene_];
  }

  if (elem.layer_) {
    return [elem.layer_];
  }
github spritejs / sprite-core / src / modules / dom / selector.js View on Github external
import {parseColorString} from '../../utils';

const CSSselect = require('css-select');

CSSselect.pseudos.hover = (next) => {
  return !!next.attr('__internal_state_hover_');
};

CSSselect.pseudos.active = (next) => {
  return !!next.attr('__internal_state_active_');
};

function isTag(elem) {
  return elem.nodeType === 1 || typeof elem.nodeType === 'string';
}

function getChildren(elem) {
  if(elem.scene_) {
    return [elem.scene_];
  }
  if(elem.layer_) {
github spritejs / sprite-core / src / modules / dom / selector.js View on Github external
import {parseColorString} from '../../utils';

const CSSselect = require('css-select');

CSSselect.pseudos.hover = (next) => {
  return !!next.attr('__internal_state_hover_');
};

CSSselect.pseudos.active = (next) => {
  return !!next.attr('__internal_state_active_');
};

function isTag(elem) {
  return elem.nodeType === 1 || typeof elem.nodeType === 'string';
}

function getChildren(elem) {
  if(elem.scene_) {
    return [elem.scene_];
  }
  if(elem.layer_) {
    return [elem.layer_];
  }
  return Array.from(elem.childNodes || []);
}
github spritejs / sprite-core / lib / modules / dom / selector.js View on Github external
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.querySelectorAll = querySelectorAll;
exports.querySelector = querySelector;
exports.isMatched = isMatched;
exports.compile = compile;

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));

var _utils = require("../../utils");

var CSSselect = require('css-select');

CSSselect.pseudos.hover = function (next) {
  return !!next.attr('__internal_state_hover_');
};

CSSselect.pseudos.active = function (next) {
  return !!next.attr('__internal_state_active_');
};

function isTag(elem) {
  return elem.nodeType === 1 || typeof elem.nodeType === 'string';
}

function getChildren(elem) {
  if (elem.scene_) {
    return [elem.scene_];
  }

css-select

a CSS selector compiler/engine

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

82 / 100
Full package analysis