Giter Club home page Giter Club logo

svelte-fontawesome's People

Contributors

yukipastelcat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

synsa

svelte-fontawesome's Issues

Error when implementing example code

The current example code includes an error.

<script>
import { library } from '@fortawesome/fontawesome-svg-core';
import { faSmileWink as fasSmileWink } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon, FontAwesomeLayers, FontAwesomeLayersText } from 'fontawesome-svelte';

library.add(faSmileWink);
</script>

<FontAwesomeIcon icon={fasSmileWink} />
<FontAwesomeIcon icon={['fas', 'smile-wink']} />
<!-- The solid style is implicit -->
<FontAwesomeIcon icon="smile-wink" />

The line library.add(faSmileWink); has to be library.add(fasSmileWink); to work properly.

Tailwind, fontawesome-svelte adds commas which breaks tailwind

Hi,

I'm using Tailwind and trying to add a class to the fontawesomeIcon component. Fontawesome-svelete adds a comma when it compiles to each class which breaks tailwind.

Example:

<FontAwesomeIcon icon={faSun} class="text-yellow-300 dark:text-red-500" />

In the inspector, the HTML class looks like this

<svg
aria-hidden="true" 
focusable="false" 
data-prefix="fas" 
data-icon="cloud-moon" 
class="svg-inline--fa fa-cloud-moon fa-w-18 text-yellow-300,dark:text-red-500"
restofSVGCode....
</svg>

A simple work-around is just to wrap the FontAwesomeIcon component in a div or I tag, and then add the tailwind info there. However, not sure if this an issue we could fix in FontAwesomeIcon and rid of the adding of commas?

Cheers,
DMDComposer

Sapper needs it to expose component source

Hello,

I migrated my app from svelte to sapper, which requires fontawesome-svelte to keep Icon.svelte component in its npm package ( for SSR purpose ).

Would you mind to keep the src folder when publish the npm package ? It will solve the problem in sapper mode.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.