How to use the @fortawesome/fontawesome-svg-core.config.replacementClass function in @fortawesome/fontawesome-svg-core

To help you get started, we’ve selected a few @fortawesome/fontawesome-svg-core 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 neos / neos-ui / packages / react-ui-components / src / Icon / index.js View on Github external
import {library, config} from '@fortawesome/fontawesome-svg-core';
import {fab} from '@fortawesome/free-brands-svg-icons';
import {fas} from '@fortawesome/free-solid-svg-icons';
import {far} from '@fortawesome/free-regular-svg-icons';
import {themr} from '@friendsofreactjs/react-css-themr';
import identifiers from '../identifiers';
import style from './style.css';
import Icon from './icon';
/* eslint-disable no-unused-vars */
import faStyle from '@fortawesome/fontawesome-svg-core/styles.css';
/* eslint-enable no-unused-vars */

config.autoAddCss = false;
config.familyPrefix = 'neos-fa';
config.replacementClass = 'neos-svg-inline--fa';
library.add(fab, fas, far);

const ThemedIcon = themr(identifiers.icon, style)(Icon);

export default ThemedIcon;
github FortAwesome / ember-fontawesome / addon / components / fa-icon.js View on Github external
const renderedIcon = icon(iconLookup, o)

    if (renderedIcon) {
      const abstract = renderedIcon.abstract[0]
      this.set('children', abstract.children)
      abstract.attributes && Object.keys(abstract.attributes).forEach(attr => {
        if ( attr === 'style' ) {
          this.set('_frameworkStyle', abstract.attributes[attr])
        } else {
          this.set(attr, abstract.attributes[attr])
        }
      })
    } else {
      Ember.Logger.warn(`Could not find icon: iconName=${iconLookup.iconName}, prefix=${iconLookup.prefix}`)
      this.set('class', config.replacementClass)
      this.set('viewBox', '0 0 448 512')
    }
  }
});
github FortAwesome / angular-fontawesome / src / lib / shared / errors / not-found-icon-html.ts View on Github external
import { config } from '@fortawesome/fontawesome-svg-core';

export const faNotFoundIconHtml = `<svg viewBox="0 0 448 512" class="${config.replacementClass}"></svg>`;
github GSA / sam-ui-elements / src / ui-kit / experimental / icon / fa-icon / shared / errors / not-found-icon-html.ts View on Github external
import { config } from '@fortawesome/fontawesome-svg-core';

export const faNotFoundIconHtml = `<svg viewBox="0 0 448 512" class="${config.replacementClass}"></svg>`;
github FortAwesome / ember-fontawesome / lib / fontawesome-helpers.js View on Github external
function getReplacementClass() {
  return config.replacementClass;
}
github FortAwesome / ember-fontawesome / addon / components / fa-icon.js View on Github external
allClasses: computed('abstractIcon', 'attributes.class', 'class', function () {
    const abstractIcon = this.get('abstractIcon');
    if (!abstractIcon) {
      return config.replacementClass;
    }
    const attributes = this.get('attributes');
    const iconClasses = getWithDefault(attributes, 'class');

    return iconClasses;
  }),
  'data-prefix': computed('attributes.data-prefix', function () {