Posted in Icons
7158
12:27 am, March 20, 2022

Font Awesome Icons

I have been using this awesome font library for so long now that i almos overlooked it as being such a stable web developer resource for an amazing set of icons and easy to add to your project.

What is Font Awesome?

Its a library of SVG icons that you can add to your site with one include and then the use of the i tags, with a whole library of icons you can choose from. 

Preview


a preview of Font Awesome Icons

How do i use Font Awesome.

  1. Include this script tag in your site <head>:
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.0/css/all.min.css" />
  2. Usually you can just go to cdnjs.com to grab the latest version of font awesome include.
  3. Pick the icon you want to display from here.
  4. Paste that code in your page <body>.

 

Should I use it?

They seem to be making the latest versions of it quite complicated to install with the creation of a kit, im not sure why this would be benificial, i think you maybe able to choose the icon sets that you want to use rather than just loading all icons by default. But just using the basic include seems to be quite good still.

It still is probably better to just source your own SVG icons and include them manually even though this is a bit more work initially. 

File Sizes for Font Awesome

It seems this library consumes a lot of resources.

The Min css file alone is 101kb.

File Size
all.min.css 101 kb
fa-solid-900.woff2 75 kb
fa-regular-400.woff2 14.3 kb
fa-brands-400.woff2 106 kb
  296.3 kb

So the total additional added, even if just using one of the icons is almost 300kb (296.3kb) which seems like a lot for one icon.

If you are using a large amount of the icons then this might be worth it, but it still does seem a bit of a waste of space considering the small size of the singular svg files. 

Extract singular icons

Rather than including 300kb of scripts, you can just extract the icons you want to use from the open source repo here. 

https://github.com/FortAwesome/Font-Awesome/tree/master/svgs

Just browse through the icons here, or use the icons finder and then extract them using the same name. 

For our example icon, the souce of the SVG is only 500 bites. So its tiny. We include 300kb just for the convenience of ease in development, just to embed a 500 bite icon. 

https://github.com/FortAwesome/Font-Awesome/blob/master/svgs/brands/css3-alt.svg 

HTML

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M0 32l34.9 395.8L192 480l157.1-52.2L384 32H0zm313.1 80l-4.8 47.3L193 208.6l-.3.1h111.5l-12.8 146.6-98.2 28.7-98.8-29.2-6.4-73.9h48.9l3.2 38.3 52.6 13.3 54.7-15.4 3.7-61.6-166.3-.5v-.1l-.2.1-3.6-46.3L193.1 162l6.5-2.7H76.7L70.9 112h242.2z"/></svg>

Conclusion

The amazing library of icons that Font Awesome has and the ease of installation makes using the icons very easy, I think that the size of the included css might be large. So even while making it easier to install it may increase the size of your project.

Original Source

Font Awesome on Github

Font Awesome Icons Demo

View Demo Full Screen View Demo New Tab

Font Awesome Icons Code

HTML

<h2>Icon with 296kb of scripts</h2>
<p>This icon uses the full font awesome css and library to display it loading 296kb of scripts. </p>
<i class="fa-brands fa-css3-alt fa-4x"></i>

<h2>Icon with no scripts</h2>
<p>This version of the same icon is only 500 bytes, a saving of 295.5kb!</p>
<svg class="css-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!-- Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M0 32l34.9 395.8L192 480l157.1-52.2L384 32H0zm313.1 80l-4.8 47.3L193 208.6l-.3.1h111.5l-12.8 146.6-98.2 28.7-98.8-29.2-6.4-73.9h48.9l3.2 38.3 52.6 13.3 54.7-15.4 3.7-61.6-166.3-.5v-.1l-.2.1-3.6-46.3L193.1 162l6.5-2.7H76.7L70.9 112h242.2z"/></svg>

CSS

.css-svg { 
	height:100px;
  	width:100px;
  	fill:orange;
}

Scripts

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.0/css/all.min.css" />

External Link for Font Awesome Icons

No Items Found.

Add Comment
Type in a Nick Name here
 
Other Items in Icons
Search Code
Search Code by entering your search text above.
Welcome to CSSBundle.com

Hi there and welcome to CSSBundle. Here at CSS Bundle we aim to find the best css and javascript bundles and demos and add them here to make them easy to find all in one place.

If you would like to stay up to date with our latest updates you can subscribe to our mailing list where we will send you one email per week with the latest updates, no spam emails just the latest updates.

Random Quote


Latest Code
css animations Falling Stars CSS Animation html Video different sources on screen sizes video embed html responsive css animations Animated Triangles on Canvas JS HTML HTML Canvas Instant colour fill with HTML Canvas javascript Transform Text into Images using SnapText JS CSS Tools Fancy Border Radius CSS Generator Tool - spin animation keyframes CSS Tools CSS Drop Filter Shadow Creator CSS Slider A CSS and HTML Only Carousel Slider CSS Z-Index Z-Index Code Front - CSS to change z-index when element is active sections section with image to the right text to the left gradient Sections Two Clickable Logo Promo Box Section Foundation HTML CSS Sections Inline Contact Form Formatting HTML CSS Sections Overview full width section in Poppins font with light gray background using foundation Interactive Images Map Image with Easy Dots and Titles using only CSS HTML Sections Social Header Links easy Drop in Code with Font Awesome Icons Sections Responsive Friendly Subscribe to our Newsletter Section CSS Tips Create a button with CSS, HTML and Center it! CSS Text Formatting Truncate Text to an amount of lines using line-clamp CSS Positions Item Positioning in CSS CSS Tips Draw a Circle in CSS css animations Magical Text Effect Bootstrap 4.2 Kitchen Sink CSS Frameworks Make your site look like windows 7 CSS Backgrounds Fancy up your banner image hero sections using overlay gradients CSS Modal Floating Modal Message Fixed on the Bottom of the Screen CSS Modal Create a modal with only CSS css grid display items in a css grid CSS Text Effects Using the selection selector to change the default highlight color Text Truncate your Text with CSS CSS Cursors Change your cursor into an Emoji Cursor or Image Cursor CSS How to Center Everything or Anything with CSS CSS Animations Smooth Scrolling with just CSS CSS Animations Radial Glow under cursor on box hover over effect CSS Shadows Using a filter drop shadow for transparent images CSS Animations Pure CSS 3D Flipping Book with Animations CSS Create a checkerboard background pattern with CSS CSS Animations button animations hover and fill animation CSS Animations button on focus swing animation CSS Animations Animated Button Border when Active Quick CSS create a border with top triangle in css CSS Animations Single Element CSS Spinners CSS Animations CSS Shake - Shake up your elements CSS Framework NES-style(8bit-like) CSS Framework CSS Tips Why to use a CSS Reset? Web Developer Checklists Front-End Checklist Icons Font Awesome Icons CSS Animation Animate Stuff with Animate.css CSS Animations Check Wave Click a Checkbox and Watch the Animation Animation Cloudy spiral animation with CSS3 Notifications Toast Messages and Notifications Standalone Library no JQuery - notify.js