Skip to content

feat(design-tokens): finer, neutral grain texture - #3576

Merged
mfal merged 3 commits into
nextfrom
fix/design-tokens-grain
Oct 26, 2026
Merged

mfal merged 3 commits into
nextfrom
fix/design-tokens-grain

Conversation

@mfal

@mfal mfal commented Oct 26, 2026

Copy link
Copy Markdown
Member

What

Replaces the texture.grain token (light and dark) with a finer, neutral luminance grain.

  • Grain size: about 1.5px (baseFrequency 0.45, three octaves) instead of the previous 0.8.
  • Neutral grey: a single noise channel filtered in sRGB with opaque alpha, centred on 50 %. Blended with overlay — as consumers like mStudio do — it adds contrast only, without shifting brightness or greying light surfaces.
  • Strength is baked in via feComponentTransfer (slope = strength, intercept = (1 − slope) / 2 to stay centred): contrast 0.275 in the light theme, 0.21 in the dark theme.

Why

The values come from tuning the mStudio app background against two reference images from design: the grain sits between a crisp 1px grain and a soft 2px grain in size and strength, and stays neutral on light and dark surfaces. With the strength in the token, consumers get it without code changes.

This changes a base token, so it needs a look from design before merging.

Verification

  • Rendered both tokens the way mStudio's background uses them (background: <grain>, <color>; background-blend-mode: overlay, normal): grain strength σ 3.83 (light) / 2.61 (dark), neighbour correlation 0.30 (~1.5px), brightness shift below 0.25 of 255 — identical to the tuned reference.
  • node build-tokens.js builds; pnpm lint passes (pre-push hook).

🤖 Generated with Claude Code

Lisa18289 and others added 2 commits October 26, 2026 08:45
The grain texture is now a finer luminance noise (about 1.5px, base frequency
0.45) that is neutral grey around 50 %, so blended with `overlay` it adds
contrast without lightening or greying the surface. Its strength is part of
the texture: a little stronger in the light theme (contrast 0.275) than in the
dark theme (0.21).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mfal
mfal requested a review from a team October 26, 2026 10:59
@mfal mfal self-assigned this Oct 26, 2026
@mfal
mfal requested a review from Lisa18289 October 26, 2026 11:01
@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report for ./packages/components/

Status Category Percentage Covered / Total
🔵 Lines 64.08% 1422 / 2219
🔵 Statements 63.52% 1461 / 2300
🔵 Functions 49.45% 318 / 643
🔵 Branches 56.14% 758 / 1350
File CoverageNo changed files found.
Generated in workflow #7423 for commit 4c26154 by the Vitest Coverage Report Action

@mfal
mfal enabled auto-merge (squash) October 26, 2026 11:01
@mfal
mfal changed the base branch from main to next October 26, 2026 11:02
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview Deployment

Preview environments are ready:

Type URL
docs pr-3576.docs.review.flow-components.de
storybook pr-3576.storybook.review.flow-components.de

Images:

  • docs: ghcr.io/mittwald/flow/docs:pr-3576
  • storybook: ghcr.io/mittwald/flow/storybook:pr-3576

@mfal
mfal disabled auto-merge October 26, 2026 11:56
@mfal
mfal merged commit a0e2815 into next Oct 26, 2026
25 of 28 checks passed
@mfal
mfal deleted the fix/design-tokens-grain branch October 26, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants