Category: CSS Tools

  • CSS Formatter: Beautify CSS, SCSS, LESS in Browser [2026]

    CSS Formatter: Beautify CSS, SCSS, LESS in Browser [2026]

    TL;DR: A CSS formatter (or “CSS beautifier”) reformats minified, copied, or messy CSS into consistently-indented, readable rules. Use it on copied CSS from a CDN, AI-generated styles, or styles dumped from DevTools. Our free CSS formatter uses Prettier 3 in your browser with full support for modern CSS — custom properties, native nesting, container queries, @layer, OKLCH — plus SCSS, LESS, and PostCSS.

    Reading minified CSS is a productivity tax. Tailwind’s compiled stylesheet is one giant line; a copied snippet from CodePen often arrives as a single rule with no breaks; CSS dumped from DevTools’ “Copy all declarations” comes back without the selectors that gave each rule meaning. A formatter restores hierarchy: each rule on its own line, properties indented, @media blocks visible at a glance.

    Our CSS formatter runs Prettier 3 in your browser with the same parser used by VS Code’s “Format Document” command. It handles plain CSS, SCSS, LESS, PostCSS, and modern CSS features (CSS variables, native nesting, :has(), container queries, @layer, OKLCH, color-mix()). Outputs clean, idiomatic CSS that round-trips through any tool. This guide covers when to format vs minify, the SCSS-specific rules, and the gotchas with copied browser DevTools styles.

    Prettier CSS options that matter

    Option Default Notes
    printWidth 80 Affects wrapping of long selectors and value lists
    tabWidth 2 Standard for modern CSS; 4 for legacy stacks
    singleQuote false Strings in url() and content: values
    endOfLine “lf” “crlf” only for Windows-only repos
    Property sort off Optional — alphabetical, or by Idiomatic CSS groupings

    Prettier’s CSS formatter is deliberately small on options. Modern CSS toolchains add property sorting via separate plugins — stylelint-config-prettier + stylelint-order — rather than baking it into the formatter.

    SCSS, LESS, and PostCSS

    The same Prettier engine handles three preprocessor dialects:

    • SCSS: nested selectors, @mixin, @include, @if/@else, @function, dollar-prefixed variables. Indentation follows nesting depth.
    • LESS: mixins as classes, @variable syntax, guards. Slightly different rules than SCSS.
    • PostCSS: raw CSS plus plugin-specific syntax. Prettier formats whatever is valid CSS-AST — plugin syntax (e.g., @apply from Tailwind) passes through.

    Pick the parser explicitly when auto-detection fails. .scss file extension defaults to SCSS; .less defaults to LESS; .css defaults to plain CSS. Paste-mode without an extension defaults to plain CSS, which can produce odd output for SCSS code (mixin syntax becomes invalid CSS).

    How to format CSS in your browser

    1. Open the CSS formatter
    2. Paste your CSS or drop in a .css/.scss/.less file
    3. Pick the parser if auto-detect doesn’t catch it
    4. Adjust print width and indent style if needed
    5. Click Format — output appears with syntax highlighting
    6. Copy or download as .css

    Modern CSS that older formatters break

    Older CSS beautifiers (cssbeautify, online-beautify) corrupt several modern features:

    • Native nesting: .card { .title { color: red; } } — older formatters flatten or fail to parse. Prettier handles nesting correctly.
    • Container queries: @container (width > 400px) { … } — preserved with all syntax variants.
    • :has() selector: the parent selector is preserved without quote-mangling.
    • OKLCH and color-mix(): new colour formats pass through unchanged.
    • @layer: cascade layer ordering is preserved exactly — never reordered, since order has semantic meaning.
    • CSS custom properties: long fallback chains (var(--a, var(--b, red))) are preserved verbatim.

    Common gotchas

    • Tailwind utility class output is not formatted. Tailwind generates a flat list of single-rule classes; formatting won’t help. Format your custom CSS only — let Tailwind manage its own output.
    • DevTools “Copy all declarations” loses selectors. The clipboard gets color: red; padding: 8px; with no .btn { … } wrapper. Format won’t recover the selector — re-copy with the selector context.
    • Property order is preserved by default. CSS cascade-sensitive code relies on order for shorthand-then-override patterns (margin: 0; margin-top: 8px;). Don’t enable property sorting if you have that pattern.
    • SCSS @mixin formatting is opinionated. Prettier always inlines short mixin calls; long ones wrap. Your style guide may differ. Override locally with // prettier-ignore comments above specific blocks.
    • Don’t format minified CSS and re-deploy. Format your source files; let your build step minify the output. Formatted production CSS is 30% bigger and slower.
    • Older Prettier versions handle modern CSS poorly. Always use Prettier 3+ for native nesting, container queries, and the OKLCH colour space. Prettier 2.x will silently produce wrong output for these.

    When NOT to use a browser CSS formatter

    For a real codebase, install Prettier locally (npm i -D prettier), commit a .prettierrc, and let editors format on save. That eliminates style drift across collaborators. Use this browser tool for one-off snippets, copy-paste from CodePen / DevTools / AI assistants, third-party stylesheets you need to inspect, and quick previews of how Prettier would render styles in a project that doesn’t have it set up yet. For Stylelint integration, install stylelint-config-prettier alongside Prettier locally.

    Frequently asked questions

    Does this support SCSS, LESS, and PostCSS?

    Yes. Prettier 3 handles plain CSS, SCSS, LESS, and PostCSS. Auto-detection picks the parser from the file extension; you can override manually for paste-mode (file extension is unknown).

    Will the formatter sort my properties alphabetically?

    Not by default. Prettier preserves property order — important because some CSS relies on order for shorthand-then-override patterns. Property sorting is a separate Stylelint plugin (stylelint-order); install it locally if you want sorted output.

    Does it support modern CSS features like nesting and container queries?

    Yes. Prettier 3 handles native CSS nesting, container queries, :has(), @layer, OKLCH, color-mix(), and relative-colour syntax. Older formatters break these — always use Prettier 3+ for modern stylesheets.

    Can I unformat (minify) CSS with this tool?

    No — opposite operations. For minification, use the CSS Minifier. The typical pipeline: format while editing, minify before deploying.

    Is my CSS uploaded?

    No. Prettier runs in your browser via WebAssembly. Stylesheets never reach our servers — useful for proprietary or pre-release styles.

    Why does my SCSS look wrong after formatting?

    Most likely the parser was set to plain CSS instead of SCSS. SCSS-specific syntax (@mixin, @include, dollar variables) is invalid CSS. Switch the parser to SCSS and reformat.

    Related tools and guides

     

  • CSS Box Shadow Generator: Multi-Layer Depth [2026]

    CSS Box Shadow Generator: Multi-Layer Depth [2026]

    TL;DR: A CSS box shadow generator builds box-shadow declarations visually — drag offset, blur, spread, and colour sliders to design the shadow, copy the CSS. Modern UI uses multi-layer shadows (2-3 stacked) for realistic depth: a tight close shadow for grounding plus a soft far shadow for ambient. Our free generator handles inset, multi-layer stacks, and exports paste-ready CSS or Tailwind utilities.

    Shadows are the lazy designer’s depth cue. Drop a 4-pixel grey shadow under any card and the card looks “lifted” off the page. Drop the wrong shadow and the card looks like it’s from 2015. The difference between professional and amateur UI in 2026 isn’t whether you use shadows — it’s whether you stack two or three layers to mimic how real light works. A box-shadow generator with multi-layer support is the fastest way to get there.

    Our CSS box shadow generator ships with a live preview, multi-layer support, inset toggle, and export as either vanilla CSS or Tailwind arbitrary-value classes. This guide explains the five box-shadow parameters, why multi-layer shadows look more realistic than single-layer ones, the modern Material Design 3 elevation tokens, and the performance gotchas that make heavy-shadow pages laggy on mobile.

    The five parameters that define a box-shadow

    Parameter Effect Typical range
    Horizontal offset (x) Shadow shifted right (positive) or left (negative) −2 to 2 px (subtle), 0 for centred
    Vertical offset (y) Shadow shifted down (positive) — typical for “lifted” cards 2-30 px depending on elevation
    Blur radius How soft / diffuse the shadow edge is 2× the y-offset for natural softness
    Spread Expands or contracts the shadow before blur. Negative = tight; positive = halo −10 to 5 px typically
    Colour Shadow’s RGBA value rgba(0,0,0,0.04-0.18) for natural shadows

    The single most common mistake: using rgba(0,0,0,0.5) for the shadow colour. Real shadows are far more subtle — 0.04 to 0.18 alpha is the right range. Heavy shadows look like a 2008 web aesthetic. Use multi-layer composition for depth, not a single dark shadow.

    Multi-layer shadows — the modern technique

    Single shadows look flat. Real-world depth has two characteristics: a tight close shadow (the ambient occlusion right next to the object) and a soft far shadow (the diffused fall-off). Modern UI mimics this by stacking 2-3 shadow layers in one box-shadow declaration:

    /* Single shadow (looks flat) */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    
    /* Two-layer (realistic depth) */
    box-shadow:
      0 1px 2px 0 rgba(10, 37, 64, 0.04),     /* close, tight */
      0 4px 12px -2px rgba(10, 37, 64, 0.08); /* far, soft */
    
    /* Three-layer (premium look — Stripe, Linear, Vercel use this) */
    box-shadow:
      0 1px 1px 0 rgba(10, 37, 64, 0.05),
      0 2px 4px -1px rgba(10, 37, 64, 0.08),
      0 12px 24px -8px rgba(10, 37, 64, 0.12);

    The progression from one to three layers is what separates default-looking buttons from premium-looking buttons. Most modern design systems (Material 3, Apple HIG, Tailwind’s shadow-xl) ship multi-layer shadows out of the box.

    Material Design elevation system — six standard levels

    Material Design’s elevation system maps real-world depth to six numerical levels. Each level uses a specific multi-layer shadow stack tuned for the apparent height. Useful as a starting point for your own design system:

    • Elevation 0: no shadow (flat surfaces, page background)
    • Elevation 1: subtle lift (cards at rest, table rows)
    • Elevation 2: raised (cards on hover, primary buttons)
    • Elevation 3: floating (FABs, contextual menus)
    • Elevation 4: overlaid (dialogs, drawers)
    • Elevation 5: very prominent (modal cover, navigation drawer)

    Pick three or four of these for your design system rather than letting designers invent custom shadows per component. Consistency is what makes a UI look polished.

    How to use the browser box-shadow generator

    1. Open the box shadow generator
    2. Drag the x, y, blur, spread sliders. Watch the live preview update
    3. Adjust the colour picker (alpha matters — keep it subtle)
    4. Toggle inset for inner shadows (useful for pressed-button states or “carved” effects)
    5. Click + Add layer to stack a second or third shadow for realistic depth
    6. Pick a preset (Material elevations 1-5, “Stripe-style” multi-layer, “carved”, “neon glow”)
    7. Copy CSS or Tailwind output

    Performance — when shadows hurt page speed

    Shadows are GPU-rendered, which is fast — but not free. A handful of shadows on hero elements is invisible cost. Hundreds of shadows in a feed-style listing produces visible jank on mid-range mobile devices.

    • Don’t apply heavy multi-layer shadows on 50+ scrolling cards. Use a single subtle shadow per card, save the multi-layer treatment for hero elements.
    • Avoid animating shadows. Animating the box-shadow property forces re-layout on every frame. Animate a wrapper’s transform: scale or translateZ instead, with a static shadow.
    • Inset shadows on text-heavy elements. Inset shadows trigger a different rendering path. Avoid stacking many on form inputs or text areas.
    • Use will-change: box-shadow sparingly. Promotes the element to its own layer, which uses memory. Reserve for elements you’ll definitely animate.

    Common box-shadow mistakes

    • Heavy single shadows. box-shadow: 0 8px 32px rgba(0,0,0,0.4) looks like a 2010 lightbox. Use multi-layer with low alpha for modern depth.
    • Coloured shadows by default. Black or near-black shadows are correct for ~95% of cases. Coloured shadows (matching the element) work for hero/marketing elements but look weird on body content.
    • Wrong blur-to-offset ratio. Blur should be roughly 2× the y-offset for natural softness. 0 4px 4px (1:1) looks tight and harsh; 0 4px 8px (1:2) looks natural; 0 4px 24px (1:6) looks dreamy/soft.
    • No spread on outset shadows. Negative spread tightens the shadow and prevents it bleeding past the element bounds — useful for cards in tight grids.
    • Forgetting dark mode. Black shadows on a dark background are invisible. Use slightly lighter shadows or rely on borders + brightness for depth in dark mode.

    Frequently asked questions

    What’s the difference between box-shadow and drop-shadow?

    box-shadow draws a shadow that follows the element’s bounding box (rectangle, even if the element has rounded corners). filter: drop-shadow() follows the element’s actual visual shape, including transparency in PNG images and SVG paths. For UI cards, box-shadow is correct. For PNG icons or SVG logos, drop-shadow is correct.

    Can I animate box-shadow smoothly?

    Browsers can transition box-shadow but it’s expensive. For smooth hover-state lifts, animate a wrapper’s transform: translateY(-2px) with a static shadow instead. The visual effect is identical but the GPU cost is much lower.

    Why does my shadow look pixelated on retina displays?

    This usually happens when blur is too small relative to retina pixel density. Increase blur to at least 4px (which becomes 8 retina pixels) for smooth edges. Sub-pixel blur is interpreted differently across browsers.

    How many shadow layers should I stack?

    Two for most cases (close + far). Three for hero/premium elements where realistic depth matters. Four+ rarely improves the visual and adds GPU cost. Material Design’s heaviest elevation uses three.

    Will the generator output Tailwind utilities?

    Yes — the tool exports both vanilla CSS and Tailwind arbitrary-value class strings. Tailwind v3 also has built-in shadow utilities (shadow-sm, shadow-md, shadow-lg, shadow-xl, shadow-2xl) that approximate Material elevations 1-5.

    Is the box-shadow data sent anywhere?

    No. The generator runs entirely in your browser — slider values, preview rendering, and the CSS output all stay on your device.

    Related tools and guides

     

  • CSS Glassmorphism Generator: Frosted Glass Effects [2026]

    CSS Glassmorphism Generator: Frosted Glass Effects [2026]

    TL;DR: A CSS Glassmorphism Generator builds frosted-glass UI cards using backdrop-filter: blur() over a semi-transparent background. The five properties that matter: blur (12-20px), saturation (130-160%), background opacity (15-30%), border opacity (25-40%), border radius (12-20px). Our live generator ships copy-ready CSS with the -webkit- prefix included for Safari.

    Glassmorphism is the design language of macOS Big Sur, the iOS Control Center, the Apple Vision Pro interface, and roughly half of the SaaS landing pages shipped since 2021. The look is unmistakable: a frosted card hovering over a colourful or photographic background, with content behind softened to a pleasant blur. Used well, it adds depth and hierarchy without the visual weight of a solid card; used badly, it produces low-contrast text that fails accessibility audits and tanks your Lighthouse performance score.

    Our CSS Glassmorphism Generator gives you sliders for the five properties that actually drive the effect — blur, saturation, background opacity, border opacity, border radius — over four backdrop presets (aurora gradient, sunset, ocean, photographic). Tweak until you like the result, copy the generated CSS, paste into your stylesheet. This guide explains what each property does, when glassmorphism is the right design choice, and the mistakes that turn frosted glass into muddy plastic.

    What does the glassmorphism effect actually combine?

    Glassmorphism isn’t a single CSS property — it’s a recipe. Five properties stacked together produce the effect, and removing any one of them breaks the illusion.

    Property Purpose Sweet spot
    backdrop-filter: blur() Blurs whatever’s behind the element 12-20px (10px reads as soft focus, 30px+ reads as muddy)
    backdrop-filter: saturate() Boosts the colour intensity of the blurred backdrop 130-160% (matches Apple’s HIG; 200%+ looks neon)
    background: rgba(255,255,255,0.X) Tints the glass white-ish so it’s visible 0.15-0.30 alpha (under 0.10 looks invisible, over 0.40 loses the glass look)
    border: 1px solid rgba(255,255,255,0.X) Catches the light at the glass edge 0.25-0.40 alpha (without it, the card has no defined boundary)
    border-radius Soft corners — glass is never sharp 12-20px (16-20px reads premium; 4-8px feels too utilitarian)

    The non-obvious one is saturation. Without it, the blur alone produces a slightly washed-out result because blurring averages colour values toward neutral. Pulling saturation up to ~140% restores the colour intensity the blur removed and gives that vibrant frosted look you see on macOS. Drop saturation entirely and the effect becomes muted glass over a hospital-grey backdrop.

    The minimal vanilla CSS produced by our generator looks like this:

    .glass-card {
      background: rgba(255, 255, 255, 0.18);
      backdrop-filter: blur(16px) saturate(140%);
      -webkit-backdrop-filter: blur(16px) saturate(140%);
      border: 1px solid rgba(255, 255, 255, 0.3);
      border-radius: 16px;
    }

    The -webkit-backdrop-filter prefix is non-negotiable. Safari (including iOS Safari, which ~25% of mobile traffic uses) requires the prefixed property even in 2026. Without it, the effect silently fails on iPhone and iPad — your card looks fine on the simulator and broken on the actual device.

    Browser support — what works in 2026

    The backdrop-filter property has roughly 95% global browser support as of 2026. The only mainstream blocker is older Firefox versions (pre-103, released August 2022) where the property is disabled by default. Anyone on a modern browser sees the effect; anyone on an older browser sees a degraded fallback.

    Browser Required version Notes
    Chrome / Edge 76+ No prefix needed, full support since 2019
    Safari (desktop + iOS) 9+ (with -webkit- prefix) Always include the prefix; non-prefixed version isn’t recognised
    Firefox 103+ Pre-103 silently degrades — provide a fallback
    Samsung Internet 12+ Common on Android; works without prefix

    The right fallback is a slightly more opaque background and no blur. Browsers that don’t recognise backdrop-filter simply ignore the property — meaning your background: rgba(255,255,255,0.18) looks like a flat semi-transparent white card. Nudge the alpha up to 0.40 inside an @supports not rule for those browsers:

    @supports not (backdrop-filter: blur(1px)) {
      .glass-card {
        background: rgba(255, 255, 255, 0.40);
      }
    }

    How to use the browser tool

    1. Open the CSS Glassmorphism Generator
    2. Pick a backdrop preset (Aurora, Sunset, Ocean, Photo) — the photo backdrop is the truest test because real photographs vary in colour and contrast across the area
    3. Drag the five sliders: blur, saturation, background opacity, border opacity, border radius. The preview updates instantly
    4. Aim for a card that’s clearly visible against any part of the backdrop. If you can’t read the preview text comfortably, the effect is too transparent for production
    5. Click Copy CSS — the output includes the -webkit- prefix automatically
    6. Paste into your stylesheet, attach the class to a card with position: relative, and verify on at least one mobile device

    The Photo preset is intentionally aggressive. If your design holds up over a real photograph, it’ll hold up over almost any backdrop you throw at it later. Designs that only work over a smooth gradient tend to fall apart the moment a real product image, hero photo, or background-image asset takes its place.

    Glassmorphism in popular CSS frameworks

    Tailwind CSS (with custom utilities or arbitrary values):

    <div class="rounded-2xl border border-white/30
                bg-white/[0.18] backdrop-blur-xl backdrop-saturate-150
                p-6">
      Frosted glass card
    </div>

    styled-components / Emotion:

    const GlassCard = styled.div`
      background: rgba(255, 255, 255, 0.18);
      backdrop-filter: blur(16px) saturate(140%);
      -webkit-backdrop-filter: blur(16px) saturate(140%);
      border: 1px solid rgba(255, 255, 255, 0.3);
      border-radius: 16px;
      padding: 1.5rem;
    `;

    Vue / React inline style (when CSS-in-JS isn’t an option):

    <div style={{
      background: "rgba(255, 255, 255, 0.18)",
      backdropFilter: "blur(16px) saturate(140%)",
      WebkitBackdropFilter: "blur(16px) saturate(140%)",
      border: "1px solid rgba(255, 255, 255, 0.3)",
      borderRadius: 16,
    }} />

    For Tailwind specifically, the built-in backdrop-blur-* and backdrop-saturate-* utilities map to the underlying CSS perfectly — but the prefixed version isn’t auto-included. Tailwind v3.3+ adds -webkit-backdrop-filter via Autoprefixer if you have the right PostCSS config. If you’re using Tailwind without Autoprefixer (older versions or non-default configs), add the prefix manually for production.

    Light theme vs dark theme — different tuning required

    Glassmorphism behaves very differently in light and dark themes, and a card tuned to look perfect on a light background frequently fails on a dark one (and vice versa). The reason: the white-tinted background you set with rgba(255,255,255,0.X) reads as bright over dark backdrops and disappears over light ones.

    • Light theme: use rgba(255, 255, 255, 0.20) background with a darker text colour (your brand navy works). Blur 16-20px reads as crisp.
    • Dark theme: swap to rgba(255, 255, 255, 0.08) background — much lower alpha — with white text. Blur 12-16px is enough; more reads as washed out.
    • For dynamic theming (system preference, user toggle), define the alpha as a CSS variable: background: rgba(255,255,255, var(--glass-alpha)) and switch the variable in your dark-mode media query.

    The Apple HIG guidance — which is where most modern glassmorphism design originates — handles this by using system materials rather than fixed RGBA values. CSS doesn’t expose system materials directly, but the variable-based approach above approximates the same idea.

    Performance — when NOT to use glassmorphism

    The backdrop-filter property is computed on the GPU and is meaningfully expensive. A single small glass card on a hero section is free; ten of them on a feed-style listing produces visible jank on mid-range devices. The cost scales with two things: how large the blurred area is, and how often you change anything that triggers a recomposite.

    • Don’t apply backdrop-filter to large viewport-spanning elements. A glassmorphic header bar across the full viewport width is visibly slow to scroll on Android phones from before 2022. Limit to elements under ~600px in either dimension.
    • Don’t animate backdrop-filter. Animating the blur radius forces the GPU to recompute the entire blurred area every frame — typically 30-60 dropped frames per animation. If you must animate, use opacity or transform on a parent instead.
    • Don’t stack multiple glass elements in a scroll container. A list of 20 glass cards is 20× the GPU work of one. For lists, use a single backdrop and solid card backgrounds inside it.
    • Don’t use it where there’s nothing interesting behind. A glass card over a flat white page wastes GPU cycles producing an effect nobody can see. Glassmorphism only “earns its budget” over a varied backdrop — gradient, photo, animated background.

    Profiling rule: load your page on a mid-range Android phone (Pixel 5a or equivalent), open Chrome DevTools’ Performance tab, record a scroll. If you see frame drops below 50fps anywhere a glass element is on screen, reduce the blur radius or shrink the glass area until smooth.

    The five mistakes that ruin glassmorphism

    • Forgetting the -webkit- prefix. The most common production bug — works perfectly in your dev browser, broken on every iPhone visitor. Always ship both prefixed and unprefixed versions; use Autoprefixer in your build pipeline.
    • Background opacity too low. An alpha under 0.10 looks invisible against subtle backdrops — the card has no presence. Floor at 0.15 for light themes, 0.06 for dark themes.
    • No border, or a too-subtle border. The border catches “light” from the backdrop and defines the glass edge. Without it, the card looks like a vague hazy patch. Always include border: 1px solid rgba(255,255,255,0.25) minimum.
    • Sharp corners. Real glass is never perfectly sharp at typical UI scales. A 4-8px border radius reads as utilitarian / tacked-on. Go 12-20px for the premium look most designers want.
    • Low-contrast text inside. A cardthat’s 18% opaque white doesn’t give you much background to read text against. Either bump the alpha to 0.30+ for light backdrops, or pair the glass card with a subtle dark gradient overlay where the text sits.

    Accessibility — the contrast trap

    The most common accessibility failure with glassmorphism: text that has 4.5:1 contrast against your “intended” background but only 2.8:1 against the actual rendered colour after the glass card averages with whatever’s behind it. WCAG audits flag the rendered contrast, not the design-tool contrast.

    Two practical mitigations:

    • Run a real audit. Lighthouse and axe-core both compute rendered contrast — they’ll tell you when a glass card’s text fails. Run on the actual production page, not just the design mockup.
    • Reserve a darker text zone. Inside the glass card, add a subtle background: rgba(0,0,0,0.10) behind text-heavy areas. The slight darkening pushes text contrast back into the 4.5:1+ range without breaking the glass aesthetic.

    If your glassmorphic design only passes contrast in one specific theme or one specific page state, that’s a sign the design is too brittle for production — keep iterating until it holds up across light/dark and across the range of backdrops it’ll actually appear over.

    When NOT to use glassmorphism at all

    • Forms and dense data tables. Glass is decorative, not functional. Forms need maximum readability and clear input boundaries — a glass card around a 12-field signup form makes everything harder to read.
    • Long-form reading content. Article body text wants high contrast and a stable background. Glass over a varying backdrop produces flickering perceived contrast as the user scrolls.
    • Performance-critical pages. Marketing landing pages with a single glass hero card are fine. Internal dashboards rendering 100+ widgets with glass effects are slow on real-user devices.
    • Anywhere accessibility is mandated. Government, healthcare, education, and finance sites face strict WCAG audits. The contrast complications of glassmorphism are easier to avoid than to mitigate.
    • When the page has no interesting backdrop. Glass on plain white wastes GPU and adds nothing visual. Reach for it only when there’s a real backdrop to interact with.

    Frequently asked questions

    Why doesn’t my glassmorphism effect appear in Safari?

    Safari requires the -webkit-backdrop-filter prefix in addition to the standard backdrop-filter. Without the prefix, Safari (including iOS Safari) silently ignores the property. Add both lines to your CSS — our generator outputs both automatically. If you’re using a build tool, configure Autoprefixer to handle this for you across all your CSS.

    What’s the right blur amount for glassmorphism?

    12-20 pixels is the sweet spot for most use cases. Below 10px reads as a soft focus rather than frosted glass. Above 25-30px loses the connection to whatever’s behind, which defeats the design purpose. Match the blur to the size of the card — small cards (under 200px wide) work fine at 12px, large cards (400px+) benefit from 18-20px.

    Does glassmorphism hurt page performance?

    Yes, measurably, when overused. Each glass element is computed on the GPU on every paint. One small glass card has zero noticeable cost; ten large glass elements in a scroll container produce visible jank on mid-range devices. Limit glassmorphism to hero areas and feature highlights, not feed-style listings or table rows.

    Is glassmorphism still trendy in 2026?

    Yes, particularly since Apple Vision Pro and the macOS Tahoe interface refresh kept the language alive. The technique has matured beyond the 2021 hype phase into a stable design pattern. Like any aesthetic choice, it’s only “trendy” if used thoughtlessly — applied with intent (over real backdrops, with attention to contrast and performance), it reads as polished and intentional rather than dated.

    Can I use glassmorphism without a gradient or photo backdrop?

    Technically yes, practically no. Glassmorphism only “works” when there’s something interesting behind to blur. Glass over a flat white page wastes GPU cycles producing an effect that’s invisible. If your page background is solid, switch to a different design approach (soft shadows, subtle colour tints) or add a gradient or texture before reaching for glass.

    How do I make glassmorphism work on dark backgrounds?

    Lower the background alpha — try rgba(255,255,255,0.06) instead of 0.18. The white tint reads much brighter against dark backdrops than against light ones, so a value tuned for light theme looks washed out on dark. Use a CSS variable for the alpha and switch its value in your dark-mode media query for clean dual-theme support.

    Related tools and guides