Communitygithub.com

Liquid Glass デザインシステム(iOS 26)

iOS 26 の Liquid Glass デザインシステム — SwiftUI、UIKit、WidgetKit 向けの動的ガラスマテリアルで、ぼかし、反射、インタラクティブなモーフィングを提供します。

Liquid Glass デザインシステム(iOS 26) とは?

Liquid Glass デザインシステムは、Apple の iOS 26 で導入された新しいガラスマテリアルを実装するための包括的なパターン集です。このマテリアルは背後にあるコンテンツをぼかし、周囲の色や光を反射し、タッチやポインタ操作に反応します。SwiftUI、UIKit、WidgetKit の3つのプラットフォームをサポートし、それぞれに最適化された API を提供します。SwiftUI では `glassEffect()` 修飾子を使って簡単にガラス効果を追加でき、`GlassEffectContainer` と `glassEffectID` を組み合わせることで、ビュー階層の変更時に滑らかなモーフィングトランジションを実現します。UIKit では `UIGlassEffect` と `UIGlassContainerEffect` クラスを利用し、WidgetKit では `widgetRenderingMode` を検出してアクセントモードに適応します。パフォーマンス最適化のために、複数のガラス効果を持つビューは常にコンテナでラップし、`spacing` パラメータで形状の融合距離を調整します。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/ECC/tree/main/skills/liquid-glass-design

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Liquid Glass デザインシステム(iOS 26) は何をしますか?

Apple の Liquid Glass を実装するためのパターン集です。これは背後にあるコンテンツをぼかし、周囲の色や光を反射し、タッチやポインタ操作に反応する動的なマテリアルです。SwiftUI、UIKit、WidgetKit の統合をカバーします。

アクティベーションのタイミング

  • iOS 26以降の新しいデザイン言語でアプリを構築・更新する場合
  • ガラススタイルのボタン、カード、ツールバー、コンテナを実装する場合
  • ガラス要素間のモーフィングトランジションを作成する場合
  • ウィジェットに Liquid Glass エフェクトを適用する場合
  • 既存のぼかし/マテリアル効果を新しい Liquid Glass API に移行する場合

コアパターン — SwiftUI

基本的なガラス効果

任意のビューに Liquid Glass を追加する最も簡単な方法:

Text("Hello, World!")
    .font(.title)
    .padding()
    .glassEffect()  // デフォルト: レギュラーバリアント、カプセル形状

形状と色合いのカスタマイズ

Text("Hello, World!")
    .font(.title)
    .padding()
    .glassEffect(.regular.tint(.orange).interactive(), in: .rect(cornerRadius: 16.0))

主なカスタマイズオプション:

  • .regular — 標準的なガラス効果
  • .tint(Color) — 強調表示のための色合いを追加
  • .interactive() — タッチやポインタ操作に反応
  • 形状: .capsule(デフォルト)、.rect(cornerRadius:)、.circle

ガラスボタンスタイル

Button("クリック") { /* アクション */ }
    .buttonStyle(.glass)

Button("重要") { /* アクション */ }
    .buttonStyle(.glassProminent)

複数要素のための GlassEffectContainer

複数のガラスビューは、パフォーマンスとモーフィングのために常にコンテナでラップします:

GlassEffectContainer(spacing: 40.0) {
    HStack(spacing: 40.0) {
        Image(systemName: "scribble.variable")
            .frame(width: 80.0, height: 80.0)
            .font(.system(size: 36))
            .glassEffect()

        Image(systemName: "eraser.fill")
            .frame(width: 80.0, height: 80.0)
            .font(.system(size: 36))
            .glassEffect()
    }
}

spacing パラメータはマージ距離を制御します。近い要素ほどガラス形状が融合します。

ガラス効果の統合

glassEffectUnion を使用して複数のビューを単一のガラス形状に結合:

@Namespace private var namespace

GlassEffectContainer(spacing: 20.0) {
    HStack(spacing: 20.0) {
        ForEach(symbolSet.indices, id: \.self) { item in
            Image(systemName: symbolSet[item])
                .frame(width: 80.0, height: 80.0)
                .glassEffect()
                .glassEffectUnion(id: item < 2 ? "group1" : "group2", namespace: namespace)
        }
    }
}

モーフィングトランジション

ガラス要素の出現/消失時にスムーズなモーフィングを作成:

@State private var isExpanded = false
@Namespace private var namespace

