A modern glassmorphism effect implementation using pure CSS, similar to the new Liquid Glass Effect created by Apple.
- Pure CSS Implementation - No JavaScript required
- Responsive Design - Works on all screen sizes
- Modern Glassmorphism - Trendy glass effect with backdrop blur
- Customizable - Easy to modify colors and effects
- Lightweight - Minimal code footprint
- Cross-browser Compatible - Works on modern browsers
The liquid glass effect is achieved through a combination of several CSS properties and techniques:
.glass {
position: relative;
background: rgba(255, 255, 255, 0.15);
backdrop-filter: blur(2px) saturate(180%);
border: 1px solid rgba(255, 255, 255, 0.8);
border-radius: 2rem;
box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2), inset 0 4px 20px rgba(255, 255, 255, 0.3);
}.glass::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.1);
border-radius: 2rem;
backdrop-filter: blur(1px);
box-shadow: inset -10px -8px 0px -11px rgba(255, 255, 255, 1), inset 0px -9px 0px -8px rgba(255, 255, 255, 1);
opacity: 0.6;
z-index: -1;
filter: blur(1px) drop-shadow(10px 4px 6px black) brightness(115%);
}| Property | Purpose |
|---|---|
backdrop-filter: blur() |
Creates the frosted glass blur effect |
background: rgba() |
Semi-transparent background |
box-shadow: inset |
Creates inner glow and depth |
border: rgba() |
Subtle glass-like borders |
filter: drop-shadow() |
Adds realistic shadow effects |
opacity |
Controls transparency levels |
The effect is enhanced with:
- Gradient background
- Radial gradient overlays for depth
- High-quality background image
- Fixed attachment for parallax effect
Modify these values to change the glass tint:
background: rgba(255, 255, 255, 0.15); /* Glass transparency */
border: 1px solid rgba(255, 255, 255, 0.8); /* Border color */Adjust the blur effect:
backdrop-filter: blur(2px) saturate(180%); /* Increase blur value */Customize the depth and glow:
box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2), /* Outer shadow */ inset 0 4px 20px rgba(255, 255, 255, 0.3); /* Inner glow */| Browser | Support |
|---|---|
| Chrome | ✅ Full support |
| Firefox | ✅ Full support |
| Safari | ✅ Full support |
| Edge | ✅ Full support |
| IE | ❌ Not supported |
Note: backdrop-filter requires modern browser support. For older browsers, consider using a polyfill or fallback styles.
Contributions are welcome! Here's how you can help:
- 🐛 Bug Reports: Found a bug? Open an issue
- 💡 Feature Requests: Have an idea? Create a feature request
- 🔧 Code Improvements: Submit a pull request with enhancements
- 🎨 Design Variations: Share your glass effect variations
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Submit a pull request
- Use semantic HTML elements
- Follow CSS naming conventions
- Comment complex CSS properties
- Ensure responsive design
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by Apple WWD 2025 conference
- Background image from Unsplash
- CSS backdrop-filter for the blur effect
⭐ If you found this project helpful, please give it a star on GitHub!
Made with ❤️ and CSS magic