最新苹果液体玻璃Liquid Glass效果CSS实现


点击标题可以见到最新apple全新液态玻璃效果,但使用CSS实现。

苹果推出“液体玻璃”设计语言:一场深刻的视觉革命及其影响
近期,苹果公司在其全球开发者大会(WWDC 2025)上发布了一项名为“液体玻璃”(Liquid Glass)的全新设计语言,这并非传闻中的新型屏幕材料,而是即将应用于其全线操作系统(包括iOS 26、iPadOS、macOS等)的重大用户界面(UI)革新。这一变化标志着自iOS 7以来苹果最全面的设计更新,预示着其软件和未来硬件发展的战略方向。

什么是“液体玻璃”?
“液体玻璃”是一种全新的UI设计美学,其核心在于半透明、动态和光感。它借鉴了visionOS的深度和立体感,旨在让界面元素模拟真实世界中玻璃的光学特性。

主要特征包括:

  • 半透明材质: 系统中的窗口、菜单栏、按钮和控件等元素将呈现出半透明的玻璃质感。
  • 实时光影折射: 界面元素会实时地、动态地反射和折射其背后的壁纸、应用内容或颜色,创造出一种流动和通透的视觉效果。
  • 动态高光与响应: 当用户与设备交互或移动设备时,界面上的“玻璃”元素会产生高光变化,模拟光线在玻璃表面移动的效果,增强了界面的生动性和物理隐喻。
  • 统一的全平台体验: “液体玻璃”将贯穿iPhone、iPad、Mac、Apple Watch乃至CarPlay,旨在创造一个无缝且高度统一的跨设备视觉体验。

优点:
更强的沉浸感和愉悦感: 流动且富有表现力的界面能让用户体验更加生动和有趣。锁屏上的时间会根据壁纸图片智能调整布局,空间场景壁纸也会在用户移动手机时呈现3D效果。

增强的上下文感知: 半透明的设计让用户在操作当前任务时,仍能隐约感知到背景层级的内容,提升了多任务处理时的空间感。

潜在争议与挑战:
可读性下降: 有部分早期测试和评论指出,在某些浅色或复杂的背景下,半透明元素上的文字和图标可能会变得难以辨认,影响阅读效率。

视觉干扰: 对于追求简洁和高效率的用户来说,过于动态和“花哨”的界面可能会分散注意力,甚至被一些用户认为“丑”或“杂乱”。苹果为此保留了在“辅助功能”中“减少透明度”的选项来应对此问题。

有传言称,苹果正在研发代号为“Glasswing”的20周年纪念版iPhone(预计2027年),其特点是拥有曲面玻璃边缘、极窄边框甚至无开孔的全面屏。届时,“液体玻璃”的UI将与这种全玻璃的硬件设计在美学上达到完美统一。

 在业界普遍认为苹果在生成式AI领域进展相对缓慢的背景下,推出一场惊艳的视觉革命,可以有力地展示其在图形处理、自研芯片(Apple Silicon)算力以及软硬件结合上的深厚实力,从而在一定程度上转移公众对AI功能落后的关注。

苹果在设计领域向来是潮流的引领者。正如当年的扁平化设计一样,“液体玻璃”所倡导的拟物与扁平结合的“玻璃拟态”(Glassmorphism)风格,可能会被整个行业的设计师和开发者广泛采纳。


HTML代码:

<div class="container container--inline">
  <div class="glass-container glass-container--rounded glass-container--large">
    <div class="glass-filter"></div>
    <div class="glass-overlay"></div>
    <div class="glass-specular"></div>
    <div class="glass-content glass-content--inline">

      <div class="player">
        <div class="player__thumb">
          <img class="player__img" src='https://images.unsplash.com/photo-1619983081593-e2ba5b543168?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE3NDk1NzAwNDV8&ixlib=rb-4.1.0&q=80&w=400' alt=''>
          <div class="player__legend">
            <h3 class="player<strong>legend</strong>title">All Of Me</h3>
            <span class="player<strong>legend</strong>sub-title">Nao</span>
          </div>
        </div>

        <div class="player__controls">
          <div class="player<strong>controls</strong>play">
            <svg viewBox="0 0 448 512" width="24" title="play">
              <path fill="black" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z" />
            </svg>
          </div>

          <div class="player<strong>controls</strong>ff">
            <svg viewBox="0 0 448 512" width="24" title="play">
              <path fill="black" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z" />
            </svg>

            <svg viewBox="0 0 448 512" width="24" title="play">
              <path fill="black" d="M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z" />
            </svg>
          </div>
        </div>

      </div>
    </div>
</div></div>

