| 1104 |
1104 |
|
/// costs no query and no number, and it is what fixes all four measured widths
|
| 1105 |
1105 |
|
/// whichever fallback the group declared.
|
| 1106 |
1106 |
|
///
|
|
1107 |
+ |
/// # A member that asks to fill
|
|
1108 |
+ |
///
|
|
1109 |
+ |
/// `.run > [data-width="fill"]` gets `flex: 1 1 0`, which is the second half of
|
|
1110 |
+ |
/// what a column has always been able to say, reaching a row of regions.
|
|
1111 |
+ |
/// `flex-basis: 0` and not `auto` is what makes several fills divide the room
|
|
1112 |
+ |
/// equally rather than dividing the leftovers in proportion to their contents;
|
|
1113 |
+ |
/// equal division is [`makeover_layout::Width::Fill`]'s own stated rule. The
|
|
1114 |
+ |
/// floor above still applies, so a fill cannot shrink under what is in it.
|
|
1115 |
+ |
///
|
|
1116 |
+ |
/// A member that says nothing gets nothing, because a flex item with the floor
|
|
1117 |
+ |
/// and no grow is already content-sized. That is why the omitted value here is
|
|
1118 |
+ |
/// `Content` while a control omits `Fill`: each position leaves out what it
|
|
1119 |
+ |
/// already did.
|
|
1120 |
+ |
///
|
| 1107 |
1121 |
|
/// # What each fallback gets, exactly
|
| 1108 |
1122 |
|
///
|
| 1109 |
1123 |
|
/// [`Fallback::Wrap`] is `flex-wrap: wrap`, which is exact. The browser wraps
|
| 1175 |
1189 |
|
// even without anything leaving the flow.
|
| 1176 |
1190 |
|
let _ = writeln!(css, ".{run} > * {{\n min-width: min-content;\n}}");
|
| 1177 |
1191 |
|
|
|
1192 |
+ |
// A member that absorbs what is left. `flex-basis: 0` rather than `auto` is
|
|
1193 |
+ |
// what makes several fills divide the room equally instead of dividing the
|
|
1194 |
+ |
// leftovers in proportion to what is already in them, which is
|
|
1195 |
+ |
// `Width::Fill`'s own rule and the one thing that type states about more
|
|
1196 |
+ |
// than one of them.
|
|
1197 |
+ |
//
|
|
1198 |
+ |
// The `min-width: min-content` floor above is deliberately not overridden.
|
|
1199 |
+ |
// A fill that could shrink below its contents would overlap its neighbour,
|
|
1200 |
+ |
// which is rule 1, and equal division under a floor is still equal division
|
|
1201 |
+ |
// everywhere the floor is not reached.
|
|
1202 |
+ |
//
|
|
1203 |
+ |
// Attribute rather than class, because the width is a fact the description
|
|
1204 |
+ |
// carried rather than a hook this crate invented: the same division
|
|
1205 |
+ |
// `data-tone` and `data-selector` are on the right side of. It beats the
|
|
1206 |
+ |
// `Stack` rule below on specificity whichever order they are written in,
|
|
1207 |
+ |
// which is what a member asking to fill should do to a blanket.
|
|
1208 |
+ |
let _ = writeln!(
|
|
1209 |
+ |
css,
|
|
1210 |
+ |
".{run} > [data-width=\"fill\"] {{\n flex: 1 1 0;\n}}"
|
|
1211 |
+ |
);
|
|
1212 |
+ |
|
| 1178 |
1213 |
|
for fallback in [
|
| 1179 |
1214 |
|
Fallback::Wrap,
|
| 1180 |
1215 |
|
Fallback::Stack,
|