agentleFS
bydioramabydiorama/ui/.claude/skills/effects/SKILL.md

effects

Skill11 starsChanged 6 days agoMITView on GitHub

Applying @bydiorama/ui's effects layer — glass, grain, sheen, glow, shimmer, ink, and the optional shaders: the parametric gradient ground and halo — to components in a consumer app. Use when someone asks for glass or frosted panels, grain or texture, a shine or sweep on a button, a glow, shimmering status text, gradient headings, an animated gradient or WebGL background, a hero or empty-state ground, a halo while something loads, "make it feel premium", or when adding shaders, WebGL or liquid glass to a Diorama UI.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never add a prop to a component for an effect, and never style its inner parts yourself: the stylesheet reaches the part through data-slot.

    line 29
  2. Very specific:

    Keep it after Tailwind and outside any @layer of your own: effects live in @layer fx, ordered after utilities.

    line 44
  3. Distinctive:

    The floor: No WebGL, before hydration, on the server: every component renders exactly as without the effect.

    line 110

“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Effects on @bydiorama/ui

The effects layer (ADR 0022 in bydiorama/ui) is materials, light and ambient motion laid over components that are already finished. Two registry items:

ItemWhatCost
fxfx() helper + one stylesheet per CSS effectCSS only. Works before hydration, in every engine, statically rendered
shadergradient (one parametric ground), halo, and startShaders()One WebGL2 context, a client script. Optional — install only for these

Apply an effect: a class on the root, nothing else

import { fx } from "@/lib/fx";

<Card className={fx("glass", "edge", "specular")}>…</Card>
<Button className={fx("sheen", "grain")}>Publish</Button>
<p className={fx("shimmer")}>Generating…</p>
<section className={fx("opaque")}>…glass inside stands down…</section>
<section className={fx("gradient")}>…a moving ground, glass on top…</section>
<section className={fx("gradient")} style={{ "--ui-fx-gradient-look": "rise" }}>…a horizon…</section>

Never add a prop to a component for an effect, and never style its inner parts yourself: the stylesheet reaches the part through data-slot. If an effect does nothing on a component, it is not listed for it — check EFFECTS in lib/fx.ts, which says what every effect is for and where it applies. Writing it anyway renders the plain component.

Setup, once, after Tailwind and the theme:

@import "tailwindcss";
@import "./theme-zero.css";   /* or the brand's emitted theme */
@import "./fx/fx.css";
@import "./fx/shader.css";    /* only with the shader item */

Keep it after Tailwind and outside any @layer of your own: effects live in @layer fx, ordered after utilities. Your unlayered CSS still wins over an effect — that is deliberate.

Shaders, once, in a client component at the root (or a <script> in Astro):

useEffect(() => startShaders(), []);   // returns its own stop; StrictMode-safe

Choose by job, not by look

You wantUseNot
A panel over a photo, a video or a moving groundglass (+ edge, inner, specular)glass over a flat page — it is only a tint there
One material across a view: the nav, the cards, the menu opened over themglass on each — the component picks its own thicknesschoosing a "thinner" or "thicker" glass yourself: there is no such knob
Glass off for one dense region — a billing table, a slow embedopaque on the regionremoving glass from each part inside, or overriding the fill by hand
A flat fill to read as a materialgraingrain on an unfilled control: it shows as grey haze
Mark a moment — saved, value reachedsheen + sweep(el) oncea sweep on hover, or on a loop
A control that is ON to read as litglowglow as a focus indicator
"Working…" while an agent runsshimmer on the status text; halo on the busy Buttona spinner beside a shimmer — one signal
A hero heading with presenceinkink on body copy
A moving ground: an empty state, a sign-in, a hero, a panel behind glassgradient on the section; pick the look with --ui-fx-gradient-looka ground behind dense UI; more than one per view; a ground on a control (grounds are sections only)

Choosing the look — one effect, one token; every other knob is shared:

LookReads asGood for
wash (default)a calm field of colour that fills the frameempty states, sign-in, a panel behind glass
sweeptwo big forms lit across their bodies, one strong curvea hero, a feature band
foldlight panes with crisp lit rimsa launch moment, a marketing band
risea horizon: a crisp bright rim low in the frame, copy in the skya landing hero, a "welcome" screen
dawna soft horizon: light rising from below the frame, no rim, copy in the skya sign-in, a calm landing, an onboarding step

Set only what you mean to change. Four knobs follow the look when left at auto: angle, intensity, and the quiet zone's size and height. So look: rise alone is a finished horizon with its copy top left. The other knobs have one default for every look.

Set the knobs anywhere above the ground: on the section, a wrapper or a brand scope — they inherit. The colours default to the scope's own --ui-bg-base and --ui-bg-accent, so a brand scope needs no gradient tokens at all. Write numbers as CSS would: 24deg, 0.1turn, 25%. calc() is not evaluated in a custom property and reads as the default (with a console warning); out-of-range values are clamped.

