Skip to main content

ELEMENT_CLASSES

Constant ELEMENT_CLASSES 

Source
pub const ELEMENT_CLASSES: &[(&str, &[&str])];
Expand description

Which generated classes each element can plausibly carry.

The half of the element check that CSS cannot answer. A stylesheet says button { color: ... } and .chip { color: ... } and nothing in either text says a chip is rendered as a <button>; the renderer knows that, and this crate is the renderer. So the pairing is declared here rather than inferred, and declarations_by_element supplies the other half.

Read it as “may carry”, not “does carry”. A pairing that never occurs in a given app costs a check that finds nothing; a pairing left out is a defect that ships, which is the trade this list is written on the generous side of.

div and span are deliberately absent. Nearly every container class in the vocabulary sits on one of them, so the pairing would be the whole vocabulary against one rule and would say nothing about which class was meant. An app writing a bare div { } rule has a wider problem than this check, and the classes it would clobber are containers rather than the controls whose tone and bevel carry meaning.