Skip to content
Franco Mussopower pages
Purple and black pyramid pattern
Photograph · Sandro Katalina / Unsplash
Guide No.035
SnippetCSS

Add Font Awesome icons to out-of-the-box lists using CSS (no JavaScript required!)

This is something I once approached with JavaScript on load of the list.

Level
03CustomiseStage 3 of 4
Read
2 min
Includes
1 snippet · 1 figure
Written
Oct 2023

Bonus: another cool trick with data attributes… use CSS ‘before’ pseudo elements to add Font Awesome icons

This is something I once approached with JavaScript on load of the list. We can actually achieve the same result faster with CSS alone thanks to the useful clues / hooks that the Power Pages team leave us in the markup (which we can ‘hook onto’ with CSS)…

In this example, I’m going to prefix a Font Awesome icon next to each case in the List on the service page. (Note this is specific to Bootstrap 5. Power Pages sites on BS5 ship with Font Awesome 6’s Free collection):

The selector:

tr[data-entity="incident"] td > a.details-link

What this selector means is:

Now to prefix / prepend that with a folder icon:

Head over to https://fontawesome.com/search?o=r&m=free and search for the icon you want.

Click the icon

A dialogue will pop up showing details of how to use / customise the icon…

Click the code in the Unicode section to copy it, like so:

Power Pages
Fig. 01

And finally, here’s the full CSS snippet:

Note – I’ve added ::before to the selector as that’s all I want to style, not the link itself:

Prefix List Table Rows with Font Awesome IconCSS
tr[data-entity="incident"] td > a.details-link::before {
    display: inline-block;
    text-rendering: auto;
    font-family: FontAwesome;
    content: "f0ad";
    margin-right: 0.7em;
    font-size: 1.15em;
}
Go deeper · Power Pages Mastery

This guide is one technique. The course is the method.

The course covers this in Level 2 · Extending the platform: “Advanced CSS styling”, alongside “Minimum viable styling”. A structured programme distilled from dozens of real portal launches — from messy stakeholder requirements to successful go-live.

  • 6 weeks
  • 3 levels
  • Live training + video lessons
Where this fits
  1. Level 1Foundations
  2. Level 2Extending the platform
    • Advanced CSS styling
    • Minimum viable styling
  3. Level 3Advanced customisation
Franco’s engaging teaching style made training a pivotal contribution to my professional growth. The walkthrough of a Power Pages site resembling Spotify left an indelible mark.
Bhargav Reddy — Solution Architect — TCS
Filed underCSS

Comments

No comments yet. Spotted a gotcha I missed? Say so below.

Leave a comment

Your email address won’t be published. Comments are moderated.

Consulting

Need a Power Pages build that editors love and brands survive?

I help teams design and build Power Pages sites with bespoke UX. Tell me about yours.

Search

Book a discovery call

30 minutes. Bring your trickiest Power Pages problem — I’ll tell you honestly whether I’m the right fit.