fix(theme): drop the -webkit-backdrop-filter fallbacks

The frosted-glass surface disappeared from builds. Two causes stacked:
lightningcss (vite's css minifier) collapses a standard-first pair
into the prefixed declaration alone, and -webkit-backdrop-filter is
dead weight everywhere — Chromium and Firefox don't recognize it, and
WebKit ignores var() values in it (bug 289800).

Only the standard property is written now. The minifier re-adds the
prefix from it for its own targets. Safari 17 and earlier show the
translucent color without the blur, noted in the glass recipe's
warning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pull/5400/head
Divyansh Singh 2 weeks ago
parent 26b76d6d9e
commit a2a0a923e5

@ -75,7 +75,7 @@ For example, a frosted-glass navbar:
The same treatment carries over to the local nav: `--vp-local-nav-bg-color` follows the navbar surface color by default, and where the two bars meet they share a single blurred surface, so the glass stays continuous across them. The same treatment carries over to the local nav: `--vp-local-nav-bg-color` follows the navbar surface color by default, and where the two bars meet they share a single blurred surface, so the glass stays continuous across them.
::: warning ::: warning
`backdrop-filter` has a measurable scroll performance cost, especially on large or high-DPI screens. When using a translucent bar, also check text contrast over your page content. `backdrop-filter` has a measurable scroll performance cost, especially on large or high-DPI screens. When using a translucent bar, also check text contrast over your page content. Safari 17 and earlier don't apply variable-driven backdrop filters, so they show the translucent color without the blur.
::: :::
When the nav items don't fit the available width, they move into the `⋯` menu at the end of the navbar instead of being clipped, starting with the social links, the appearance switch and the locale switcher, followed by the nav items right-to-left. Its button label can be localized with [`extraMenuLabel`](../reference/default-theme-config#extramenulabel). When the nav items don't fit the available width, they move into the `⋯` menu at the end of the navbar instead of being clipped, starting with the social links, the appearance switch and the locale switcher, followed by the nav items right-to-left. Its button label can be localized with [`extraMenuLabel`](../reference/default-theme-config#extramenulabel).

@ -87,7 +87,6 @@ const isScrolled = computed(() => y.value >= navHeight.value)
z-index: -1; z-index: -1;
background-color: var(--vp-local-nav-bg-color); background-color: var(--vp-local-nav-bg-color);
backdrop-filter: var(--vp-nav-backdrop-filter); backdrop-filter: var(--vp-nav-backdrop-filter);
-webkit-backdrop-filter: var(--vp-nav-backdrop-filter);
transition: background-color 0.25s; transition: background-color 0.25s;
} }

@ -106,7 +106,6 @@ const overflow = provideNavOverflow({
z-index: -1; z-index: -1;
background-color: var(--vp-nav-bg-color); background-color: var(--vp-nav-bg-color);
backdrop-filter: var(--vp-nav-backdrop-filter); backdrop-filter: var(--vp-nav-backdrop-filter);
-webkit-backdrop-filter: var(--vp-nav-backdrop-filter);
transition: background-color 0.25s; transition: background-color 0.25s;
} }
@ -123,7 +122,6 @@ const overflow = provideNavOverflow({
.VPNavBar.home.top::before { .VPNavBar.home.top::before {
background-color: var(--vp-nav-home-bg-color); background-color: var(--vp-nav-home-bg-color);
backdrop-filter: none; backdrop-filter: none;
-webkit-backdrop-filter: none;
} }
.VPNavBar.has-sidebar { .VPNavBar.has-sidebar {
@ -150,7 +148,6 @@ const overflow = provideNavOverflow({
.VPNavBar.has-local-nav::before { .VPNavBar.has-local-nav::before {
background-color: transparent; background-color: transparent;
backdrop-filter: none; backdrop-filter: none;
-webkit-backdrop-filter: none;
} }
} }

Loading…
Cancel
Save