Rock Mountain
  • Home
  • User Guide
    • Glass Web Components
    • Using reCAPTCHA
    • Publishing Source Code with Syntax Highlighting
  • Developer Guide
    • Getting Started
    • Adding NPM Packages
    • Database
      • Backing Up and Restoring Data
      • Database Schema
      • MongoDB Tips and Snippets
      • VS Code and the MongoDB Playground
    • Common Errors and Their Solutions
    • Developing Glass Web Components
    • DevOps
      • Build and Deployment Procedure
      • GitHub Conventions and Workflow
      • Merging Preview Into Main
    • File Structure
    • React Components
      • SiteLayout Component
      • Toggle Lazy Load Image Component
    • Update or Change the Fav Icon
    • References and Learning Resources
  • Icons
Powered by GitBook
On this page

Icons

PreviousReferences and Learning Resources

Last updated 3 years ago

CtrlK

Rock Mountain uses Font Awesome (currently, the free license).

In _document.js, at the end of the HTML head, a Font Awesome kit is included...

FIND FONT AWESOME ICONS

<script src="https://kit.fontawesome.com/9f8d0edc47.js" crossorigin="anonymous"></script>

This kit gives you access to 1,608 pixel-perfect icons. Add any of them with one line of code.

You can place Font Awesome icons just about anywhere using a style prefix and the icon’s name. We’ve tried to make it so that icons take on the characteristics and appear alongside text naturally.

Font Awesome is designed to be used with inline elements, and we recommend sticking with a consistent HTML element to reference them by in your project. We like the <i> tag for brevity and because most folks use <em></em> for emphasized/italicized semantic text these days. If that’s not your cup of tea, using a <span> is more semantically correct.

To reference an icon, you need to know two bits of information. 1) its name, prefixed with fa- (meaning “font awesome” naturally!) and 2) the style you want to use’s corresponding prefix**.

<i aria-hidden className="fas fa-camera"></i> <!-- this icon's 1) style prefix == fas and 2) icon name == camera -->
<i aria-hidden className="fas fa-camera"></i> <!-- using an <i> element to reference the icon -->
<span aria-hidden className="fas fa-camera"></span> <!-- using a <span> element to reference the icon -->

Rock Mountain supports the free tier prefixes, fas (solid), and fab(brands). More style prefixes and font-face weights are available to those who license Font Awesome Pro.