taste-skill-v2-experimental

软件研发 界面 · 动效 · 设计品味 1 文件 EN 原文

taste-skill 的 v2 实验版

Old v2 (experimental) of taste-skill, the single-file dial-driven version, preserved for projects depending on its exact behavior. The current default is `design-taste-frontend` (v2). Use this install name only if you need the earlier behavior. Anti-slop frontend rules for landing pages, portfolios, and redesigns, with real design systems when applicable, audit-first redesigns and a strict pre-flight check.

说明语言:英文

来源leonxlnxtaste-skill ↗ 查看原文件 ↗版权归原作者,请遵循原仓库许可
安装
npx skills add https://github.com/leonxlnx/taste-skill --skill taste-skill-v2-experimental

需要已安装 skills CLI。也可以直接从源仓库 clone。

在星云中查看 ↗
SKILL.md 原文

name: design-taste-frontend-v2-experimental description: Old v2 (experimental) of taste-skill, the single-file dial-driven version, preserved for projects depending on its exact behavior. The current default is design-taste-frontend (v2). Use this install name only if you need the earlier behavior. Anti-slop frontend rules for landing pages, portfolios, and redesigns, with real design systems when applicable, audit-first redesigns and a strict pre-flight check. ---

tasteskill: Anti-Slop Frontend Skill

Landing pages, portfolios, and redesigns. Not dashboards, not data tables, not multi-step product UI. Every rule below is contextual. None of it fires automatically. First read the brief, then pull only what fits.

0. BRIEF INFERENCE (Read the Room Before Anything Else)

Before touching code or tweaking dials, infer what the user actually wants. Most LLM design output is bad because the model jumps to a default aesthetic instead of reading the room.

0.A Read these signals first

  1. Page kind - landing (SaaS / consumer / agency / event), portfolio (dev / designer / creative studio), redesign (preserve vs overhaul), editorial / blog.
  2. Vibe words the user used - "minimalist", "calm", "Linear-style", "Awwwards", "brutalist", "premium consumer", "Apple-y", "playful", "serious B2B", "editorial", "agency-y", "glassy", "dark tech".
  3. Reference signals - URLs they linked, screenshots they pasted, products they named, brands they're competing with.
  4. Audience - B2B procurement panel vs. design-conscious consumer vs. recruiter scanning a portfolio. The audience picks the aesthetic, not your taste.
  5. Brand assets that already exist - logo, color, type, photography. For redesigns, these are starting material, not optional input (see Section 11).
  6. Quiet constraints - accessibility-first audiences, public-sector, regulated industries, trust-first commerce, kids' products. These constraints OVERRIDE aesthetic preference.

0.B Output a one-line "Design Read" before generating

Before any code, state in one line: "Reading this as: \<page kind> for \<audience>, with a \<vibe> language, leaning toward \<design system or aesthetic family>."

Example reads:

0.C If the brief is ambiguous, ask one question, do not guess

Ask exactly one clarifying question - never a multi-question dump - and only when the design read genuinely diverges. Example: "Should this feel closer to Linear-clean or Awwwards-experimental?"

If you can confidently infer from context, do not ask. Just declare the design read and proceed.

0.D Anti-Default Discipline

Do not default to: AI-purple gradients, centered hero over dark mesh, three equal feature cards, generic glassmorphism on everything, infinite-loop micro-animations everywhere, Inter + slate-900. These are the LLM defaults. Reach past them deliberately based on the design read.


1. THE THREE DIALS (Core Configuration)

After the design read, set three dials. Every layout, motion, and density decision below is gated by these.

Baseline: 8 / 6 / 4. Use these unless the design read overrides them. Do not ask the user to edit this file - overrides happen conversationally.

1.A Dial Inference (design read → dial values)

SignalVARIANCEMOTIONDENSITY
"minimalist / clean / calm / editorial / Linear-style"5-63-42-3
"premium consumer / Apple-y / luxury / brand"7-85-73-4
"playful / wild / Dribbble / Awwwards / experimental / agency"9-108-103-4
"landing page / portfolio / marketing site (default)"7-96-83-5
"trust-first / public-sector / regulated / accessibility-critical"3-42-34-5
"redesign - preserve"match existing+1match existing
"redesign - overhaul"+2+2match existing

