✨ Module 2: Glassmorphism

Frosted Glass Effects with Bootstrap 5.3

Bootstrap 5.3 Backdrop-filter Card Components

💎 Standard Glass

This Bootstrap card uses a light background with 12px blur and increased saturation. The textured background allows you to clearly see the "frosted glass" effect.

Bootstrap classes: card h-100

🌙 Dark Glass

This variation uses a darker background with more blur (16px) for better contrast. Perfect for text-heavy content that needs readability. Combined with Bootstrap's card-body.

Best for: Modals, overlay menus, dark themes

☀️ Light Glass

Maximum blur (20px) with increased brightness creates a more ethereal, dreamy effect. The textured background appears soft but visible. Uses Bootstrap's responsive utilities.

Best for: Decorative elements, subtle backgrounds

What Is Glassmorphism?

Glassmorphism creates a "frosted glass" look using semi-transparent elements with blur effects. It's like looking through a foggy window or shower door with condensation—you see shapes but with softness.

The key to success: Glassmorphism needs a visually interesting background to work well. Without texture or color behind it, the blur effect has nothing to show. That's why this demo uses animated shapes and patterns!

Bootstrap + Glassmorphism Technique

HTML with Bootstrap:

<div class="card glass-card text-white h-100">
  <div class="card-body p-4">
    <h2 class="card-title h4">Glass Card</h2>
    <p class="card-text">Content...</p>
    <button class="btn glass-button">Button</button>
  </div>
</div>

Custom CSS for Glassmorphism:

.glass-card {
  /* Semi-transparent background */
  background: rgba(255, 255, 255, 0.15) !important;

  /* THE GLASSMORPHISM MAGIC! */
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);

  /* Subtle border */
  border: 1px solid rgba(255, 255, 255, 0.4) !important;

  /* Bootstrap border radius variable */
  border-radius: var(--bs-border-radius-lg) !important;
}

✅ Bootstrap Utilities Used

  • card, card-body – Card structure
  • h-100 – Full height cards
  • text-white – Text color
  • p-4, mb-3 – Spacing
  • row, col-md-4 – Grid layout
  • --bs-border-radius-lg – CSS variable

💡 How It Works

  • Bootstrap provides card structure & responsive grid
  • backdrop-filter blurs background
  • rgba() makes background see-through
  • Combination creates "frosted glass"
  • Border adds definition
  • Bootstrap variables ensure consistency

Blur Amount Comparison

Hover over each box to see different blur levels

No Blur
Transparent
Subtle
Light
⭐ Ideal
Balanced
Strong
Intense
Extreme
Maximum