Spacing must follow layout direction.
When elements sit next to each other (horizontal layout), spacing controls the horizontal gap between them. When those same elements switch to stacking on top of each other (vertical layout), the spacing must shift to support vertical rhythm instead.
When direction changes across breakpoints (for example, from flex-horizontal to tablet-flex-vertical), a single spacer may not be enough.
In these cases:
This ensures spacing always matches element flow:
See the example below for how spacers can be structured and controlled across breakpoints.
This example demonstrates how spacing adapts when layout direction changes across breakpoints. On larger screens, elements may appear side by side in a horizontal flow. When the layout shifts to a vertical stack on smaller screens, spacing must adjust accordingly. Use separate spacer elements with responsive visibility classes to control which spacing applies at each breakpoint and maintain consistent visual rhythm throughout the layout.