Glassmorphism जनरेटर

लाइव पूर्वावलोकन के साथ ट्रेंडी फ़्रॉस्टेड ग्लास UI प्रभाव बनाएँ। कस्टमाइज़ करें और CSS कोड कॉपी करें।

10px
25%
180%
30%
16px

ग्लास कार्ड

यह शुद्ध CSS में बनाया गया glassmorphism प्रभाव है।

CSS कोड

glassmorphism क्या है?

glassmorphism एक इंटरफ़ेस डिज़ाइन प्रवृत्ति है जो पृष्ठभूमि दिखाने वाले फ़्रॉस्टेड-ग्लास जैसे तत्वों को उजागर करती है।

ब्राउज़र संगतता

backdrop-filter सभी आधुनिक ब्राउज़रों द्वारा समर्थित है: Chrome, Edge, Safari और Firefox 103+।

How It Works

  1. Pick a backdrop colour. Glass needs something behind it to be visible. Choose a solid background, gradient, or photo for the preview area so you can judge how the blur will read in your real layout.
  2. Set the blur and saturation. Blur radius simulates the light-scattering of frosted glass; saturation pulls the colours from behind the panel forward. The classic Apple-style recipe is around blur(10px) saturate(180%).
  3. Tune the glass colour and transparency. The element's own background must be partially transparent, opaque colour blocks the backdrop entirely. White or black at 10–30% alpha is the typical starting point.
  4. Adjust the border and corner radius. A hairline white border at low alpha mimics the inner-edge highlight of physical glass. A border-radius around 12–20px gives the soft-card look most glassmorphism designs use.
  5. Copy the CSS. Paste the generated property block into your stylesheet. Add the -webkit-backdrop-filter companion line if you need to support older Safari.

Where the Term Came From

The visual is older than the label. Apple introduced real-time blurred backdrops for notification panels and Control Center with iOS 7 in 2013 and brought it to the desktop with macOS Yosemite the next year, the WebKit team shipped the CSS backdrop-filter property in August 2015 specifically because, as its launch post puts it, "the User Interface design language for iOS 7 and OS X Yosemite changed to incorporate beautiful backdrop blur effects." Microsoft's earlier Windows Vista "Aero Glass" (2007) was the same idea, and Microsoft documents two related materials in the modern Fluent system: Acrylic (translucent, blurred, with a noise overlay) and Mica (an opaque desktop-tinted variant introduced with Windows 11). The single name "glassmorphism" was coined by Polish designer Michał Malewicz of Hype4 Academy in November 2020, in step with the release of macOS Big Sur, naming consistency, in the same family as the earlier "neumorphism," gave designers a shared vocabulary to discuss the technique.

The CSS Recipe

.glass-card {
  /* 1. Element background: must be partially transparent */
  background: rgba(255, 255, 255, 0.18);

  /* 2. The frosted-glass effect */
  backdrop-filter: blur(10px) saturate(180%);
  -webkit-backdrop-filter: blur(10px) saturate(180%); /* Safari 9-16 */

  /* 3. The inner-edge highlight */
  border: 1px solid rgba(255, 255, 255, 0.3);

  /* 4. Soft corners */
  border-radius: 16px;
}

Three things to internalise about the recipe. First, the element's own background must be transparent or partially transparent, MDN states it plainly: "The element or its background must be transparent or partially transparent for the effect to be visible." A fully opaque background-color covers the blurred sample and the user sees a flat panel. Second, the effect needs something behind it to blur, glassmorphism does not work over a uniform white page. Third, modern Safari accepts the unprefixed property, but anything older than Safari 17 needs both backdrop-filter and the -webkit-backdrop-filter twin.

All Ten Filter Functions

backdrop-filter is defined in the W3C Filter Effects Module Level 2 and accepts the same ten filter functions as the regular filter property: blur(), brightness(), contrast(), drop-shadow(), grayscale(), hue-rotate(), invert(), opacity(), saturate(), and sepia(). They can be chained, and the order matters, they are applied left-to-right against the backdrop sample. For glassmorphism, blur() plus saturate() covers the canonical look; everything else is creative tuning (e.g. brightness(105%) on dark backdrops to lift the blurred sample, or contrast(120%) to keep colour relationships crisp).

Browser Support and the -webkit- Prefix

As of 2026 the property is supported in every evergreen browser. WebKit shipped first on 10 August 2015 with Safari 9 / iOS 9, behind the -webkit-backdrop-filter prefix. Chrome added support unprefixed in version 76 (July 2019), Edge followed with the Chromium switch at version 79, and Firefox 103 enabled it unflagged on 26 July 2022. MDN flags the property as Baseline 2024 (Newly available since September 2024) meaning all four major engines now interoperate. Real-world support sits around 95% global. To cover older Safari builds (and PostCSS users), include both the prefixed and unprefixed declarations side by side or let autoprefixer add the prefix from your Browserslist config.

