RSL Icons

Zero-dependency SVG icon system with 300+ icons

1 Include the Files

Add the CSS and ensure the SVG sprite is accessible:

HTML Setup • HTML
<!-- Include the icon CSS -->
<link rel="stylesheet" href="styles/rsl-icons.css">

<!-- SVG sprite file should be in images/rsl-icons.svg -->

2 Basic Usage

Use SVG with the <use> element to reference icons from the sprite:

Basic Icon Usage • HTML
<!-- Basic icon -->
<svg class="rsl-icon" aria-hidden="true">
    <use href="images/rsl-icons.svg#rsl-icon-check"></use>
</svg>

<!-- Icon with accessible label -->
<svg class="rsl-icon" role="img" aria-label="Settings">
    <use href="images/rsl-icons.svg#rsl-icon-cog"></use>
</svg>
Accessibility Tip: Use aria-hidden="true" for decorative icons. For icons that convey meaning, use role="img" and aria-label.

Size Variants

Icons scale with font size by default. Use size modifier classes for specific sizes:

xs
sm
default
lg
xl
2x
3x
4x
5x
Class Size Pixels (at 16px base)
.rsl-icon-xs0.75em12px
.rsl-icon-sm0.875em14px
.rsl-icon (default)1em16px
.rsl-icon-lg1.25em20px
.rsl-icon-xl1.5em24px
.rsl-icon-2x2em32px
.rsl-icon-3x3em48px
.rsl-icon-4x4em64px
.rsl-icon-5x5em80px

Color Variants

Icons inherit currentColor by default. Use color classes for semantic colors:

Class Color Use Case
.rsl-icon-primaryBlue (#007bff)Primary actions, links
.rsl-icon-secondaryGray (#6c757d)Secondary information
.rsl-icon-successGreen (#28a745)Success states, confirmations
.rsl-icon-dangerRed (#dc3545)Errors, destructive actions
.rsl-icon-warningYellow (#ffc107)Warnings, cautions
.rsl-icon-infoCyan (#17a2b8)Information, tips
.rsl-icon-mutedGray (65% opacity)Disabled, low priority

Animations

Add animation classes for loading states and attention-grabbing effects:

spin
pulse
bounce
shake
Animation Classes • HTML
<!-- Spinning loader -->
<svg class="rsl-icon rsl-icon-spin">
    <use href="images/rsl-icons.svg#rsl-icon-spinner"></use>
</svg>

<!-- Pulsing heart -->
<svg class="rsl-icon rsl-icon-pulse">
    <use href="images/rsl-icons.svg#rsl-icon-heart"></use>
</svg>

<!-- Bouncing notification -->
<svg class="rsl-icon rsl-icon-bounce">
    <use href="images/rsl-icons.svg#rsl-icon-bell"></use>
</svg>

<!-- Shaking warning -->
<svg class="rsl-icon rsl-icon-shake">
    <use href="images/rsl-icons.svg#rsl-icon-exclamation-triangle"></use>
</svg>
Accessibility: Animations are automatically disabled when the user has prefers-reduced-motion: reduce enabled in their system settings.

Rotation & Flip

Transform icons with rotation and flip classes:

|
Class Transformation
.rsl-icon-rotate-90Rotate 90 degrees clockwise
.rsl-icon-rotate-180Rotate 180 degrees
.rsl-icon-rotate-270Rotate 270 degrees clockwise
.rsl-icon-flip-horizontalFlip horizontally (mirror)
.rsl-icon-flip-verticalFlip vertically
.rsl-icon-flip-bothFlip both directions

Button Integration

Icons work seamlessly with RSL buttons:

Button Icons • HTML
<!-- Icon before text (automatic margin) -->
<button class="btn btn-primary">
    <svg class="rsl-icon"><use href="images/rsl-icons.svg#rsl-icon-save"></use></svg>
    Save Changes
</button>

<!-- Icon after text -->
<button class="btn btn-default">
    Settings
    <svg class="rsl-icon rsl-icon-right"><use href="images/rsl-icons.svg#rsl-icon-cog"></use></svg>
</button>

<!-- Icon-only button -->
<button class="btn btn-primary">
    <svg class="rsl-icon"><use href="images/rsl-icons.svg#rsl-icon-spinner"></use></svg>
</button>

Brand Icons (SimpleIcons)

For brand icons, RSL uses the SimpleIcons CDN (3,300+ brand icons, CC0 license):

GitHub Twitter Facebook LinkedIn Instagram YouTube
Brand Icons • HTML
<!-- Brand icon (color from brand guidelines) -->
<img class="rsl-brand-icon" src="https://cdn.simpleicons.org/github" alt="GitHub">

<!-- Custom color -->
<img class="rsl-brand-icon" src="https://cdn.simpleicons.org/github/6E7BFF" alt="GitHub">

<!-- Size variants -->
<img class="rsl-brand-icon rsl-brand-icon-lg" src="https://cdn.simpleicons.org/twitter" alt="Twitter">
<img class="rsl-brand-icon rsl-brand-icon-2x" src="https://cdn.simpleicons.org/facebook" alt="Facebook">
Custom Colors: Add a color hex code after the icon name: https://cdn.simpleicons.org/github/FF5733

Utility Classes

Class Effect Use Case
.rsl-icon-fwFixed width (1.25em)Icon lists, menus
.rsl-icon-inlineBaseline alignmentInline with text baseline
.rsl-icon-middleMiddle alignmentVertical centering
.rsl-icon-borderBorder around iconEmphasis, badges
.rsl-icon-roundedCircular backgroundAvatar-style icons
.rsl-icon-filledFilled instead of strokedSolid icons

Sample Icons

RSL includes 300+ UI icons. Here's a sample - see examples page for the complete gallery:

home
user
cog
search
bell
envelope
calendar
clock
heart
star
check
times
plus
minus
edit
trash
download
upload
share
link
View All 300+ Icons

Migration from FontAwesome

RSL provides a migration script to automatically convert FontAwesome icons to RSL icons:

Migration Script • Bash
# Preview changes (dry run)
node scripts/migrate-icons.js --dry-run "src/**/*.html"

# Apply changes
node scripts/migrate-icons.js "src/**/*.html"

# Verbose output
node scripts/migrate-icons.js --verbose "src/**/*.html"

Before & After

FontAwesome (Before)

<i class="fas fa-check"></i>
<i class="fa fa-spinner fa-spin"></i>
<i class="fab fa-github"></i>

RSL Icons (After)

<svg class="rsl-icon" aria-hidden="true"><use href="images/rsl-icons.svg#rsl-icon-check"></use></svg>
<svg class="rsl-icon rsl-icon-spin" aria-hidden="true"><use href="images/rsl-icons.svg#rsl-icon-spinner"></use></svg>
<img class="rsl-brand-icon" src="https://cdn.simpleicons.org/github" alt="GitHub">
Zero Dependencies: After migration, you can remove the FontAwesome CDN script from your HTML.