pub struct Emit {
pub border_width: &'static str,
pub focus_width: &'static str,
pub target_min: &'static str,
pub class_prefix: &'static str,
pub required_marker: &'static str,
}Expand description
Re-exported so a consumer’s build.rs needs one dependency rather than
three. Nothing here wraps it; the emitter’s options are the emitter’s.
How the emitted CSS is shaped.
Fields§
§border_width: &'static strBevel thickness, as a CSS length.
A value, so it arrives from the caller: border widths belong to
makeover-geometry and will come from there once it carries them.
focus_width: &'static strFocus ring thickness, as a CSS length.
Separate from border_width, and never derived
from it: a bevel and a focus indicator answer different questions, and
only one of them has to be noticed from across a desk.
The default is the measured consensus rather than a new opinion. Every consumer had already written its own ring and all three chose at least 2px: the MNW server 2px across 10 rules, Balanced Breakfast 2px, goingson 2px on three rules and 3px on the one covering twelve selectors. The design system was the only thing in the tree saying 1px.
target_min: &'static strThe smallest a pointer target may be drawn, as a CSS length.
A value for border_width’s reason, and it goes
to makeover-geometry on the same trip: a floor is a size, and this
crate names no sizes of its own.
The default is WCAG 2.2’s target minimum. It is an absolute rather than a step off the geometry base, and that is deliberate on two counts: a floor that scales with the reader’s root size is not a floor, and the touch density opens the gaps between targets rather than licensing a smaller one for a pointer.
class_prefix: &'static strPrefix for emitted class names, without the leading dot.
required_marker: &'static strWhat marks a compulsory field, appended to its label.
makeover-tui’s PieceStyle::required_marker and
makeover-immediate’s FieldStyle::required_marker, said here for the
third renderer, with their default. A knob for their reason: it is the
one piece of copy this crate emits, and copy is not a renderer’s
call.
This crate was the outlier. Field::required reached it as the HTML
attribute and nothing else, so a browser refused an empty submit and
the screen never said which fields would do that, while both sibling
renderers had marked the label since they were written.
§Why it is hidden from the accessibility tree here and nowhere else
The control already carries required, which a screen reader
announces. A marker read out beside it is the same fact twice, so the
span is aria-hidden. The other two renderers have no such attribute
to lean on, which is why the marker is part of the label string there
and an element here.