Expand description
M3 state layers and disabled emphasis, resolved over the container so a selected control keeps its color under hover and press.
Reference priority is Figma kit > md3.io > m3e.kyralabs.dev. The Figma
Material 3 Design Kit defines the layer opacities as its M3 variables
State Layers/<role>/Opacity-08|10|16 (file key ozddDB2Z1v51f1IFZlUuJ2),
used by its Buttons page as hover 08, focus 10 and a pressed ripple at 10;
disabled content is on-surface under a 0.38 layer and disabled button
containers are State Layers/On Surface/Opacity-10. Fixture:
tests/fixtures/figma-sys-tokens.json. md3.io and m3e
(tests/fixtures/m3e-sys-tokens.json) agree. DISABLED_CONTAINER is the
classic 12% default for components whose kit page does not override it
(buttons use 10%).
Constants§
- DISABLED_
CONTAINER - Disabled containers and content: on-surface at 12% and 38%.
- DISABLED_
CONTENT - DRAG
- FOCUS
- HOVER
- PRESS
- TEXT_
SELECTION - The text selection highlight: primary at 40% (Compose Material 3
TextSelectionColors.kt,TextSelectionBackgroundOpacity = 0.4f).
Functions§
- disabled
colorat disabled content emphasis. The emphasis multiplies the color’s own alpha, so an already translucent role stays proportionally fainter.- hovered
containerunder a hover layer of itscontentcolor.- layer
- Composite a state layer of
contentatopacityovercontainer(source-over alpha compositing). - pressed
containerunder a press layer of itscontentcolor.