How to use the css-select.selectOne 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 TrySound / postcss-inline-svg / lib / processors.js View on Github external
return dom => {
    applyParams(params)(selectOne("svg", dom));
  };
}
github superfly / fly / packages / v8env / src / document.ts View on Github external
public querySelector(selector) {
    const found = css.selectOne(selector, this._dom)
    if (!found) {
      return null
    }
    return new Element(this._withParent(found))
  }
github spritejs / sprite-core / src / modules / dom / selector.js View on Github external
export function querySelector(query, elems) {
  return CSSselect.selectOne(resolveQuery(query), elems, {adapter});
}
github ecomfe / htmlcs / lib / element.js View on Github external
querySelector: function (selector) {
        return cssSelect.selectOne(selector, this) || null;
    },
github TrySound / postcss-inline-svg / lib / processors.js View on Github external
return dom => {
    const svg = selectOne("svg", dom);

    Object.keys(selectors).forEach(selector => {
      selectAll(selector, svg).forEach(applyParams(selectors[selector]));
    });
  };
}
github TrySound / postcss-inline-svg / src / lib / apply-data.js View on Github external
export default function applyData(source, data) {
    const dom = parse(source, { xmlMode: true });
    const svg = dom ? selectOne('svg', dom) : null;

    if (!svg) {
        throw Error('Invalid loaded xml format');
    }

    data = data || {};
    const root = data.root || {};
    const selectors = data.selectors || {};

    assign(svg.attribs, root);

    Object.keys(selectors).forEach(selector => {
        const attribs = selectors[selector];
        const elements = selectAll(selector, svg);

        elements.forEach(element => {
github spritejs / sprite-core / lib / modules / dom / selector.js View on Github external
function querySelector(query, elems) {
  return CSSselect.selectOne(resolveQuery(query), elems, {
    adapter: adapter
  });
}
github alexjlockwood / ShapeShifter / src / app / scripts / svgo / lib / jsAPI.ts View on Github external
JSAPI.prototype.querySelector = function(selectors) {
  return cssSelect.selectOne(selectors, this, cssSelectOpts);
};
github svg / svgo / lib / svgo / jsAPI.js View on Github external
JSAPI.prototype.querySelector = function(selectors) {

   return cssSelect.selectOne(selectors, this, cssSelectOpts);

};

css-select

a CSS selector compiler/engine

BSD-2-Clause
Latest version published 2 years ago

Package Health Score

82 / 100
Full package analysis