<div class="container container--inline">
  <div class="glass-container glass-container--rounded glass-container--medium">
    <div class="glass-filter"></div>
    <div class="glass-overlay"></div>
    <div class="glass-specular"></div>
    <div class="glass-content glass-content--inline">
      <div class="glass-item glass-item--active">
        <svg viewBox="0 0 576 512" width="40" title="home">
          <path d="M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z" />
        </svg>
        Home
      </div>
      <div class="glass-item">
        <svg viewBox="0 0 512 512" width="30" title="layer-group">
          <path d="M12.41 148.02l232.94 105.67c6.8 3.09 14.49 3.09 21.29 0l232.94-105.67c16.55-7.51 16.55-32.52 0-40.03L266.65 2.31a25.607 25.607 0 0 0-21.29 0L12.41 107.98c-16.55 7.51-16.55 32.53 0 40.04zm487.18 88.28l-58.09-26.33-161.64 73.27c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.51 209.97l-58.1 26.33c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 276.3c16.55-7.5 16.55-32.5 0-40zm0 127.8l-57.87-26.23-161.86 73.37c-7.56 3.43-15.59 5.17-23.86 5.17s-16.29-1.74-23.86-5.17L70.29 337.87 12.41 364.1c-16.55 7.5-16.55 32.5 0 40l232.94 105.59c6.8 3.08 14.49 3.08 21.29 0L499.59 404.1c16.55-7.5 16.55-32.5 0-40z" />
        </svg>
        New
      </div>
      <div class="glass-item">
        <svg viewBox="0 0 640 512" width="40" title="wifi">
          <path d="M634.91 154.88C457.74-8.99 182.19-8.93 5.09 154.88c-6.66 6.16-6.79 16.59-.35 22.98l34.24 33.97c6.14 6.1 16.02 6.23 22.4.38 145.92-133.68 371.3-133.71 517.25 0 6.38 5.85 16.26 5.71 22.4-.38l34.24-33.97c6.43-6.39 6.3-16.82-.36-22.98zM320 352c-35.35 0-64 28.65-64 64s28.65 64 64 64 64-28.65 64-64-28.65-64-64-64zm202.67-83.59c-115.26-101.93-290.21-101.82-405.34 0-6.9 6.1-7.12 16.69-.57 23.15l34.44 33.99c6 5.92 15.66 6.32 22.05.8 83.95-72.57 209.74-72.41 293.49 0 6.39 5.52 16.05 5.13 22.05-.8l34.44-33.99c6.56-6.46 6.33-17.06-.56-23.15z" />
        </svg>
        Wifi
      </div>
      <div class="glass-item">
        <svg viewBox="0 0 512 512" width="30" title="music">
          <path d="M470.38 1.51L150.41 96A32 32 0 0 0 128 126.51v261.41A139 139 0 0 0 96 384c-53 0-96 28.66-96 64s43 64 96 64 96-28.66 96-64V214.32l256-75v184.61a138.4 138.4 0 0 0-32-3.93c-53 0-96 28.66-96 64s43 64 96 64 96-28.65 96-64V32a32 32 0 0 0-41.62-30.49z" />
        </svg>
        Library
      </div>
    </div>
  </div>

  <div class="glass-container glass-container--rounded">
    <div class="glass-filter"></div>
    <div class="glass-overlay"></div>
    <div class="glass-specular"></div>
    <div class="glass-content glass-content--alone">

      <div class="glass-item">
        <svg viewBox="0 0 512 512" width="40" title="search">
          <path d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z" />
      </div>
    </div>
  </div>
</div>

<div class="container">
  <div class="glass-container glass-container--small">
    <div class="glass-filter"></div>
    <div class="glass-overlay"></div>
    <div class="glass-specular"></div>
    <div class="glass-content">
      <svg viewBox="0 0 512 512" width="22" title="search">
        <path d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z" />
      </svg>
      Search
    </div>
  </div>

  <div class="glass-container">
    <div class="glass-filter"></div>
    <div class="glass-overlay"></div>
    <div class="glass-specular"></div>
    <div class="glass-content">
      <a href="#">
        <img src="https://assets.codepen.io/923404/finder.png" alt="Finder" />
      </a>
      <a href="#">
        <img src="https://assets.codepen.io/923404/map.png" alt="Maps" />
      </a>
      <a href="#">
        <img src="https://assets.codepen.io/923404/messages.png" alt="Messages" />
      </a>
      <a href="#">
        <img src="https://assets.codepen.io/923404/safari.png" alt="Safari" />
      </a>
      <a href="#">
        <img src="https://assets.codepen.io/923404/books.png" alt="Books" />
      </a>
    </div>

    <!-- SVG FILTER DEFINITION -->
    <svg style="display: none">
      <filter id="lg-dist" x="0%" y="0%" width="100%" height="100%">
        <feTurbulence type="fractalNoise" baseFrequency="0.008 0.008" numOctaves="2" seed="92" result="noise" />
        <feGaussianBlur in="noise" stdDeviation="2" result="blurred" />
        <feDisplacementMap in="SourceGraphic" in2="blurred" scale="70" xChannelSelector="R" yChannelSelector="G" />
      </filter>
    </svg>
  </div>