A Fallback for Browsers That Don't Support It

Use an @supports query so non-supporting browsers get a solid fallback instead of an unreadable transparent panel:

.glass-card {
  background: rgba(30, 41, 59, 0.92); /* opaque fallback */
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-card {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
  }
}

Performance: When to Use It (and When Not To)

backdrop-filter is GPU-accelerated, but it is not free. Each filtered surface forces the browser to maintain a separate compositing layer and re-sample the area behind the element. The W3C editor's draft acknowledges this directly, calling out that nested or stacked backdrop filters can cause "exponential rendering passes," and the WebKit launch post warns the property "forces the engine to perform more rendering passes, which will have an impact on performance." Web.dev's terse summary applies: "backdrop-filter may harm performance. Test it before deploying."

Practical rules: keep blur radii under ~20px on production code, avoid full-viewport glass surfaces (a glass nav bar that re-paints on every scroll is the classic offender), don't stack many filtered surfaces on top of each other, and avoid backdrop-filter over <video> elements where the blur has to recompute on every frame. Microsoft tells Acrylic users much the same thing in the Fluent docs: "Acrylic effects are automatically disabled when a device enters Battery Saver mode."

Accessibility: The Contrast Trap

Glassmorphism by definition lowers the contrast between text and its background, because the "background" under the panel is now whatever happens to be behind it, and that varies as the user scrolls or changes wallpaper. The relevant WCAG 2.1 minimums (4.5:1 for normal body text, 3:1 for large or bold text) must be met against the worst-case backdrop, not the average. Practical guidance: keep body text out of glass panels and use them mainly for chrome (cards, headers, modals) where the actual reading happens against a more-opaque inner surface. Always provide an opaque-fallback variant for users who have switched off transparency at the OS level, both macOS (System Settings → Accessibility → Display → Reduce transparency) and Windows (Settings → Personalization → Colors → Transparency effects) expose the toggle, and CSS can detect it:

@media (prefers-reduced-transparency: reduce) {
  .glass-card {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

Where Glassmorphism Works Well, and Where It Doesn't

Common Mistakes

  1. Forgetting the transparent background. Setting backdrop-filter on an element with an opaque background-color produces no visible effect, the opaque colour covers the blurred sample. Always pair it with an rgba()/hsla() background.
  2. Glass over a flat colour. If there is nothing interesting behind the panel, blurring it produces no "glass", just a faintly-tinted rectangle. The effect needs a photo, gradient, or busy backdrop to read.
  3. Skipping the -webkit- prefix. Older Safari builds need it. Either ship both lines or rely on autoprefixer.
  4. Stacking too many panels. Each filtered surface is its own GPU layer. Three or four is usually the practical limit before frame-rate drops on mobile.
  5. Failing the worst-case contrast check. Test the panel against the brightest and darkest patches of every backdrop it will sit over, not just one demo screenshot.
  6. Animating the blur radius. Transitioning backdrop-filter: blur(0)blur(20px) on hover is technically allowed but recomputes the blur every frame and is the easiest way to tank scrolling performance. Animate opacity or transform instead and leave the blur static.

Frequently Asked Questions

Why does my glass card look like a flat panel?

The element's own background-color is fully opaque. backdrop-filter blurs whatever is behind the element, but the element paints on top. With an opaque background, that paint covers the blurred sample. Switch to rgba() or hsla() at 10–30% alpha, the sweet spot for most glassmorphism designs.

Will it work in Safari?

Yes, Safari was the first browser to ship the property, in August 2015. Older Safari versions need the -webkit-backdrop-filter prefix; modern Safari accepts the unprefixed form. Including both keeps the same CSS working on every Safari build still in active use.

Is glassmorphism accessible?

Only if you design for the worst-case backdrop. WCAG 2.1 requires a 4.5:1 contrast ratio for normal text and 3:1 for large or bold UI components, measured against whatever colour ends up under the panel. Provide an opaque fallback under the prefers-reduced-transparency media query so users who have turned transparency off at the OS level get a readable surface.

Does it hurt performance?

It can. Each filtered surface forces the browser to keep a separate compositing layer and re-sample the area behind it, and large blur radii or stacked panels compound the cost. Keep the radius under about 20px, avoid full-viewport panels, and don't put it over <video>. Web.dev's official guidance is to test on a representative low-end device before shipping.

What's the difference between glassmorphism and neumorphism?

Neumorphism (coined a few months earlier) creates the illusion of soft plastic embossed shapes by combining inner and outer shadows on the same flat colour as the page background, no transparency, no blur. Glassmorphism keeps the page background visible through a translucent, blurred panel. They are complementary rather than competing styles, and some designs use both: a neumorphic button on a glass card, for example.

Can I copy the CSS for production use?

Yes. The output is plain CSS using standard properties, no proprietary extensions, no JavaScript. Drop the rule into your stylesheet and apply the class to whichever element should look like glass.

संबंधित टूल