How to use @pluginjs/font-picker - 5 common examples

To help you get started, we’ve selected a few @pluginjs/font-picker 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 / font-picker / samples / src / sections / default / index.js View on Github external
const init = () => {
  return FontPicker.of(element, {
    source(resolve) {
      resolve(source)
    },
    manage(resolve) {
      resolve(source[0])
    }
  })
}
let api = init()
github pluginjs / pluginjs / modules / font-picker / samples / src / sections / disabled / index.js View on Github external
],
  load($item, fontFamily, text) {
    WebFont.load({
      google: {
        families: [fontFamily],
        text
      },
      fontactive() {
        $item.style.fontFamily = fontFamily
      }
    })
  }
}

const element = query('#disabled .example')
FontPicker.of(element, {
  source
})
github pluginjs / pluginjs / modules / font-picker / samples / src / sections / multiple-sources / index.js View on Github external
load($item, fontFamily, text) {
      WebFont.load({
        google: {
          families: [fontFamily],
          text
        },
        fontactive() {
          $item.style.fontFamily = fontFamily
        }
      })
    }
  }
]

const element = query('#multiple-sources .example')
FontPicker.of(element, {
  source
})
github pluginjs / pluginjs / modules / font-editor / src / fontFamily.js View on Github external
'fontFamily'
      ),
      typeface: this.instance.translate('typeface')
    })
    this.$wrap = parseHTML(html)

    this.$content = query(`.${this.instance.classes.FIELDCONTENT}`, this.$wrap)
    this.element = query(`.${this.instance.classes.FONTPICKER}`, this.$content)

    const options = {}

    if (this.instance.options.fontFamily.source) {
      options.source = this.instance.options.fontFamily.source
    }

    this.FONTPICKER = FontPicker.of(this.element, {
      ...options,
      keyboard: true,
      clearable: false,
      onChange: value => {
        if (this.instance.is('disabled')) {
          return
        }
        this.instance.value.fontFamily = JSON.parse(value)
      }
    })
  }
github pluginjs / pluginjs / modules / font-picker / samples / src / sections / group / index.js View on Github external
load($item, fontFamily, text) {
    WebFont.load({
      google: {
        families: [fontFamily],
        text
      },
      fontactive() {
        $item.style.fontFamily = fontFamily
      }
    })
  }
}

const element = query('#group .example')

FontPicker.of(element, {
  source(resolve) {
    resolve(source)
  }
})

@pluginjs/font-picker

A flexible modern icon picker js plugin.

GPL-3.0
Latest version published 2 years ago

Package Health Score

46 / 100
Full package analysis

Popular @pluginjs/font-picker functions

Similar packages