</div>

CSS代码:

:root {
  --lg-bg-color: rgba(255, 255, 255, 0.25);
  --lg-highlight: rgba(255, 255, 255, 0.75);
  --lg-text: #ffffff;
  --lg-hover-glow: rgba(255, 255, 255, 0.4);
  --lg-red: #fb4268;
  --lg-grey: #5b5b5b;
}

/* ========== BASE LAYOUT ========== */
body {
  margin: 0;
  padding: 2rem 0;
  min-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  background: url(
"https://images.unsplash.com/photo-1588943211346-0908a1fb0b01?crop=entropy&cs=srgb&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE3NDk1MzU4MDV8&ixlib=rb-4.1.0&q=85")
    center/cover;
  animation: bg-move 5s ease-in-out infinite alternate;
}

@keyframes bg-move {
  from {
    background-position: center center;
  }
  to {
    background-position: center top;
  }
}

/* ========== CONTAINER ========== */
.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.container--inline {
  flex-direction: row;
}

/* ========== GLASS CONTAINER ========== */
.glass-container {
  position: relative;
  display: flex;
  font-weight: 600;
  color: var(--lg-text);
  cursor: pointer;
  background: transparent;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: 0 6px 6px rgba(0, 0, 0, 0.2), 0 0 20px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2);
}

.glass-container--rounded {
  border-radius: 5rem;
  margin: 0.5rem;
  fill: var(--lg-grey);
}

.glass-container--small {
  margin: 5rem 0 1rem;
  border-radius: 5rem;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25);
}

.glass-container--large {
  min-width: 32rem;
}

.glass-container--medium {
  min-width: 25rem;
}

.glass-container svg {
  fill: white;
}

/* ========== GLASS ITEM ========== */
.glass-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-radius: 1rem;
  color: var(--lg-grey);
  transition: color 0.3s ease;
  text-align: center;
}

.glass-item svg {
  fill: var(--lg-grey);
  height: 50px;
  margin-bottom: 0.25rem;
}

.glass-item--active {
  background: rgba(0, 0, 0, 0.25);
  color: var(--lg-red);
  margin: 0 -0.5rem;
  padding: 0.25rem 1.95rem;
  border-radius: 5rem;
}

.glass-item--active svg {
  fill: var(--lg-red);
}

.player {
  display: flex;
  align-items: center;
  width: 100%;
  flex: 1 1 auto;
  justify-content: space-between;
}

.player__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.5rem;
}

.player__img {
  width: 5rem;
  height: auto;
  margin: 0.25rem 0;
  border-radius: 0.5rem;
}

.player__legend {
  display: flex;
  flex-direction: column;
  margin: 0 1rem;
  color: black;
}

.player<strong>legend</strong>title {
  font-size: 1rem;
  margin: 0;
}

.player<strong>legend</strong>sub-title {
  font-size: 1rem;
  margin: 0;
  opacity: 0.45;
}

.player__controls {
  margin-right: -1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player<strong>controls</strong>play {
  margin-right: 1rem;
  display: flex;
}

.player<strong>controls</strong>ff {
  display: flex;
}

/* ========== GLASS LAYERS ========== */
.glass-filter {
  position: absolute;
  inset: 0;
  z-index: 0;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  filter: url(#lg-dist) saturate(150%);
  isolation: isolate;
}

.glass-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--lg-bg-color);
}

.glass-specular {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  overflow: hidden;
  box-shadow: inset 1px 1px 0 var(--lg-highlight),
    inset 0 0 5px var(--lg-highlight);
}

.glass-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 1rem 1.5rem 0.9rem;
}

.glass-content--inline {
  padding: 0.25rem 2rem 0.25rem 0.75rem;
  flex: 1 1 auto;
  justify-content: space-between;
}

/* ========== ICONS AND IMAGES ========== */
.glass-content a {
  display: inline-block;
  position: relative;
  padding: 1px;
  border-radius: 1.2rem;
}

.glass-content a img {
  display: block;
  width: 75px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 2.2);
}

.glass-content a img:hover {
  transform: scale(0.95);
}

附加react.JS实现玻璃液体效果:https://codesandbox.io/p/github/JaskoKongen/DemoLiquidGlassReact/main

网友热评:
1、Liquid Glass 应该超出 CSS 的能力。但这不会阻止人们编写 WebGL 着色器。

2、从现在起:浏览器制造商可能正忙于在 CSS 中添加类似 Liquid Glass 的效果。