Liquid Glass Effect ๐
June 10, 2025 ยท View on GitHub
A modern glassmorphism effect implementation using pure CSS, similar to the new Liquid Glass Effect created by Apple.
๐ Demo
โจ Features
- 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
๐จ How the Glass Effect Works
The liquid glass effect is achieved through a combination of several CSS properties and techniques:
1. Base Glass Container
.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);
}
2. Liquid Effect with Pseudo-element
.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%);
}
3. Key CSS Properties Explained
| 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 |
4. Background Enhancement
The effect is enhanced with:
- Gradient background
- Radial gradient overlays for depth
- High-quality background image
- Fixed attachment for parallax effect
๐ฏ Customization
Color Variations
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 */
Blur Intensity
Adjust the blur effect:
backdrop-filter: blur(2px) saturate(180%); /* Increase blur value */
Shadow Effects
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
| 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.
๐ค Contributing
Contributions are welcome! Here's how you can help:
Ways to Contribute
- ๐ 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
Development Setup
- 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
Code Style Guidelines
- Use semantic HTML elements
- Follow CSS naming conventions
- Comment complex CSS properties
- Ensure responsive design
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- 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!
๐ Related Projects
Made with โค๏ธ and CSS magic