struct
UI::DesignTokens::Material
- UI::DesignTokens::Material
- Struct
- Value
- Object
Overview
Glass material token branch (two-axis).
#step is the declared ThicknessStep; #semantic is the declared
AppleSemantic; #intensity is the brand-declaration-time scalar
used by the #thickness_for_brand quantizer on web + Android.
Per-step records (#ultra_thin / #thin / #regular / #thick /
#chrome) carry the predefined blur_radius / opacity constants the
quantizer's effective step lookup returns.
Render-time only. Material changes require a re-render — there is no runtime mutator on intensity / step / semantic. Consumers observe brand-overridden values by rebuilding the view tree.
Defined in:
ui/design_tokens/material.crConstructors
Class Method Summary
-
.step_baseline(step : ThicknessStep) : Float64
Per-step baseline multiplier for the quantizer.
Instance Method Summary
-
#apple_semantic : AppleSemantic
--------------------------------------------------------------- Apple axis: the declared semantic, unchanged.
- #apple_step(declared : Symbol) : Symbol
- #chrome : MaterialStep
- #clone
- #copy_with(ultra_thin _ultra_thin = @ultra_thin, thin _thin = @thin, regular _regular = @regular, thick _thick = @thick, chrome _chrome = @chrome, intensity _intensity = @intensity, step _step = @step, semantic _semantic = @semantic)
- #intensity : Float64
-
#material_step_for(s : ThicknessStep) : MaterialStep
Lookup the
MaterialStepfor aThicknessStep. - #regular : MaterialStep
-
#resolve(name : Symbol) : ResolvedStep
Render-time resolution for web / Android.
- #semantic : AppleSemantic
-
#step(name : Symbol) : MaterialStep
--------------------------------------------------------------- Backwards-compat: pre-v2 callers used
#step(:menu)/#step(:thin)with a single-axis Symbol vocabulary. - #step : ThicknessStep
- #thick : MaterialStep
-
#thickness_for_brand : ThicknessStep
--------------------------------------------------------------- Web / Android axis: quantizer model.
- #thin : MaterialStep
- #ultra_thin : MaterialStep
Constructor Detail
Class Method Detail
Per-step baseline multiplier for the quantizer. Step baselines
are deliberately spaced so that at intensity = 1.0 each declared
step quantizes back to itself (UltraThin->UltraThin, etc.),
except Chrome (baseline 1.9) which collapses to Chrome (>= 1.8
bucket) — that's the documented "Chrome is the ceiling" behavior.
Instance Method Detail
Apple axis: the declared semantic, unchanged. Intensity does NOT modify this — Apple materials are role-based.
Lookup the MaterialStep for a ThicknessStep.
Render-time resolution for web / Android. Returns a ResolvedStep
carrying the EFFECTIVE step's predefined blur_radius + opacity (not
proportionally scaled). The name field in the resolved record is
the effective step's Symbol so renderers that key CSS classes /
custom-property suffixes on the step name still find the right
bucket.
Backwards-compat: pre-v2 callers used #step(:menu) / #step(:thin)
with a single-axis Symbol vocabulary. The v2 model splits the
vocabulary (semantics on Apple, thickness on web/Android), so
these shims convert Symbol -> appropriate axis output:
#step(name)— accepts the legacy ThicknessStep symbol shape; unknown symbols fall back to the declared#step.#apple_step(declared)— legacy quantizer call. v2 maps the declared Symbol throughThicknessStep.from_symbol, overrides this Material's step temporarily via copy, then applies#thickness_for_brandand returns the result as a Symbol. Callers (GlassBackground visit, web_renderer, android_renderer) get the same Symbol-in/Symbol-out shape they had pre-v2; the QUANTIZER semantics are now correct.#resolve(name)— preserved; uses the quantizer's effective step to choose blur_radius (not proportional scaling).
Web / Android axis: quantizer model.
Per the v2 architecture doc lines 65-77: baseline = step_baseline(step) i = baseline * intensity <= 0.3 -> UltraThin <= 0.7 -> Thin <= 1.3 -> Regular
= 1.8 -> Chrome else -> Thick