What the layer guarantees — do not re-solve it

  • Contrast. Glass paints a tint the resolver derives per brand so the inks clear 4.5:1 over anything behind it. Do not lower its opacity "for more glass"; re-emit the theme instead if the brand changed. A ground keeps a quiet zone of its exact base around its copy (bottom left by default), so the ink keeps its audited contrast — put the copy there, or move the zone to the copy (--ui-fx-gradient-quiet-x / -y).
  • Thickness by role. Sidebar and NavRail are the quietest pane (--ui-nav-bg-glass, derived from the nav's own colours, 12px blur, no lit top edge); Card, Badge and unfilled Buttons are as before; Popover and Menu are the thickest (--ui-bg-glass-overlay, 32px blur, lit along the top), because they open over what the reader was in. No tier is thinner than --ui-bg-glass. Select, Combobox, Tooltip, Modal, Sheet and Drawer take no glass.
  • Accessibility. Reduced transparency, or fx("opaque") on an ancestor or the part itself → the component's own opaque fill; the edge light stays. Any motion level below full (the OS preference, or data-ui-motion on the element or an ancestor) → no ambient animation, one still shader frame, sweep() plays nothing. Forced colours → the plain component. You add nothing.
  • The floor. No WebGL, before hydration, on the server: every component renders exactly as without the effect.

Tuning

Override tokens on a scope, like any component variable:

TokenDefaultMoves
--ui-fx-glass-blur / -blur-control24px / 12pxbackdrop blur on surfaces / controls
--ui-fx-glass-blur-frame / -blur-overlay12px / 32pxbackdrop blur on Sidebar and NavRail / Popover and Menu
--ui-fx-grain + --ui-fx-grain-amountsubtle tile, 0.03var(--ui-fx-grain-visible), 0.07 for a grainier brand
--ui-fx-ambient-speed10.5 calm, 1.7 expressive — the grounds, ink, shimmer
--ui-fx-gradient-lookwashwash · sweep · fold · rise · dawn
--ui-fx-gradient-base / -lightthe scope's --ui-bg-base / --ui-bg-accentthe gradient's two colours; every other tone is derived from them
--ui-fx-gradient-angleautothe direction the forms run (deg, turn, rad)
--ui-fx-gradient-sharpness0.50 soft … 1 crisp edges and rims
--ui-fx-gradient-scale1the forms' size: 0.6 tight, 1.6 broad
--ui-fx-gradient-chroma1colourfulness: 0.6 quiet, 1.4 vivid
--ui-fx-gradient-intensityautohow far the field leaves the base: 0.5 is a hint
--ui-fx-gradient-quiet + -quiet-x / -quiet-yauto (0.42; 0.3 for the horizons) at 0.16, autothe quiet zone's radius (a fraction of the width; 0 = none, copy on glass) and centre (0..1 from the top left) — put it where the copy is
--ui-fx-gradient-dissolve00.15–0.25 melts the ground's edge into the page

Never tune --ui-fx-glass-wash, -grade or -bloom up in dark: that light sits under text, and the resolver's floor counts exactly the current amount.

Traps already paid for

TrapRule
"Liquid glass that bends the content behind it"Not possible on the web stack outside Chromium: a canvas cannot read the page. Two shader versions were built and removed. Use glass
A halo cut flat on one sideIt reaches 22px outside its part; an overflow: hidden ancestor clips it. Give it room
Sheen on a pale brand accentWhite light lifts a pale fill toward white and it reads disabled. Sheen wants a mid-to-dark fill
A glass card in a theme emitted before glass existedFalls back to the opaque surface. Re-emit the theme to get --ui-bg-glass
A glass nav or menu in a theme emitted before 2026-11-20The nav falls back to the opaque nav, the menu and popover to the opaque surface. Re-emit the theme to get --ui-nav-bg-glass and --ui-bg-glass-overlay
fx("opaque") around a menu that stays glassPopover and Menu portal to the body, out of the region. Put fx("opaque") on the panel itself, or portal it into the region with container
Copy wider than the quiet zone on a narrow groundThe zone is a fraction of the ground's width; copy is fixed in px. Below ~900px wide, raise --ui-fx-gradient-quiet (0.6 holds a 440px block on a 600px ground) or put the copy on glass
Copy on a ground, outside its quiet zoneThe ground is free to be bright there; nothing keeps that text legible. Move the zone (--ui-fx-gradient-quiet-x / -y) to the copy, or the copy into the zone — or set the zone to 0 and put the copy on glass
Changing the look by swapping classesThere is one class. Change --ui-fx-gradient-look; the same canvas redraws in the new look
fx("aurora") in an appRetired 2026-11-22 (ADR 0025). On a ground use fx("gradient"); on a control, sheen, grain or glow
Clipping a shader canvas with CSSiOS Safari drops the clip while it animates. The shader draws its own shape; never add overflow/border-radius hacks to the canvas
Judging an effect in headless ChromiumThe worst defects of this layer only showed on an iPhone. Look on a device, both schemes
Everything carries an effectAn effect is emphasis; emphasis everywhere is none. One glass surface and one lit action per view is plenty

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.