Skip to content

feat: support top / center / bottom vertical alignment within containers #51

Description

@teezeit

Summary

Similar to how horizontal position modifiers (left, center, right) are supported for aligning content within a container, we should support vertical equivalents: top, center, bottom.

Use case

A layout container should be able to pin content to the top, middle, or bottom of its vertical axis — useful for card grids, hero sections, side-by-side columns, and any container where content height varies across cells.

Proposed syntax

Mirror the existing horizontal modifier pattern:

::: grid-2 card {.align-top}

### Short title
Brief text.

### Longer title
This card has more content and would otherwise push alignment off.

:::

Or as an inline modifier on individual children:

::: row
Content pinned to top. {.top}

Content pinned to bottom. {.bottom}
:::

Expected behaviour

Modifier Effect
top Aligns content to the top of the container / cell
center (vertical) Centers content vertically
bottom Aligns content to the bottom of the container / cell

Implementation notes

  • AST: extend the existing modifier/class system on container nodes and/or child nodes
  • Renderer: map to align-items: flex-start / center / flex-end (or justify-content depending on axis) in the generated HTML
  • Should compose cleanly with existing horizontal alignment modifiers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions