Skip to main content

Module vocabulary

Module vocabulary 

Source
Expand description

Every class this crate is responsible for, as a set rather than one name at a time.

The naming functions (crate::class, crate::option_class, crate::list::part_class, crate::list::cell_part_class) answer “what is this one thing called”. That is half the agreement. The other half is the set: a checker cannot ask “is this app rule re-specifying something makeover already defines” without the list, and this crate is the only place that knows it, because this crate writes the sheet.

§Two sets, because there are two questions

vocabulary is the classes the generated stylesheet writes a rule for. That is the set a drift check wants: an app rule for one of these is a restatement of a rule the app already gets, and unlayered app CSS beats @layer makeover, so the restatement silently wins.

names is every class this crate can put in markup, written down module by module beside the emitters. The two sets are equal, and a test holds them equal: a class an emitter can write and the sheet does not rule is an element that draws as default flow, which is how MNW’s five ssh-keys classes went four months unstyled and how a described form on MNW drew its error as a plain sentence. wiki look-restoration, “zero generated classes left unstyled”. They stay two functions because they are two sources, the sheet scraped and the emitters listed, and the gate is that they agree.

§Why the first set is scraped and not listed

A hand-maintained copy of the sheet’s contents is the defect being fixed, one level up: it can disagree with the sheet, and the day it does, the checker reads the list and the browser reads the sheet. So vocabulary parses the CSS this crate generates. There is no second source to drift from, and a class added to an emitter enters the vocabulary in the same commit that adds it.

Constants§

ELEMENT_CLASSES
Which generated classes each element can plausibly carry.

Functions§

classes_for_element
The generated classes element can carry, prefixed the way opts prefixes them.
classes_in_css
declarations_by_class
Which properties a stylesheet sets on each class it names.
declarations_by_element
Which properties a stylesheet sets on each bare element it names.
deferrals_by_class
Which properties a stylesheet hands back to the layer below, per class.
mentions_by_class
What a stylesheet says about each class, and how strongly.
names
Every class this crate can put in markup or in a rule.
specificity
The specificity of one selector arm.
vocabulary
Every class name the generated stylesheet defines a rule for, prefixed the way opts prefixes them.

Type Aliases§

Specificity
How CSS ranks one selector: ids, then classes, then elements.