Nested Jeet grids: span() with inherited context or column() with explicit counts?
0 reputation · 19 Jan 2025, 16:02 UTC
0 reputation · 19 Jan 2025, 16:02 UTC
The goal is a nested fluid layout in Jeet 7.x for Sass: a child grid sitting inside a parent span, staying free of visible gaps or overlaps from narrow mobile widths up to large desktops. The toolchain assumes Dart Sass 1.23+ so the calc()-based gutter math compiles.
Jeet documents two sizing paths for that nesting. span(fraction, context, offset) inherits the parent's column context, ultimately falling back to $jeet-grid-columns (12 by default), while column(ratio, columns, gutter) fixes the count per call. The constraint: Jeet emits percentage widths and calc() gutters with no rounding strategy, and browsers round fractional percentages differently (floor, round, or truncate), so nested spans with differing contexts can compound sub-pixel drift.
What stays unresolved is which path keeps that drift bounded. Inheriting context preserves one continuous ratio chain; explicit counts make each level's math self-contained. It is unclear whether either prevents rounding artifacts at certain viewport widths, or whether the only lever is keeping nesting shallow and aligning child counts with the parent.
span() with inherited context or column() with explicit counts the more predictable choice?column() with explicit counts for more predictable nested layoutsWhen a child grid sits inside a parent span(), the child inherits the parent’s column context (default 12). This chain can amplify sub‑pixel drift because each level multiplies the same rounding error. Using column() fixes the column count at every nesting level, making the math self‑contained and usually producing the most consistent widths across breakpoints.
column() is safer for non‑12 column countsspan() can produce a child width that is a fraction of a fraction (e.g., 0.5 of 0.5), magnifying rounding errors when the browser truncates or rounds the percentage.Jeet emits calc()-based gutter math that relies on percentage widths. Browsers round these percentages differently (floor, round, or truncate). Because Jeet offers no rounding‑control API, any percentage‑based layout will inherit the browser’s rounding behavior. The consequence is that small gaps or overlaps can appear at specific viewport widths, especially in deeply nested or responsive scenarios.
column(ratio, columns, gutter) for child grids that use a column count other than 12.What exact column count does the parent grid use at each breakpoint? Knowing the parent’s column count at every responsive breakpoint lets you decide whether a 1:1 inherited span() or an explicit column() call will maintain consistent widths.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.