How to use the @pluginjs/styled.contentWidth function in @pluginjs/styled

To help you get started, we’ve selected a few @pluginjs/styled 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 pluginjs / pluginjs / modules / choice / src / main.js View on Github external
updateOverflow() {
    if (this.options.overflow === false) {
      return
    }
    const containerWidth = contentWidth(parent(this.$wrap))
    const width = contentWidth(this.$wrap)
    let totalWidth
    const $items = []

    if (this.$wrap.scrollWidth > containerWidth) {
      append(this.$toggle, this.$wrap)

      totalWidth = outerWidth(this.$toggle)
      childrenMatchSelector('[data-value]', this.$wrap).forEach($item => {
        const itemWidth = outerWidth($item)
        $item.dataset.width = itemWidth
        totalWidth += itemWidth
        if (totalWidth > width) {
          $items.push($item)
        }
      })
github pluginjs / pluginjs / modules / choice / src / main.js View on Github external
updateOverflow() {
    if (this.options.overflow === false) {
      return
    }
    const containerWidth = contentWidth(parent(this.$wrap))
    const width = contentWidth(this.$wrap)
    let totalWidth
    const $items = []

    if (this.$wrap.scrollWidth > containerWidth) {
      append(this.$toggle, this.$wrap)

      totalWidth = outerWidth(this.$toggle)
      childrenMatchSelector('[data-value]', this.$wrap).forEach($item => {
        const itemWidth = outerWidth($item)
        $item.dataset.width = itemWidth
        totalWidth += itemWidth
        if (totalWidth > width) {
          $items.push($item)
        }
      })
      $items.reverse().forEach($item => {