GlassEffectContainer(spacing: 40.0) {
    HStack(spacing: 40.0) {
        Image(systemName: "scribble.variable")
            .frame(width: 80.0, height: 80.0)
            .glassEffect()
            .glassEffectID("pencil", in: namespace)

        if isExpanded {
            Image(systemName: "eraser.fill")
                .frame(width: 80.0, height: 80.0)
                .glassEffect()
                .glassEffectID("eraser", in: namespace)
        }
    }
}

Button("切り替え") {
    withAnimation { isExpanded.toggle() }
}
.buttonStyle(.glass)

サイドバーの下への水平スクロールの拡張

水平スクロールのコンテンツをサイドバーやインスペクタの下に拡張するには、ScrollView のコンテンツがコンテナの先頭/末尾の端に達するようにします。レイアウトが端まで達すると、システムが自動的にサイドバー下のスクロール動作を処理します。追加の修飾子は不要です。

コアパターン — UIKit

基本的な UIGlassEffect

let glassEffect = UIGlassEffect()
glassEffect.tintColor = UIColor.systemBlue.withAlphaComponent(0.3)
glassEffect.isInteractive = true

let visualEffectView = UIVisualEffectView(effect: glassEffect)
visualEffectView.translatesAutoresizingMaskIntoConstraints = false
visualEffectView.layer.cornerRadius = 20
visualEffectView.clipsToBounds = true

view.addSubview(visualEffectView)
NSLayoutConstraint.activate([
    visualEffectView.centerXAnchor.constraint(equalTo: view.centerXAnchor),
    visualEffectView.centerYAnchor.constraint(equalTo: view.centerYAnchor),
    visualEffectView.widthAnchor.constraint(equalToConstant: 200),
    visualEffectView.heightAnchor.constraint(equalToConstant: 120)
])

// contentView にコンテンツを追加
let label = UILabel()
label.text = "Liquid Glass"
label.translatesAutoresizingMaskIntoConstraints = false
visualEffectView.contentView.addSubview(label)
NSLayoutConstraint.activate([
    label.centerXAnchor.constraint(equalTo: visualEffectView.contentView.centerXAnchor),
    label.centerYAnchor.constraint(equalTo: visualEffectView.contentView.centerYAnchor)
])

複数要素のための UIGlassContainerEffect

let containerEffect = UIGlassContainerEffect()
containerEffect.spacing = 40.0

let containerView = UIVisualEffectView(effect: containerEffect)

let firstGlass = UIVisualEffectView(effect: UIGlassEffect())
let secondGlass = UIVisualEffectView(effect: UIGlassEffect())

containerView.contentView.addSubview(firstGlass)
containerView.contentView.addSubview(secondGlass)

スクロール端効果

scrollView.topEdgeEffect.style = .automatic
scrollView.bottomEdgeEffect.style = .hard
scrollView.leftEdgeEffect.isHidden = true

ツールバーのガラス統合

