Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-MYST-053

Grids lay out cards in responsive columns

When a document holds a `{grid}` with `{grid-item-card}` items, the extension SHALL lay out its items in the columns of its argument, such as `1 1 2 2`, for the extra-small, small, medium and large panes, chosen by the pane width.

Step 1 of path 1 in StRS-MDOKFSTUDIO-MYST-016: from “A document holds a grid with grid-item-card items” to “The cards are laid out in columns”.

Scenarios 5

The situations the tests check; open one to read it.

nominalColumns per pane size
Given`{grid} 1 1 2 2`
Whenthe preview renders
Thenthe columns per pane size are 1, 1, 2 and 2, one class per breakpoint
boundaryColumn arguments
InputOutcome
Fewer than four valuesThe missing sizes inherit the last value
`auto`Items fill 14 em columns
More than 12At most 12 columns
An invalid value1 column
nominalColumns follow the pane width
InputOutcome
Four items at 900 pxThey form 2 columns
The same grid at 460 pxThey form 1 column, every card inside the pane and the text after the grid intact

The columns are picked by the container width (480, 640 and 800 px), not by the window width.

nominalGrids nest and keep absolute source lines
Givengrids with backtick, tilde or colon fences, nested up to 8 levels, such as a grid in a card
Whenthe preview renders
Theneverything inside, blank lines included, keeps absolute source lines, which scroll sync and block selection rely on
refusalGrids deeper than 8 levels
Givena grid deeper than 8 levels
Whenthe preview renders
Thenit stays an unexpanded directive placeholder

Implemented in 1

Tested by 2

Replaces

SwRS-MDOKFSTUDIO-MYST-054Grid columns follow the pane width superseded superseded by SwRS-MDOKFSTUDIO-MYST-053 Markdown file
SwRS-MDOKFSTUDIO-MYST-055Grid item cards show title, header, body, footer and link superseded superseded by SwRS-MDOKFSTUDIO-MYST-053 Markdown file
SwRS-MDOKFSTUDIO-MYST-056Grids nest and keep absolute source lines superseded superseded by SwRS-MDOKFSTUDIO-MYST-053 Markdown file