How to use hyperhtml-style - 2 common examples

To help you get started, we’ve selected a few hyperhtml-style 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 WebReflection / lighterhtml-plus / esm / tagger.js View on Github external
attribute(node, name, original) {
    const isSVG = this.type === 'svg';
    switch (name) {
      case 'class':
        if (isSVG)
          return hyperAttribute(node, original);
        name = 'className';
      case 'data':
      case 'props':
        return hyperProperty(node, name);
      case 'style':
        return hyperStyle(node, original, isSVG);
      case 'ref':
        return hyperRef(node);
      default:
        if (name.slice(0, 1) === '.')
          return hyperSetter(node, name.slice(1), isSVG);
        if (name.slice(0, 2) === 'on')
          return hyperEvent(node, name);
        if (name in node && !(isSVG || readOnly.test(name)))
          return hyperProperty(node, name);
        return hyperAttribute(node, original);

    }
  },
github WebReflection / lighterhtml / esm / tagger.js View on Github external
attribute(node, name, original) {
    const isSVG = this.type === 'svg';
    switch (name) {
      case 'class':
        if (isSVG)
          return hyperAttribute(node, original);
        name = 'className';
      case 'data':
      case 'props':
        return hyperProperty(node, name);
      case 'style':
        return hyperStyle(node, original, isSVG);
      case 'ref':
        return hyperRef(node);
      default:
        if (name.slice(0, 1) === '.')
          return hyperSetter(node, name.slice(1), isSVG);
        if (name.slice(0, 2) === 'on')
          return hyperEvent(node, name);
        if (name in node && !(isSVG || readOnly.test(name)))
          return hyperProperty(node, name);
        return hyperAttribute(node, original);

    }
  },

hyperhtml-style

The hyperHTML's html/svg style updater

ISC
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular hyperhtml-style functions