Inset multiplier
--inherit-inset-multiplier is the shared runtime hook for spacing that should grow with context. It lets a parent surface, a container query, or both decide how large inset padding and spacing should feel without hard-coding larger values in every nested component.
Why we use it
- Keeps nested surfaces on the same spacing rhythm when a parent grows or shrinks.
- Lets container-aware components increase inset spacing without rewriting each padding rule at every breakpoint.
- Preserves token-based formulas, so only the multiplier changes while the spacing recipe stays consistent.
Short implementation model
- 1. Publish a public value from the parent or wrapper with `--inherit-inset-multiplier`.
- 2. Resolve that value inside the component to a local variable such as `--c-table--inset-multiplier` or `--c-accordion--inset-multiplier`.
- 3. Calculate padding, gaps, and related spacing from the local multiplier instead of duplicating larger token values.
- 4. If the component is container-aware, combine the inherited value with a local scale using `max(...)` so it never shrinks below its context.
Examples
Consume the inherited value directly
Use the inherited multiplier when a component only needs to follow the spacing rhythm decided by its parent. The accordion reads the public hook and turns it into its own local inset padding variables.
Let a component scale itself from its container
Use a local scale when the component should respond to its own available width. The table keeps inherited spacing when it exists, but can still increase its inset at larger container sizes.
Inset-aware table
| Service | Owner | Status | Updated |
|---|---|---|---|
|
Cards
|
UX team | Stable | Today |
|
Tables
|
Platform | Pilot | Yesterday |
|
Forms
|
Core | Stable | Today |
Publish the same inset rhythm to nested children
Use the public inherit variable when a parent component should keep nested components aligned with its own container-aware spacing. The card publishes its resolved multiplier so the nested accordion follows the same inset rhythm.
Implementation snippets
These are the three recurring patterns: publish the public hook, consume it into a local component variable, and combine it with a container-aware scale when the component also adapts to its own width.
[data-component="accordion"] {
--inherit-inset-multiplier: var(--c-card--inset-multiplier);
}