How to use the css-select.is 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 department-stockholm / svgsus / lib / plugins / insert-style.js View on Github external
parent.content.forEach(elem => {
    if (is(proxy(elem), rule.selector)) {
      const style = elem.hasAttr('style') ? elem.attr('style').value.split(';') : []
      for (let key in rule.declarations) {
        style.push(`${key}: ${rule.declarations[key]};`)
      }
      elem.addAttr({
        name: 'style',
        local: 'style',
        value: style.join(' '),
        prefix: ''
      })
    }
    if (!elem.isEmpty()) {
      walk(elem, rule)
    }
  })
}
github daud-io / daud / Game.Engine / wwwroot / src / parser / parseTheme.js View on Github external
function selectorMatches(selector, selectProps) {
    const thing = {
        type: "tag",
        name: selectProps.element,
        attribs: {
            id: selectProps.id,
            class: selectProps.class,
        },
    };
    return CSSselect.is(thing, selector);
}
github svg / svgo / lib / svgo / jsAPI.js View on Github external
JSAPI.prototype.matches = function(selector) {

   return cssSelect.is(this, selector, cssSelectOpts);

};
github spritejs / sprite-core / src / modules / dom / selector.js View on Github external
export function isMatched(elem, query) {
  return CSSselect.is(elem, resolveQuery(query), {adapter});
}
github alexjlockwood / ShapeShifter / src / app / scripts / svgo / lib / jsAPI.ts View on Github external
JSAPI.prototype.matches = function(selector) {
  return cssSelect.is(this, selector, cssSelectOpts);
};
github ecomfe / htmlcs / lib / element.js View on Github external
matches: function (selectors) {
        return cssSelect.is(this, selectors);
    },
github spritejs / sprite-core / lib / modules / dom / selector.js View on Github external
function isMatched(elem, query) {
  return CSSselect.is(elem, resolveQuery(query), {
    adapter: adapter
  });
}

css-select

a CSS selector compiler/engine

BSD-2-Clause
Latest version published 2 years ago

Package Health Score

82 / 100
Full package analysis