All Projects → Lattyware → elm-fontawesome

Lattyware / elm-fontawesome

Licence: MIT license
FontAwesome for Elm.

Programming Languages

elm
856 projects

Labels

Projects that are alternatives of or similar to elm-fontawesome

Vectorlogozone
3,000+ gorgeous SVG logos, perfect for your README or credits page
Stars: ✭ 239 (+646.88%)
Mutual labels:  icons
Font Awesome
The iconic SVG, font, and CSS toolkit
Stars: ✭ 66,937 (+209078.13%)
Mutual labels:  icons
atom-perl6-editor-tools
A collection of useful Perl 6 editor tools
Stars: ✭ 19 (-40.62%)
Mutual labels:  icons
Flutter Icons
Customizable Icons for Flutter 💥
Stars: ✭ 241 (+653.13%)
Mutual labels:  icons
Flagkit
Beautiful flag icons for usage in apps and on the web.
Stars: ✭ 2,805 (+8665.63%)
Mutual labels:  icons
beautified-JOSM-preset
Improved version of the JOSM presets
Stars: ✭ 38 (+18.75%)
Mutual labels:  icons
Smart Hierarchy
Better hierarchy for Unity.
Stars: ✭ 234 (+631.25%)
Mutual labels:  icons
cryptofont
Cryptocurrency icon webfont and SVG
Stars: ✭ 149 (+365.63%)
Mutual labels:  icons
Ionicons
Premium hand-crafted icons built by Ionic, for Ionic apps and web apps everywhere 🌎
Stars: ✭ 15,802 (+49281.25%)
Mutual labels:  icons
react-native-paper-tabs
Smooth and fast cross platform Material Design Tabs for React Native Paper
Stars: ✭ 112 (+250%)
Mutual labels:  icons
Bforartists
Bforartists is a fork of the popular 3D software Blender, with the goal to improve the UI.
Stars: ✭ 240 (+650%)
Mutual labels:  icons
Materialdesign Webfont
@mdi/font Dist for Material Design Icons.
Stars: ✭ 253 (+690.63%)
Mutual labels:  icons
center.js
Center.js is a HTML5 Canvas based library that allows you to create simple text based icons, avatars, logos, and more.
Stars: ✭ 85 (+165.63%)
Mutual labels:  icons
Silver
A cross-shell customizable powerline-like prompt with icons
Stars: ✭ 238 (+643.75%)
Mutual labels:  icons
svg-chameleon
Easily modify stroke-widths and colors of your SVGs via CSS!
Stars: ✭ 15 (-53.12%)
Mutual labels:  icons
Sketch Feather
Sketch library for Feather icons
Stars: ✭ 237 (+640.63%)
Mutual labels:  icons
weather icons
Flutter library for using erikflowers/weather-icons. An icon pack with over 200 weather icons.
Stars: ✭ 12 (-62.5%)
Mutual labels:  icons
perfect-ubuntu
js dev setup, just for fun
Stars: ✭ 14 (-56.25%)
Mutual labels:  icons
favicon
🖼 An attempt to capture all possible favicons for a web project.
Stars: ✭ 17 (-46.87%)
Mutual labels:  icons
majesticons
A versatile, beautiful, and scalable iconset. 760 icons each in line and solid style.
Stars: ✭ 98 (+206.25%)
Mutual labels:  icons

FontAwesome for Elm.

Generator Build Status Package Publish Status Elm package FontAwesome version

This is an Elm library for FontAwesome. This does not rely on any external javascript (e.g: using the JavaScript library to replace nodes, which can cause issues with Elm), and unlike the font, only includes the icons you use in your Elm code if you minify your output, as well as providing access to the powerful transformation, layering, text, counter, and masking features.

How it works.

This package is generated using the FontAwesome SVG JavaScript Core. If you are interested in how this is done, would like to manually subset the icons (which shouldn't be necessary due to tree-shaking in most cases), or want to update to a new version of FontAwesome (do also feel free to submit an issue if the library is out of date) please see the generator repo.

This does mean that this is a big package, the compiled Elm code weighs in at over 1MB. This would naturally not be ideal in most situations. The good news is that it is easy to minify out any unused icons thanks to Elm's pure nature. If you are already minifying your compiled Elm (which is good practice anyway), then you don't need to do anything more. If you are not, then it is simple to do. This will result in perfect subsetting - you only ship the icons you use.

Using the elm library.

The easiest way to use the library is to install the elm package directly: elm install lattyware/elm-fontawesome.

Once you have done that, the best place to start is at the elm-fontawesome-example project which should give you a good idea of what you can do and how to do it. For more detail on the available options, please see the documentation, which gives an exhaustive description.

Function names.

In general, names are just the camel-cased version of the original name. E.g: arrow-alt-circle-right becomes FontAwesome.Solid.arrowAltCircleRight. Where the first character of the name isn't valid as an Elm identifier, the name is prefixed with fa, e.g: 500px becomes FontAwesome.Brands.fa500px. Note this applies to the FontAwesome.Attributes module as well, so 2x becomes FontAwesome.Attributes.fa2x.

Required CSS.

FontAwesome does require some CSS styles. You can either use FontAwesome.Styles.css to include an HTML style node with the necessary code directly in your page in Elm, or you can include the CSS from @fortawesome/fontawesome-svg-core/styles.css in your page however you choose. Do note you do not need the webfont version - the icons in this package are rendered with SVG, and while that CSS will work, you will make your users load a webfont for no reason.

Styling icons.

Font Awesome supports styling your icons in various ways. These styles are exposed as attributes for the various classes in the FontAwesome.Attributes module.

Differences in behaviour from the official library.

While effort has been made to produce the same output where possible, some differences from the official library do exist:

  • We don't produce or consume any data attributes as we won't use them from Elm code anyway.
  • When masks are created, the official library generates random ids to avoid collisions from multiple icons on the same page. In Elm, this is impossible to do without exposing it in the API, so we don't. If you need ids you will need to manually specify them. It is possible to generate and use random ids, but that requires more effort in Elm, please see the example for more.

Troubleshooting.

Icons show up as giant images.

This normally means you have not included the required CSS.

My class isn't applied, or it is but the icon breaks.

Mixing Svg.Attribute.class and Html.Attribute.class can cause the classes to get overwritten. This library uses Svg.Attribute.class, so if you always use this when providing attributes to the library you should not have problems.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].