1.B Use-Case Presets

Use caseVARIANCEMOTIONDENSITY
Landing (SaaS, mainstream)764
Landing (Agency / creative)983
Landing (Premium consumer)763
Portfolio (Designer / studio)873
Portfolio (Developer)654
Editorial / Blog643
Public-sector service325
Redesign - preservematchmatch+1match
Redesign - overhaul+2+2match

1.C How the Dials Drive Output

Use these (or user-overridden values) as global variables. Cross-references throughout this document refer to these exact variable names - never invent aliases like LAYOUT_VARIANCE or ANIM_LEVEL.


2. BRIEF → DESIGN SYSTEM MAP

Once you have the design read (Section 0) and dials (Section 1), pick the right foundation. Do not invent CSS for things that have an official package. Do not pretend an aesthetic trend is an official system.

2.A When to reach for a real design system (use official packages)

Brief reads as…Reach forWhy
Microsoft / enterprise SaaS / dashboards@fluentui/react-components or @fluentui/web-componentsOfficial Fluent UI, Microsoft tokens, accessibility done
Google-ish UI, Material-flavored product@material/web + Material 3 tokensOfficial, theme-able via Material Theming
IBM-style B2B / enterprise analytics@carbon/react + @carbon/stylesOfficial Carbon, mature data-density patterns
Shopify app surfacespolaris.js web components / Polaris ReactRequired for Shopify admin UI
Atlassian / Jira-style product@atlaskit/* + @atlaskit/tokensOfficial Atlassian DS
GitHub-style devtool / community page@primer/css or @primer/react-brandOfficial Primer; Brand variant for marketing
Public-sector UK servicegovuk-frontendLegally / regulatorily expected
US public-sector / trust-firstuswdsSame
Fast local-business / agency MVPBootstrap 5.3Boring, fast, works
Modern accessible React foundation@radix-ui/themesPrimitives + polished theme
Modern SaaS where you own the componentsshadcn/ui (npx shadcn@latest add ...)You own the code, easy to customise; never ship default state
Tailwind-based modern SaaS / AI marketingTailwind v4 utilities + dark: variantDefault for indie + small team builds

Honesty rule: if the brief reads as one of the systems above, install and use the official package. Do not recreate its CSS by hand. Do not import a system's tokens but then override 90% of them.

One system per project. Do not mix Fluent React with Carbon in the same tree. Do not import shadcn/ui components into a Material 3 app.

2.B When the brief is an aesthetic, not a system

For these directions, there is no single official package. Build with native CSS + Tailwind + a maintained component library. Be honest in code comments about what is borrowed inspiration vs. official material.

AestheticHonest implementation
Glassmorphism / "frosted glass"backdrop-filter, layered borders, highlight overlays. Provide solid-fill fallback for prefers-reduced-transparency.
Bento (Apple-style tile grids)CSS Grid with mixed cell sizes. No single library owns this.
BrutalismNative CSS, monospace, raw borders. No library.
Editorial / magazineSerif type, asymmetric grid, generous whitespace. No library.
Dark tech / hackerMono + accent neon, terminal motifs. No library.
Aurora / mesh gradientsSVG or layered radial gradients. No library.
Kinetic typographyNative CSS animations, scroll-driven animations, GSAP for hijacks. No library.
Apple Liquid GlassApple documents this for Apple platforms only. There is no official liquid-glass.css. Web implementations are approximations using backdrop-filter + layered borders + highlights. Label clearly as approximation.

3. DEFAULT ARCHITECTURE & CONVENTIONS

Unless the design read picks a real design system (Section 2.A), these are the defaults:

3.A Stack

3.B State

3.C Icons

3.D Emoji Policy

Discouraged by default in code, markup, and visible text. Replace symbols with icon-library glyphs. Override: allow emojis only when the user explicitly asks for a playful / chat-style / social-native vibe - and even then use them sparingly with intent.

3.E Responsiveness & Layout Mechanics

3.F Dependency Verification (mandatory)

Before importing ANY 3rd-party library, check package.json. If the package is missing, output the install command first. Never assume a library exists.


4. DESIGN ENGINEERING DIRECTIVES (Bias Correction)

LLMs default to clichés. Override these defaults proactively. Each rule has a context-aware override path.

4.1 Typography

4.2 Color Calibration

4.3 Layout Diversification

4.4 Materiality, Shadows, Cards

4.5 Interactive UI States

LLMs default to "static successful state only." Always implement full cycles:

4.6 Data & Form Patterns

4.7 Layout Discipline (Hard Rules. Failing any of these is shipping broken work)

4.8 Image & Visual Asset Strategy

Landing pages and portfolios are visual products. Text-only pages with fake-screenshot divs are slop.

Priority order for visual assets:

  1. Image-generation tool first. If ANY image-gen tool is available in the environment (generate_image, MCP image tool, IDE-integrated gen, OpenAI image tools, etc.) you MUST use it to create section-specific assets: hero photography, product shots, texture backgrounds, mood images. Generate at the right aspect ratio for the section. Do not skip this step because hand-rolled CSS feels faster.
  2. Real web images second. When no gen tool is available, use real photography sources. Acceptable defaults:
  3. https://picsum.photos/seed/{descriptive-seed}/{w}/{h} for placeholder photography (seed should describe the section, e.g. marrow-cookware-kitchen)
  4. Actual stock or brand URLs when the brief provides them
  5. Open-license sources (Unsplash via direct URL, Pexels) if explicitly allowed
  6. Last resort: tell the user. If neither is possible, do NOT fill the page with hand-rolled SVG illustrations or div-based "fake screenshots." Instead, leave clearly-labeled placeholder slots (<!-- TODO: hero product photo, 1600x1200 -->) and at the end of the response say: "This page needs real images at: \[list of placements\]. Please generate or provide them."

Even minimalist sites need real images. A pure-text page is not minimalism. It is incomplete work. Even an editorial Linear-style site needs at least 2-3 real images (hero, one product/lifestyle shot, one supporting image). Generate B&W minimalist photography if the brief is restrained; do not skip images entirely because the dial is low.

Real company logos for social proof. When the brief calls for a "Trusted by / Used by / Customers" logo wall, do NOT default to plain text wordmarks (<span>Acme Co</span> styled in a row). Use real SVG logos:

Hand-rolled illustrations:

Div-based fake screenshots are banned. A "hand-built product preview" rendered with <div> rectangles, fake task lists, fake dashboards, fake terminal windows is a Tell. If you need to show a product:

Hero needs a real visual. Text + gradient blob is not a hero - it's a placeholder.

4.9 Content Density

Landing pages live on the first impression, not the full read. Cut ruthlessly.

4.10 Quotes & Testimonials

4.11 Page Theme Lock (Light / Dark Mode Consistency)

The page has ONE theme. Sections do not invert.


5. CONTEXT-AWARE PROACTIVITY

These are tools, not defaults. Use them when the design read calls for them. None of these fire automatically.

5.A Sticky-Stack - Canonical Skeleton

"use client";
import { useRef, useEffect, useId, type ReactNode } from "react";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { useReducedMotion } from "motion/react";

gsap.registerPlugin(ScrollTrigger);

export function StickyStack({ cards }: { cards: ReactNode[] }) {
  const ref = useRef<HTMLDivElement>(null);
  const reduce = useReducedMotion();
  const instanceId = useId().replace(/:/g, "");
  const cardClass = `stack-card-${instanceId}`;
  const innerClass = `stack-card-inner-${instanceId}`;

  useEffect(() => {
    if (reduce || !ref.current || cards.length <= 1) return;
    const ctx = gsap.context(() => {
      const cardEls = gsap.utils.toArray<HTMLElement>(`.${cardClass}`);
      cardEls.forEach((card, i) => {
        if (i === cardEls.length - 1) return;
        ScrollTrigger.create({
          trigger: card,
          start: "top top",                              // pin at viewport top
          endTrigger: cardEls[cardEls.length - 1],
          end: "top top",
          pin: true,
          pinSpacing: false,
          anticipatePin: 1,
          invalidateOnRefresh: true,
        });
        const inner = card.querySelector(`.${innerClass}`);
        if (!inner) return;
        gsap.to(inner, {
          scale: 0.92,
          opacity: 0.55,
          ease: "none",
          scrollTrigger: {
            trigger: cardEls[i + 1],
            start: "top bottom",
            end: "top top",
            scrub: true,
            invalidateOnRefresh: true,
          },
        });
      });
    }, ref);
    return () => ctx.revert();
  }, [reduce, cards.length, cardClass, innerClass]);

  return (
    <div ref={ref} className="relative">
      {cards.map((card, i) => (
        <div
          key={i}
          style={{ zIndex: i + 1 }}
          className={`${cardClass} relative min-h-[100dvh] flex items-center justify-center`}
        >
          <div className={`${innerClass} w-full flex items-center justify-center will-change-transform`}>
            {card}
          </div>
        </div>
      ))}
    </div>
  );
}

Critical points: start: "top top", pin: true, every card except the last is pinned, the scale/opacity transform is driven by the NEXT card's scroll trigger (so previous card shrinks as next one arrives). Never combine CSS position: sticky with pin: true on the same element: the native sticky engine and ScrollTrigger's position: fixed fight at the hand-off (judder, snapping, coordinate drift). The pinned element must also not be the element being transformed - pin the outer card and animate an inner wrapper, or the scale tween throws off the pin measurements. Scope the card class per instance (useId) so two stacks on one page do not cross-select; stack with ascending zIndex. Under prefers-reduced-motion the component renders a plain list: no pin, no transforms, all content reachable.

5.B Horizontal-Pan - Canonical Skeleton

"use client";
import { useRef, useEffect, type ReactNode } from "react";
import { gsap } from "gsap";
import { ScrollTrigger } from "gsap/ScrollTrigger";
import { useReducedMotion } from "motion/react";

gsap.registerPlugin(ScrollTrigger);

export function HorizontalPan({ children }: { children: ReactNode }) {
  const wrap = useRef<HTMLElement>(null);
  const track = useRef<HTMLDivElement>(null);
  const reduce = useReducedMotion();

  useEffect(() => {
    if (reduce || !wrap.current || !track.current) return;
    const ctx = gsap.context(() => {
      const getDistance = () =>
        Math.max(0, track.current!.scrollWidth - wrap.current!.clientWidth);
      gsap.to(track.current, {
        x: () => -getDistance(),
        ease: "none",
        scrollTrigger: {
          trigger: wrap.current,
          start: "top top",                              // pin starts when section top hits viewport top
          end: () => `+=${getDistance()}`,               // scroll distance = track width minus viewport, recomputed on refresh
          pin: true,
          scrub: 1,
          anticipatePin: 1,
          invalidateOnRefresh: true,
        },
      });
    }, wrap);
    return () => ctx.revert();
  }, [reduce]);

  return (
    <section
      ref={wrap}
      role="region"
      aria-label="Horizontal content track"
      tabIndex={reduce ? 0 : undefined}
      className={`relative w-full ${reduce ? "overflow-x-auto scroll-smooth" : "overflow-hidden"}`}
    >
      <div
        ref={track}
        className={`flex h-[100dvh] w-max items-center ${reduce ? "snap-x snap-mandatory" : ""}`}
      >
        {children}
      </div>
    </section>
  );
}

Critical points: start: "top top", pin: true, end: "+=${getDistance()}" (scroll length = horizontal travel needed), scrub: 1. The wrapper is pinned, the inner track slides horizontally as the user scrolls vertically. x and end must be function-based and paired with invalidateOnRefresh: true; a distance captured once never recomputes - after a resize it overshoots into blank space (or pans to nothing when the track fits). Keep w-max on the track and make each panel non-shrinking (shrink-0 or an explicit width): without it, overflow compression collapses scrollWidth and the section pins without panning. Under prefers-reduced-motion keep every panel reachable: swap the wrapper to overflow-x-auto with snap points instead of leaving overflow-hidden.

5.C Scroll-Reveal Stagger - Canonical Skeleton (lighter alternative)

For simple "items appear as they enter viewport" (no pinning), prefer Motion's whileInView over GSAP - lighter, no ScrollTrigger needed:

"use client";
import { motion, useReducedMotion } from "motion/react";

export function RevealStagger({ items }: { items: string[] }) {
  const reduce = useReducedMotion();
  return (
    <ul className="grid gap-6">
      {items.map((item, i) => (
        <motion.li
          key={item}
          initial={reduce ? false : { opacity: 0, y: 24 }}
          whileInView={{ opacity: 1, y: 0 }}
          viewport={{ once: true, amount: 0.3 }}
          transition={{
            duration: 0.6,
            delay: i * 0.06,
            ease: [0.16, 1, 0.3, 1],
          }}
        >
          {item}
        </motion.li>
      ))}
    </ul>
  );
}

Use this for: feature lists, testimonial grids, logo walls, anything that just needs "enter on scroll." Save GSAP for actual pin/scrub work.

5.D Forbidden Animation Patterns


6. PERFORMANCE & ACCESSIBILITY GUARDRAILS

6.A Hardware Acceleration

6.B Reduced Motion (mandatory)

6.C Dark Mode (mandatory for any consumer-facing page)

6.D Core Web Vitals Targets

6.E DOM Cost

6.F Z-Index Restraint

NEVER spam arbitrary z-50 or z-10. Use z-index strictly for systemic layer contexts (sticky navbars, modals, overlays, grain). Document the z-index scale in a project constants file.


7. DIAL DEFINITIONS (Technical Reference)

DESIGN_VARIANCE (Level 1-10)

MOTION_INTENSITY (Level 1-10)

VISUAL_DENSITY (Level 1-10)


8. DARK MODE PROTOCOL

Dual-mode by default. Never assume light-only unless the brief is print-emulating editorial.

8.A Token Strategy (pick one, stick to it)

8.B Do Not Prescribe Specific Colors Here

The brief and brand decide. This skill enforces only:

8.C Default Mode

Respect prefers-color-scheme unless the brand insists. Add a manual toggle if either mode would lose key brand expression.

8.D Test in Both Modes Before Finishing

Open the page in both modes during development. Do not ship a page you've only seen in one mode.


9. AI TELLS (Forbidden Patterns)

Avoid these signatures unless the brief explicitly asks for them.

9.A Visual & CSS

9.B Typography

9.C Layout & Spacing

9.D Content & Data ("Jane Doe" Effect)

9.E External Resources & Components

9.F Production-Test Tells (banned outright)

These patterns came out of real LLM-generated landing-page tests. They are the signatures the model defaults to when it tries to "look designed." Treat them as hard bans unless the brief explicitly calls for one.

Hero & top-of-page

Section numbering & micro-labels

Separators & dots

Em-dashes & typography flourishes

Fake product previews

Marketing-copy Tells

Pills, labels and version stamps

Decoration text strips

Lists, dividers and scoring

Locale, time, scroll cues

9.G EM-DASH BAN (the single most-violated Tell)

Em-dash (—) is COMPLETELY banned. It is the LLM's signature stylistic crutch and it is the #1 visual Tell in production tests. There is no "limited use" allowance, no "natural language frequency" allowance, no "in body copy is fine" allowance. None.

The ONLY permitted dash characters on the page are:

If your output contains a single — or – anywhere visible to the user, the output fails the Pre-Flight Check and must be rewritten.

This rule is non-negotiable. The agent has historically ignored em-dash limits when phrased as "use sparingly." The phrasing here is binary: zero em-dashes.


10. REFERENCE VOCABULARY (Pattern Names the Agent Should Know)

This is a vocabulary, not a library. The agent should KNOW these pattern names to communicate about them, design with them in mind, and reach for them when the design read calls for them. Implementations and code sketches live in the Block Library (Section 12), which is populated iteratively.

Hero Paradigms

Navigation & Menus

Layout & Grids

Cards & Containers

Scroll Animations

Galleries & Media

Typography & Text

Micro-Interactions & Effects

Animation Library Choice


11. REDESIGN PROTOCOL

This skill handles greenfield builds AND redesigns. Misclassifying the mode is the single biggest source of bad redesign output.

11.A Detect the Mode (first action)

If ambiguous, ask once: "Should this redesign preserve the existing brand, or are we starting visually from scratch?"

11.B Audit Before Touching

Document the current state before proposing changes:

11.C Preservation Rules

11.D Modernisation Levers (priority order)

Apply in order - stop when the brief is satisfied:

  1. Typography refresh - biggest visual lift per unit of risk.
  2. Spacing & rhythm - increase section padding, fix vertical rhythm.
  3. Color recalibration - desaturate, unify neutrals, keep brand accent.
  4. Motion layer - add MOTION_INTENSITY-appropriate micro-interactions to existing components.
  5. Hero & key-section recomposition - restructure top-of-funnel using Section 10 vocabulary.
  6. Full block replacement - only when the existing block is unsalvageable.

11.E Decision Tree: Targeted Evolution vs Full Redesign

11.F What Never Changes Silently

Never modify without explicit user approval:


12. THE BLOCK LIBRARY (Contract - Implementations Land Here Iteratively)

The Reference Vocabulary (Section 10) names patterns. The Block Library implements them with real props, real motion specs, and real code sketches.

Status: schema defined here. Blocks will be added iteratively. Do not freelance new blocks without following this schema.

12.A File Location

skills/taste-skill/blocks/
  hero/
    asymmetric-split.md
    editorial-manifesto.md
    kinetic-type.md
    ...
  feature/
    bento-grid.md
    sticky-scroll-stack.md
    zig-zag.md
    ...
  social-proof/
  pricing/
  cta/
  footer/
  navigation/
  portfolio/
  transition/

12.B Required Frontmatter

---
name: asymmetric-split-hero
category: hero
dial_compatibility:
  variance: [6, 10]
  motion: [3, 10]
  density: [2, 5]
when_to_use: "Landing pages with one strong asset and one strong message. Default hero for SaaS, agency, premium consumer."
not_for: "Editorial / manifesto launches where the message IS the design."
stack: ["react", "next", "tailwind", "motion"]
---

12.C Required Body Sections

  1. Visual sketch - short ASCII or description of the layout.
  2. Props API - the component's interface.
  3. Code sketch - minimal working implementation (Server Component default, Client island for motion).
  4. Mobile fallback - explicit collapse rules for < 768px.
  5. Motion variants - one variant per MOTION_INTENSITY band (1-3, 4-7, 8-10). Reduced-motion fallback explicit.
  6. Dark-mode notes - token strategy specific to this block.
  7. Anti-patterns - common ways this block goes wrong.
  8. References - links to real examples in production.

12.D Block-Library Discipline


13. OUT OF SCOPE

This skill is NOT for:

If the brief is one of the above, say so explicitly, point to the right tool, and only apply this skill's marketing-page / about-page / landing-page parts to the surfaces where they apply.


14. FINAL PRE-FLIGHT CHECK

Run this matrix before outputting code. This is the last filter.

THIS IS NOT OPTIONAL. Run every box. If any box fails, the output is not done.

If a single checkbox cannot be honestly ticked, the page is not done. Fix it before delivering.


APPENDICES - Real Source-Backed Reference Material

The sections below are vendored reference content. They give the agent real install commands, real canonical doc links, and real working starter snippets for each design system named in Section 2. Use them to ground decisions in production reality, not training-data fiction.

Appendix A - Install Commands per Design System

# Material Web (Material 3)
npm install @material/web

# Fluent UI React (v9)
npm install @fluentui/react-components

# Fluent UI Web Components (framework-free)
npm install @fluentui/web-components @fluentui/tokens

# IBM Carbon
npm install @carbon/react @carbon/styles

# Radix Themes
npm install @radix-ui/themes

# shadcn/ui (open code, owned components)
npx shadcn@latest init
npx shadcn@latest add button card badge separator input

# Primer CSS (GitHub product/devtool UI)
npm install --save @primer/css

# Primer Brand (GitHub marketing UI)
npm install @primer/react-brand

# GOV.UK Frontend
npm install govuk-frontend

# USWDS (US Web Design System)
npm install uswds

# Atlassian Design System (Atlaskit)
yarn add @atlaskit/css-reset @atlaskit/tokens @atlaskit/button @atlaskit/badge @atlaskit/section-message @atlaskit/card

# Bootstrap 5.3
npm install bootstrap

# Shopify Polaris Web Components (Shopify apps only)
# Add this to your app HTML head:
#   <meta name="shopify-api-key" content="%SHOPIFY_API_KEY%" />
#   <script src="https://cdn.shopify.com/shopifycloud/polaris.js"></script>

Appendix B - Canonical Sources (read these before reinventing)

Material Web

Fluent UI

Carbon

Shopify Polaris

Atlassian

Primer

GOV.UK

USWDS

Bootstrap

Tailwind

Radix

shadcn/ui

Native CSS / W3C standards

Apple Liquid Glass (Apple platforms only)


Appendix C - Apple Liquid Glass: Honest Web Approximation

Do not treat random CSS snippets as official Apple Liquid Glass.

What is official

Apple documents Liquid Glass inside Apple's Human Interface Guidelines and Developer Documentation for Apple platforms. It is a dynamic material used across Apple platform UI. Apple's native implementation belongs to Apple platform APIs and system components, not a public web CSS package.

Relevant official docs:

What is NOT official

There is no liquid-glass.css from Apple for normal websites.

A web approximation can use:

But that is web glassmorphism / frosted-glass approximation, not official Apple Liquid Glass. Label it as such in comments.

Safer web approximation skeleton

.liquid-glass-web-approx {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / .32);
  background:
    linear-gradient(135deg, rgb(255 255 255 / .30), rgb(255 255 255 / .08)),
    rgb(255 255 255 / .12);
  backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
  -webkit-backdrop-filter: blur(24px) saturate(180%) contrast(1.05);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / .48),
    inset 0 -1px 0 rgb(255 255 255 / .12),
    0 18px 60px rgb(0 0 0 / .18);
}

.liquid-glass-web-approx::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    radial-gradient(circle at 20% 0%, rgb(255 255 255 / .55), transparent 34%),
    linear-gradient(90deg, rgb(255 255 255 / .18), transparent 42%, rgb(255 255 255 / .14));
  pointer-events: none;
}

.liquid-glass-web-approx::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgb(255 255 255 / .14);
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  .liquid-glass-web-approx {
    border-color: rgb(255 255 255 / .18);
    background:
      linear-gradient(135deg, rgb(255 255 255 / .16), rgb(255 255 255 / .04)),
      rgb(15 23 42 / .42);
    box-shadow:
      inset 0 1px 0 rgb(255 255 255 / .22),
      0 18px 60px rgb(0 0 0 / .42);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .liquid-glass-web-approx {
    background: rgb(255 255 255 / .96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

Important: prefers-reduced-transparency has uneven browser support; test it. Always provide enough contrast even without blur.


End of appendices. Install commands above are reality anchors. The Apple Liquid Glass skeleton is a labeled approximation, not an Apple-issued package. For canonical docs per design system, consult the system's official docs (links in Section 2 plus Appendix B).

同类技能
animateanimate-expoanimation-performanceanimation-vocabularyapple-designask-sonnerbrandkitbreak-ui
本页内容来自开源项目 leonxlnx, 版权归原作者所有。
本站仅作技能索引与分享,所有 Skill 版权归其原作者所有。