chiefgui/skills

layout

Layout practices.

查看源码
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Layout

Structure

  • Make the structure reflect the content and its relationships.
  • Add containers only when they serve meaning, layout, or behavior.
  • Keep related content together; avoid nesting that adds no meaningful grouping.
  • Remove redundant containers and superseded layout rules instead of adding compensating layers.

Arrangement

  • Give each layout responsibility one owner.
  • Let parents arrange children; let children arrange their own contents.
  • Define repeated spacing and alignment rules once.
  • Express layout through flow, alignment, spacing, and sizing constraints.
  • Define how elements grow, shrink, and wrap as available space changes.
  • Avoid manual offsets and spacer elements used to compensate for layout structure.

Abstraction

  • Extract repeated structures when they represent the same concept and should evolve together.
  • Keep simple structures inline; avoid abstractions that merely relocate markup.
  • Keep conditional structure readable; separate meaningful variants when branching obscures the layout.
来自同一仓库

更多 Skills

全部 Skills