Skip to main content

depth_rules

Function depth_rules 

Source
pub fn depth_rules(opts: &Emit) -> String
Expand description

One rule per depth: its fill and its edge, together.

A depth and nothing else. .raised says a surface sits on what is behind it, which is a statement about the shape and not about what happens when a pointer arrives, so it emits no hover, press, focus or disabled rule. The named surfaces are where interaction lives: .card and .button are the same depth and controls, and they get their states from [surface_rules].

This class carried the interactive set until 0.17.0, which left the vocabulary with no raised surface that is merely an object. Consumers that needed one took a control class and cancelled half of it instead: sixteen elements in goingson across three .card--* variants, each re-asserting the resting fill and bevel on :hover and :active. Nothing anywhere used .raised itself, so the states were unasked-for in every consumer at once.