How to use the dom function from @fortawesome/fontawesome-svg-core

Find comprehensive JavaScript @fortawesome/fontawesome-svg-core.dom code examples handpicked from public code repositorys.

55
56
57
58
59
60
61
62
63
64
let ampcss = ""
try {
  ampcss += "/*Based on Bootstrap v4.1.3 (https://getbootstrap.com)|Copyright 2011-2018 The Bootstrap Authors|Copyright 2011-2018 Twitter, Inc.|Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)*/\n"
  ampcss += (await promisify(sass.render)({ file: "theme/styl/amp/amp_main.sass" })).css.toString()
  ampcss += "\n"
  ampcss += fontawesome.dom.css()
  ampcss += "\n"
  ampcss = new CleanCss().minify(ampcss).styles.replace(/!important/g, "").replace(/@charset "UTF-8";/g, "").replace(/@-ms-viewport{width:device-width}/g, "")

  glog(`making amp css: ${Buffer.byteLength(ampcss)}Byte`)
fork icon11
star icon1
watch icon0

4
5
6
7
8
9
10
11
12
13
  setHeadComponents([
    React.createElement('style', {
      key: 'gatsby-plugin-fontawesome_css',
      type: 'text/css',
      dangerouslySetInnerHTML: {
        __html: fontawesome.dom.css(),
      },
    }),
  ])
}
fork icon0
star icon0
watch icon0