pub enum Density {
Pointer,
Touch,
}Expand description
Which input the layout is being sized for.
A preset, not a breakpoint, and orthogonal to Surface: density decides
which step a relationship picks, the surface decides how that step lands.
Which density applies is the app’s call — GoingsOn and Balanced Breakfast
already decide it once and hang a ui-mode-* class off the result.
Variants§
Pointer
Mouse or trackpad. Resolves to the Mac OS 8 HIG’s own proportions.
Touch
Finger. Opens the gaps that separate distinct tap targets and leaves the shells where Pointer put them, because a coarse contact patch raises mis-tap cost and a panel margin is not something you tap. See the crate-level “Density presets” section for the derivation.
Implementations§
Source§impl Density
impl Density
Sourcepub const fn media_condition(self) -> &'static str
pub const fn media_condition(self) -> &'static str
The media condition selecting exactly this density, without the
@media.
A capability question rather than a width or a device, which is the
policy this crate already settled for density_css and which three
consumers previously answered three ways.
The two are not each other’s textual negation, and that is the reason they live in one place. Touch is comma-joined, so it is an OR, and negating an OR gives an AND with both halves inverted. Deriving one from the other by eye is how the pair drifts apart, and it drifts silently: a wrong negation still parses, still minifies, and only shows up as hover states surviving on a phone.
Pointer’s condition is what a renderer wraps a hover rule in.
makeover-touch decides whether a hover rule should be gated;
this decides what the gate is spelled as.