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

View Live 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

PropertyPurpose
backdrop-filter: blur()Creates the frosted glass blur effect
background: rgba()Semi-transparent background
box-shadow: insetCreates inner glow and depth
border: rgba()Subtle glass-like borders
filter: drop-shadow()Adds realistic shadow effects
opacityControls 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

BrowserSupport
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

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-feature-name
  3. Make your changes
  4. Commit your changes: git commit -m 'Add some feature'
  5. Push to the branch: git push origin feature/your-feature-name
  6. 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!


Made with โค๏ธ and CSS magic