let favoriteButton = UIBarButtonItem(image: UIImage(systemName: "heart"), style: .plain, target: self, action: #selector(favoriteAction))
favoriteButton.hidesSharedBackground = true  // 共有ガラス背景をオプトアウト

コアパターン — WidgetKit

レンダリングモードの検出

struct MyWidgetView: View {
    @Environment(\.widgetRenderingMode) var renderingMode

    var body: some View {
        if renderingMode == .accented {
            // アクセントモード: 白色着色、テーマ付きガラス背景
        } else {
            // フルカラーモード: 標準表示
        }
    }
}

視覚階層のためのアクセントグループ

HStack {
    VStack(alignment: .leading) {
        Text("タイトル")
            .widgetAccentable()  // アクセントグループ
        Text("サブタイトル")
            // プライマリグループ(デフォルト)
    }
    Image(systemName: "star.fill")
        .widgetAccentable()  // アクセントグループ
}

アクセントモードでの画像レンダリング

Image("myImage")
    .widgetAccentedRenderingMode(.monochrome)

コンテナ背景

VStack { /* コンテンツ */ }
    .containerBackground(for: .widget) {
        Color.blue.opacity(0.2)
    }

主要な設計判断

判断根拠
GlassEffectContainer によるラップパフォーマンス最適化、ガラス要素間のモーフィングを有効化
spacing パラメータマージ距離を制御 — 要素がどの程度近いと融合するかを微調整
@Namespace + glassEffectIDビュー階層の変更時にスムーズなモーフィングトランジションを有効化
interactive() 修飾子タッチ/ポインタ操作への反応を明示的にオプトイン — すべてのガラスが応答する必要はない
UIKit の UIGlassContainerEffect一貫性のための SwiftUI と同じコンテナパターン
ウィジェットのアクセントレンダリングモードユーザーが着色ホーム画面を選択した場合、システムが着色ガラスを適用

ベストプラクティス

  • 複数の兄弟ビューにガラスを適用する場合は、常に GlassEffectContainer を使用 — モーフィングを有効にし、レンダリングパフォーマンスを向上
  • .glassEffect() は、他の外観修飾子(frame、font、padding)の後に適用
  • .interactive() は、ユーザーの操作に応答する要素(ボタン、切り替え可能なアイテム)にのみ使用
  • コンテナ内の spacing は慎重に選択 — ガラス効果が融合するタイミングを制御
  • ビュー階層を変更する際は withAnimation を使用 — スムーズなモーフィングトランジションを有効化
  • 異なる外観(ライトモード、ダークモード、アクセント/着色モード)でテスト
  • アクセシビリティのコントラストを確保 — ガラス上のテキストは読みやすくなければならない

避けるべきアンチパターン

  • GlassEffectContainer なしで複数の独立した .glassEffect() ビューを使用する
  • ガラス効果を入れ子にしすぎる — パフォーマンスと視覚的明瞭さが低下する
  • すべてのビューにガラスを適用する — インタラクティブな要素、ツールバー、カードに限定
  • UIKit で角丸を使用する際に clipsToBounds = true を忘れる
  • ウィジェットのアクセントレンダリングモードを無視する — 着色ホーム画面の外観が崩れる
  • ガラスの背後に不透明な背景を使用する — 半透明効果が損なわれる

使用すべきタイミング

  • iOS 26 デザインのナビゲーションバー、ツールバー、タブバー
  • フローティングアクションボタンやカードスタイルのコンテナ
  • 視覚的な奥行きとタッチフィードバックが必要なインタラクティブコントロール
  • システムの Liquid Glass 外観と統合するウィジェット
  • 関連するUI状態間のモーフィングトランジション

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/content-engine

Create platform-native content systems for X, LinkedIn, TikTok, YouTube, newsletters, and repurposed multi-platform campaigns. Use when the user wants social posts, threads, scripts, content calendars, or one source asset adapted cleanly across platforms.

affaan-m/ECC

Multi-platform content distribution across X, LinkedIn, Threads, and Bluesky. Adapts content per platform using content-engine patterns. Never posts identical content cross-platform. Use when the user wants to distribute content across social platforms.

affaan-m/fal-ai-media

Unified media generation via fal.ai MCP — image, video, and audio. Covers text-to-image (Nano Banana), text/image-to-video (Seedance, Kling, Veo 3), text-to-speech (CSM-1B), and video-to-audio (ThinkSound). Use when the user wants to generate images, videos, or audio with AI.

affaan-m/manim-video

日本語翻訳:このファイルは manim-video 用の日本語翻訳が必要です

affaan-m/remotion-video-creation

Remotion のベストプラクティス - React で動画を作成する。3D、アニメーション、音声、字幕、チャート、トランジションなどをカバーするドメイン固有の29のルール。

affaan-m/video-editing

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

agent-self-evaluation

Use after completing any non-trivial task. The agent self-rates its output on 5 axes — accuracy, completeness, clarity, actionability, conciseness — with concrete evidence per criterion. Produces a structured 1-5 scorecard with specific improvement suggestions.

agent-sort

Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

ai-first-engineering

Engineering operating model for teams where AI agents generate a large share of implementation output. Use when setting team process, review gates, or ownership rules for a codebase largely written by agents.

ai-regression-testing

Regression testing strategies for AI-assisted development. Sandbox-mode API testing without database dependencies, automated bug-check workflows, and patterns to catch AI blind spots where the same model writes and reviews code. Use when adding regression coverage to AI-assisted code, or when the same model both wrote and reviewed a change.

android-clean-architecture

Clean Architecture patterns for Android and Kotlin Multiplatform projects — module structure, dependency rules, UseCases, Repositories, and data layer patterns. Use when structuring modules, layers, or data flow in an Android or KMP project.

angular-developer

Generates Angular code and provides architectural guidance. Trigger when creating projects, components, or services, or for best practices on reactivity (signals, linkedSignal, resource), forms, dependency injection, routing, SSR, accessibility (ARIA), animations, styling (component styles, Tailwind CSS), testing, or CLI tooling.

関連スキル