How to use @pacote/pixels - 1 common examples

To help you get started, we’ve selected a few @pacote/pixels 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 goblindegook / littlefoot / src / dom / footnote.ts View on Github external
activate: onActivate => {
      button.classList.add(CLASS_CHANGING)
      button.setAttribute('aria-expanded', 'true')
      button.classList.add(CLASS_ACTIVE)

      button.insertAdjacentElement('afterend', popover)

      popover.style.maxWidth = `${document.body.clientWidth}px`
      const contentMaxHeight = getStyle(content, 'maxHeight')
      maxHeight = Math.round(pixels(contentMaxHeight, content))

      if (typeof onActivate === 'function') {
        onActivate(popover, button)
      }
    },

@pacote/pixels

Converts CSS unit lengths to pixels.

MIT
Latest version published 9 months ago

Package Health Score

65 / 100
Full package analysis

Popular @pacote/pixels functions