Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag invokement #87

Closed
basz opened this issue Jan 10, 2019 · 2 comments
Closed

tag invokement #87

basz opened this issue Jan 10, 2019 · 2 comments

Comments

@basz
Copy link
Contributor

basz commented Jan 10, 2019

{{fa-icon "igloo"}}

works but;

<i class="fas fa-igloo"></i>

does not.

Do I need to do something special?

environment.js contains;

fontawesome: {
      warnIfNoIconsIncluded: true,
      defaultPrefix: 'fas',
      icons: {
        'free-solid-svg-icons': 'all'
      }
    },
@jrjohnson
Copy link
Collaborator

For the most part you should stick with the {{fa-icon}} component, but if you need to replace specific <i> tags there is a helper for that. Using it in a component looks like:

import Component from '@ember/component';
import { dom } from '@fortawesome/fontawesome-svg-core';
import { next } from '@ember/runloop';

export default Component.extend({
  /**
   * Convert `<i>` into SVG icons
   * Uses: https://fontawesome.com/how-to-use/with-the-api/methods/dom-i2svg
   */
  didRender() {
    next(() => {
      dom.i2svg({node: this.element});
    });
  },
});

@jrjohnson
Copy link
Collaborator

I believe this is fixed by #88, but please re-open if I'm wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants