How to use the @fortawesome/fontawesome-svg-core.config.familyPrefix 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 / vendor / broccoli-fontawesome-pack.js View on Github external
build() {
    if(this._isBuilt) return

    const pack = require(`@fortawesome/${this.options.pack}`)
    let selectedIcons;

    if(this.options.icons === 'all'){
      selectedIcons = Object.keys(pack[pack.prefix])
    } else {
      const prefix = config.familyPrefix;
      //Look for icons which already contain the prefix as eg `faPencil` or `fa-pencil` without catching `fax`
      const regexp = new RegExp(`^${prefix}([A-Z]|-)`);
      selectedIcons = this.options.icons.map(iconName => {
        if (!regexp.test(iconName)) {
          iconName = `${prefix}-${iconName}`;
        }

        return camelCase(iconName);
      });
    }

    const packageContents = `
      export {
        ${ selectedIcons.join(',') }
      }  from '@fortawesome/${this.options.pack}/index.es.js'
    `
github FortAwesome / vue-fontawesome / index.es.js View on Github external
render: function render(createElement, context) {
    var familyPrefix = config.familyPrefix;
    var props = context.props;


    var classes = objectWithKey('classes', [].concat(toConsumableArray(props.counter ? [familyPrefix + '-layers-counter'] : []), toConsumableArray(props.position ? [familyPrefix + '-layers-' + props.position] : [])));

    var transform = objectWithKey('transform', typeof props.transform === 'string' ? parse.transform(props.transform) : props.transform);

    var renderedText = text(props.value.toString(), _extends({}, transform, classes));

    var abstract = renderedText.abstract;


    if (props.counter) {
      abstract[0].attributes.class = abstract[0].attributes.class.replace('fa-layers-text', '');
    }
github FortAwesome / vue-fontawesome / index.es.js View on Github external
render: function render(createElement, context) {
    var familyPrefix = config.familyPrefix;
    var staticClass = context.data.staticClass;


    var classes = [familyPrefix + '-layers'].concat(toConsumableArray(context.props.fixedWidth ? [familyPrefix + '-fw'] : []));

    return createElement('div', _extends({}, context.data, {
      staticClass: addStaticClass(staticClass, classes)
    }), context.children);
  }
};