Skip to main content

Module meter

Module meter 

Source
Expand description

A proportion, rendered as a bar.

The third phase-B emitter, beside form and list. It is much the smallest, and it is here rather than in the app because the trough it fills has been in phase A since before anything could describe one: progress_rules emitted .progress and .progress-fill[data-tone] for every tone while the only way to say “3 of 7” was to concatenate it into a heading.

§What the pair buys, at the last layer

makeover_layout::Meter carries done and total rather than a percentage, and the reason shows up here. A bar that is full because it landed exactly and a bar that is full because it ran over are the same width and are not the same fact, so the width is not allowed to be the only thing emitted. The over-run leaves as data-over="true", and the accessible name keeps both true numbers.

No CSS rule is emitted for data-over. What an over-run should look like is app taste — goingson already says it with Tone::Danger — and a renderer that picked a stripe for everyone would be decorating rather than describing.

Functions§

meter_html
A meter as a filled trough.
meter_text
The accessible name for a meter: the two numbers, and the noun if it has one.