Fa'ase'e ile anotusi autu Fa'ase'e ile su'ega fa'amatalaga
in English

faaputuga

Fesoasoani fa'apuupuu o lo'o fausia i luga oa tatou mea fa'aoga flexbox ina ia fa'avavevave ma fa'afaigofie le fa'atulagaina o vaega nai lo se isi lava taimi.

I luga o lenei itulau

Stacks e ofoina atu se ala ala mo le faʻaogaina o le tele o mea faʻapipiʻi flexbox e vave ma faigofie ai ona fai faʻasologa i Bootstrap. O fa'atagaga uma mo le manatu ma le fa'atinoga o lo'o alu i le open source Pylon project .

Ulu i luga! Lagolago mo gap utilities ma le flexbox na fa'aopoopo talu ai nei i Safari, o lea ia mafaufau e fa'amaonia lau su'esu'ega lagolago. E le tatau ona iai ni fa'afitauli. Faitau atili .

Tusa'o

Fa'aoga .vstacke fai ai fa'ata'atia sa'o. O mea fa'aputu e fa'ato'atoa lautele ona o le fa'aletonu. Fa'aoga .gap-*mea aoga e fa'aopoopo ai avanoa i le va o mea.

Mea muamua
Aitema lona lua
mea lona tolu
<div class="vstack gap-3">
  <div class="bg-light border">First item</div>
  <div class="bg-light border">Second item</div>
  <div class="bg-light border">Third item</div>
</div>

Fa'asagaga

Fa'aoga .hstackmo fa'alava fa'ata'atia. O mea fa'aputu e fa'atotonugatotonu i luga ona o le fa'aletonu ma e na'o le lautele e mana'omia. Fa'aoga .gap-*mea aoga e fa'aopoopo ai avanoa i le va o mea.

Mea muamua
Aitema lona lua
mea lona tolu
<div class="hstack gap-3">
  <div class="bg-light border">First item</div>
  <div class="bg-light border">Second item</div>
  <div class="bg-light border">Third item</div>
</div>

Fa'aaogā fa'aoga fa'alava fa'ata'amilo e pei .ms-autoo spacers:

Mea muamua
Aitema lona lua
mea lona tolu
<div class="hstack gap-3">
  <div class="bg-light border">First item</div>
  <div class="bg-light border ms-auto">Second item</div>
  <div class="bg-light border">Third item</div>
</div>

Ma faʻatasi ai ma tulafono faʻavae :

Mea muamua
Aitema lona lua
mea lona tolu
<div class="hstack gap-3">
  <div class="bg-light border">First item</div>
  <div class="bg-light border ms-auto">Second item</div>
  <div class="vr"></div>
  <div class="bg-light border">Third item</div>
</div>

Faataitaiga

Fa'aoga .vstacke fa'aputu ai fa'amau ma isi elemene:

<div class="vstack gap-2 col-md-5 mx-auto">
  <button type="button" class="btn btn-secondary">Save changes</button>
  <button type="button" class="btn btn-outline-secondary">Cancel</button>
</div>

Fausia se fomu i totonu ma .hstack:

<div class="hstack gap-3">
  <input class="form-control me-auto" type="text" placeholder="Add your item here..." aria-label="Add your item here...">
  <button type="button" class="btn btn-secondary">Submit</button>
  <div class="vr"></div>
  <button type="button" class="btn btn-outline-danger">Reset</button>
</div>

Sass

.hstack {
  display: flex;
  flex-direction: row;
  align-items: center;
  align-self: stretch;
}

.vstack {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-self: stretch;
}