Skip to main content

timing_css

Function timing_css 

Source
pub fn timing_css(path: impl AsRef<Path>)
Expand description

Write makeover-timing’s time axis, and the motion-off block that rides with it, to path.

The third generated axis, and it arrives the same way the spacing one does: a consumer that calls this gets --timing-*, --motion-fade and --cadence-activity without stating a number anywhere. All this adds is the banner and the write; makeover_timing::timing_css is the whole file and already wraps itself in makeover_geometry::CSS_LAYER.

§Its own file, for the reason geometry has its own file

One generated file per crate, named for the axis it carries. Time is not a narrower claim about space the way size class is about density, so folding it into geometry.css would leave a file whose banner names one crate and whose contents come from two. The cost is a fourth <link> in the consumer, which is the cost the family already pays three times.

§The prefers-reduced-motion block is not optional

makeover_timing::timing_css emits the :root values and then a media block overriding two of them. Both land here, in that order, because they are one statement: a sheet carrying only the values animates at every rung for a reader who asked it not to, and does it silently.

§Panics

If the file cannot be written.