lattyware / elm-fontawesome Goto Github PK
View Code? Open in Web Editor NEWFontAwesome for Elm.
Home Page: https://package.elm-lang.org/packages/lattyware/elm-fontawesome/latest/
License: MIT License
FontAwesome for Elm.
Home Page: https://package.elm-lang.org/packages/lattyware/elm-fontawesome/latest/
License: MIT License
I have a large "editor panel" rendered in svg next to a sidebar where the user can select a tool. Currently the tools each use a font awesome icon and it would be great to use the font awesome icons in the svg editor panel as well. (For example, to show the trash can above a token when you have the "delete" tool activated and hold down the left mouse button.)
For this I need a way to get the svg path element from the libary. It looks like the private function Icon.corePath
does essentially what I need, save for the extra fill
property.
import ...
trashPath : Svg msg
trashPath = Icon.svgPath [ Svg.Attributes.fill "#F00", .. ] Solid.trash
Do you think exposing a function like this fits your library?
The master branch version uses Fontawesome v5.12 but the released version on elm packages is older. Please consider publishing the latest version on the master branch.
Potentially this would also be an opportunity to upgrade to v5.14.
Thank you for the creation and publising of this library.
Currently, we can generate invalid output in specific situations:
When masks are created, the official library generates random IDs to avoid collisions from multiple icons on the same page. In Elm, this would be a real pain to do (you would have to provide randomness and distribute it among icons you use). We instead use fixed IDs based on the icon names. This will produce incorrect output (multiple nodes with the same ID) in some cases. That said, all browsers I've tested seem to handle this case fine, and it is only an issue if you reuse the same icon in a mask with different transforms in the same page (otherwise as the name of the icon is used to differentiate, the only collision will be between duplicated elements in defs, which are would be exactly the same unless a different transform is used.)
While I believe this is a reasonable trade-off that won't affect most people, if there is demand for it, another interface that allows the user to pass in IDs (probably with a convenience utility to do this using a randomness seed that is passed around) is possible and would fix the issue.
In my application i use these icons but are visible only if i using Firefox. Do i have done some mistakes or is a bug? I run the browser on OSX.
Seems like my version of Node doesn't have Array.prototype.flatMap
Node v 10.3.0
NPM v 6.1.0
I see you have Babel, but maybe the config should be updated?
It would be great to be able to use latest font-awesome version. Would that be possible?
If I can support or even "compile" the latest version to elm on my own please let me know.
Thanks, Nils
The idea to enhance is to change the signature of functions that have a lot of arguments with a verbose record.
That would be more informative IMHO compared to normal arguments.
I can drop a PR if you like.
Hello, I get this error:
PROBLEM BUILDING DEPENDENCIES - I ran into a compilation error when trying to build the following package:
lattyware/elm-fontawesome 7.0.0
This probably means it has package constraints that are too wide. It may be
possible to tweak your elm.json to avoid the root problem as a stopgap. Head
over to https://elm-lang.org/community to get help figuring out how to take this
path!
Note: To help with the root problem, please report this to the package author
along with the following information:
elm/core 1.0.5
elm/html 1.0.0
elm/svg 1.0.1
If you want to help out even more, try building the package locally. That should
give you much more specific information about why this package is failing to
build, which will in turn make it easier for the package author to fix it!
๐
Hi @Lattyware,
thank you for this amazing Elm package. By far, the best Font Awesome implementation. I suppose this issue #7 would automate what I'm about to request? Not sure, so here I am:
Please update the package to include newer icons since release. I'm using this package and need to make a CSS audio player for my site, and some icons are missing (i.e: https://fontawesome.com/icons/shuffle?s=solid and https://fontawesome.com/icons/repeat?s=solid)
Looking forward to updates (generally speaking, not with my specific request) and improvements of this great package :)
Best,
I wish there was a function to retrieve an Icon
(or a Maybe Icon
) using the class name as String
. In my case the class names are stored in the database, so a mapping is needed.
It would be nice to do some testing against the official FontAwesome library, to check that the Elm is producing the same output (where appropriate and possible).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.