Grid sitɛmu
Baara kɛ ni an ka mobili-fɔlɔ flexbox grid barikama ye walasa ka layidu talenw jɔ cogoya ni hakɛ bɛɛ la k’a sababu kɛ kulu tan ni fila sigicogo ye, jaabi dafalen duuru, Sass fɛn caman sɛgɛsɛgɛli ani mixins, ani kalasi tan ni caman minnu ɲɛfɔlen don ka kɔn.
Bootstrap ka grid system bɛ baara kɛ ni minɛnw, jiriw ani kuluw ye minnu bɛ tugu ɲɔgɔn na walasa ka kɔnɔkow labɛn ani k’u labɛn. A jɔlen bɛ ni flexbox ye wa a bɛ jaabi dafalen di. Misali dɔ bɛ duguma ani jateminɛ kuncɛlen bɛ jabaranin bɛ ɲɔgɔn sɔrɔ cogo min na.
Aw ye kura ye walima aw tɛ flexbox dɔn wa? Aw ye nin CSS Tricks flexbox gafe kalan walasa ka kunnafoni sɔrɔ kɔkankow, daɲɛw, bilasiralikanw ani kode snippets kan.
<div class="container">
<div class="row">
<div class="col-sm">
One of three columns
</div>
<div class="col-sm">
One of three columns
</div>
<div class="col-sm">
One of three columns
</div>
</div>
</div>
Misali min bɛ sanfɛ, o bɛ kulu saba Dabɔ minnu bonya bɛ bɛn ɲɔgɔn ma minɛn misɛnninw, cɛmancɛw, belebelebaw ani minnu ka bon kosɛbɛ ni an ka jatebɔlanw ye minnu ɲɛfɔlen don ka kɔn. o kuluw bɛ cɛmancɛ la ɲɛ kan ni bangebaga ye .container
.
Ka a kari, a bɛ baara kɛ cogo min na, o filɛ nin ye:
- Konteynaw bɛ fɛɛrɛ Di walasa k’i ka siti kɔnɔkow Dòn cɛmancɛ la ani k’u Blà ‘yɔrɔ la. Baara
.container
kɛ ni pixel width jaabi ye walima.container-fluid
ka ɲɛsinwidth: 100%
viewport ni minɛnw hakɛ bɛɛ ma. - Layiniw ye fɛnw ye minnu bɛ kɛ ka kolonw datugu. Kolon kelen-kelen bɛɛ bɛ ni horizontal ye
padding
(a bɛ fɔ a ma ko gutter) walasa ka yɔrɔ min bɛ u ni ɲɔgɔn cɛ, o kɔlɔsi. Opadding
bɛ sɔrɔ ka kɛlɛ kɛ jirisunw kan ni dakun juguw ye. O cogo la, i ka kuluw kɔnɔkow bɛɛ bɛ Labɛn ni ɲɛ ye ka Jigin kinin fɛ. - Jatebla labɛncogo la, kɔnɔkow ka kan ka bila kuluw kɔnɔ ani kuluw dɔrɔn de bɛ se ka kɛ jirisunw denw ye teliya la.
- Flexbox sababu la, grid kulu minnu tɛ ni kofɔlen ye
width
, olu bɛna labɛn u yɛrɛma i n’a fɔ kulu minnu bonya bɛ bɛn ɲɔgɔn ma. Misali la, misali naani.col-sm
bɛna kɛ otomatiki la 25% bonya ye ka bɔ kariyɔrɔ fitinin na ka taa sanfɛ. Aw ye auto-layout columns yɔrɔ lajɛ walasa ka misali wɛrɛw sɔrɔ. - Kolon kalanw bɛ kulu hakɛ jira i b’a fɛ ka baara kɛ ni min ye ka bɔ 12 la minnu bɛ se ka kɛ jirisun kelen kɔnɔ. O la, n’i b’a fɛ kulu saba minnu bonya bɛ bɛn ɲɔgɔn ma, i bɛ se ka baara kɛ ni
.col-4
. - Kolon
width
s bɛ sigi kɛmɛsarada la, o la u bɛ wuli tuma bɛɛ ani u bonya ka kɛɲɛ n’u bangebaga yɔrɔ ye. - Kolonw bɛ ni horizontal
padding
ye walasa ka gutterw da kulu kelen-kelenw ni ɲɔgɔn cɛ, nka, i bɛ se kamargin
bɔ jiriw la anipadding
ka bɔ kuluw la ni.no-gutters
kan.row
. - Walasa ka jatebɔ kɛ jaabi ye, jatebɔyɔrɔ duuru bɛ yen, kelen bɛ jaabi jatebɔyɔrɔ kelen-kelen bɛɛ la : jatebɔyɔrɔ bɛɛ (misɛnninw), misɛnninw, cɛmancɛw, belebelebaw, ani minnu ka bon kosɛbɛ.
- Grid breakpoints (jatebɔlanw) bɛ Dabɔ minimum width media ɲininkaliw kan, o kɔrɔ ye k’u bɛ tali Kɛ o breakpoint kelen na ani a sanfɛtaw bɛɛ la (misali la, u
.col-sm-4
bɛ tali Kɛ minɛn misɛnninw, cɛmancɛw, belebelew ani belebelebaw la, nkaxs
breakpoint fɔlɔ tɛ). - Aw bɛ se ka baara kɛ ni jatebɔlanw ye minnu ɲɛfɔlen don ka kɔn (i n’a fɔ
.col-4
) walima Sass mixins walasa ka kɔrɔko taamasiyɛn caman sɔrɔ.
aw ye dantigɛliw ni buguw dɔn flexbox lamini na , i n' a fɔ sebaliya ka HTML yɔrɔ dɔw kɛ flex minɛnw ye .
Hali ni Bootstrap bɛ em
s walima rem
s kɛ ka bonya fanba ɲɛfɔ, px
s bɛ kɛ ka grid breakpoints ani container widths kɛ. o bɛ kɛ bawo filɛlikɛyɔrɔ bonya bɛ pixel kɔnɔ wa a tɛ Changé ni sɛbɛnnibolo hakɛ ye .
Aw ye a lajɛ Bootstrap grid system fan dɔw bɛ baara kɛ cogo min na minɛn caman kan ni tabali ye min bɛ se ka kɛ.
A ka dɔgɔn kosɛbɛ <576px |
A ka dɔgɔn ≥576px |
Cɛmancɛ ≥768px |
A ka bon ≥992px |
A ka bon kosɛbɛ ≥1200px |
|
---|---|---|---|---|---|
Max minɛn bonya | Foyi tɛ (auto) . | 540px ye | 720px ye | 960px ye | 1140px ye |
Kalanso ɲɛbila | .col- |
.col-sm- |
.col-md- |
.col-lg- |
.col-xl- |
# ka kuluw | 12 ye | ||||
Gutter bonya | 30px (15px bɛ kulu dɔ fan kelen-kelen bɛɛ la) | ||||
Nestable ye | Awɔ | ||||
Kolonw ka komandi | Awɔ |
Baara kɛ ni breakpoint-specific column classes ye walasa ka column bonya nɔgɔya ni class numéro jɛlen tɛ i n’a fɔ .col-sm-6
.
Misali la, nin ye jatebɔlan fila ye minnu bɛ tali kɛ minɛn ni filɛlikɛyɔrɔ bɛɛ la, k’a ta xs
ka se xl
. Aw bɛ unit-less classes hakɛ o hakɛ fara a kan i mago bɛ breakpoint kelen-kelen bɛɛ la ani kolon kelen-kelen bɛɛ bɛna kɛ kelen ye.
<div class="container">
<div class="row">
<div class="col">
1 of 2
</div>
<div class="col">
2 of 2
</div>
</div>
<div class="row">
<div class="col">
1 of 3
</div>
<div class="col">
2 of 3
</div>
<div class="col">
3 of 3
</div>
</div>
</div>
Kolon minnu bonya bɛ bɛn ɲɔgɔn ma, olu bɛ se ka kari ka kɛ zana caman ye, nka Safari flexbox bug dɔ tun bɛ yen min ye nin bali ka baara kɛ ni flex-basis
walima border
. Baarakɛcogo dɔw bɛ yen navigatɔrɔ kɔrɔw la, nka u man kan ka kɛ wajibi ye n’i bɛ waati kura la.
<div class="container">
<div class="row">
<div class="col">Column</div>
<div class="col">Column</div>
<div class="w-100"></div>
<div class="col">Column</div>
<div class="col">Column</div>
</div>
</div>
Auto-layout for flexbox grid columns fana kɔrɔ ye ko i bɛ se ka kulu kelen bonya sigi ani ka balimakɛ kuluw kɛ u yɛrɛma ka bonya caman wuli a lamini na. Aw bɛ se ka baara kɛ ni jatebɔlanw ye minnu ɲɛfɔlen don ka kɔn (i n’a fɔ a jiralen bɛ cogo min na jukɔrɔ), jatebɔlanw ɲagaminenw, walima jatebɔlanw bonya. A kɔlɔsi ko kulu tɔw bɛna bonya caman sɛmɛntiya hali ni cɛmancɛ kulu bonya mana kɛ min o min ye.
<div class="container">
<div class="row">
<div class="col">
1 of 3
</div>
<div class="col-6">
2 of 3 (wider)
</div>
<div class="col">
3 of 3
</div>
</div>
<div class="row">
<div class="col">
1 of 3
</div>
<div class="col-5">
2 of 3 (wider)
</div>
<div class="col">
3 of 3
</div>
</div>
</div>
Baara kɛ ni col-{breakpoint}-auto
kalanw ye walasa ka kuluw bonya ka kɛɲɛ n’u kɔnɔkow bonya dacogo ye.
<div class="container">
<div class="row justify-content-md-center">
<div class="col col-lg-2">
1 of 3
</div>
<div class="col-md-auto">
Variable width content
</div>
<div class="col col-lg-2">
3 of 3
</div>
</div>
<div class="row">
<div class="col">
1 of 3
</div>
<div class="col-md-auto">
Variable width content
</div>
<div class="col col-lg-2">
3 of 3
</div>
</div>
</div>
Aw bɛ kuluw da minnu bonya bɛ bɛn ɲɔgɔn ma minnu bɛ jirisun caman cɛ ni a donli ye .w-100
yɔrɔ min na aw b’a fɛ kuluw ka kari ka kɛ zana kura ye. aw bɛ lafiɲɛbɔw kɛ jaabiw ye ni aw ye u ɲagami .w-100
ni jaabi jiracogo nafama dɔw ye .
<div class="row">
<div class="col">col</div>
<div class="col">col</div>
<div class="w-100"></div>
<div class="col">col</div>
<div class="col">col</div>
</div>
Bootstrap ka grid kɔnɔ, kalasi minnu ɲɛfɔlen don ka kɔn, olu ka tiers duuru bɛ yen walasa ka jaabiw labɛncogo gɛlɛnw jɔ. Aw ye aw ka kuluw bonya kɛ ka kɛɲɛ ni aw yɛrɛ sago ye minɛn fitininw kan, minɛn fitininw, cɛmancɛw, belebelebaw, walima minnu ka bon kosɛbɛ i n’a fɔ aw b’a ye cogo o cogo.
Ni jatebɔlanw ye kelen ye k’a ta minɛn fitininw na ka se minɛn belebelebaw ma, aw bɛ baara kɛ ni .col
ani .col-*
kalasiw ye. Kalanso nimɔrɔma dɔ jira ni i mago bɛ kulu kɛrɛnkɛrɛnnen na min bonya ka bon; n’o tɛ, aw kana siga ka nɔrɔ .col
.
<div class="row">
<div class="col">col</div>
<div class="col">col</div>
<div class="col">col</div>
<div class="col">col</div>
</div>
<div class="row">
<div class="col-8">col-8</div>
<div class="col-4">col-4</div>
</div>
Ni aw bɛ baara kɛ ni .col-sm-*
kalansen kelen ye, aw bɛ se ka grid system basigilen dɔ da min bɛ daminɛ ni stacked ye ka sɔrɔ ka kɛ horizontal ye ni at the small breakpoint ( sm
).
<div class="row">
<div class="col-sm-8">col-sm-8</div>
<div class="col-sm-4">col-sm-4</div>
</div>
<div class="row">
<div class="col-sm">col-sm</div>
<div class="col-sm">col-sm</div>
<div class="col-sm">col-sm</div>
</div>
Aw t’a fɛ aw ka kuluw ka ɲɔgɔn dalajɛ dɔrɔn grid tiers dɔw kɔnɔ wa? Aw bɛ baara kɛ ni kalan suguya wɛrɛw faralen ye ɲɔgɔn kan sanfɛyɔrɔ kelen-kelen bɛɛ la i n’a fɔ aw mago bɛ cogo min na. Aw ye misali lajɛ min bɛ duguma walasa ka hakilina ɲuman sɔrɔ a bɛɛ bɛ baara kɛ cogo min na.
<!-- Stack the columns on mobile by making one full-width and the other half-width -->
<div class="row">
<div class="col-12 col-md-8">.col-12 .col-md-8</div>
<div class="col-6 col-md-4">.col-6 .col-md-4</div>
</div>
<!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop -->
<div class="row">
<div class="col-6 col-md-4">.col-6 .col-md-4</div>
<div class="col-6 col-md-4">.col-6 .col-md-4</div>
<div class="col-6 col-md-4">.col-6 .col-md-4</div>
</div>
<!-- Columns are always 50% wide, on mobile and desktop -->
<div class="row">
<div class="col-6">.col-6</div>
<div class="col-6">.col-6</div>
</div>
Baara kɛ ni flexbox alignment utilities ye walasa ka kolonw labɛn ka ɲɛ ani ka u labɛn ka ɲɛ.
<div class="container">
<div class="row align-items-start">
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
</div>
<div class="row align-items-center">
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
</div>
<div class="row align-items-end">
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
<div class="col">
One of three columns
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col align-self-start">
One of three columns
</div>
<div class="col align-self-center">
One of three columns
</div>
<div class="col align-self-end">
One of three columns
</div>
</div>
</div>
<div class="container">
<div class="row justify-content-start">
<div class="col-4">
One of two columns
</div>
<div class="col-4">
One of two columns
</div>
</div>
<div class="row justify-content-center">
<div class="col-4">
One of two columns
</div>
<div class="col-4">
One of two columns
</div>
</div>
<div class="row justify-content-end">
<div class="col-4">
One of two columns
</div>
<div class="col-4">
One of two columns
</div>
</div>
<div class="row justify-content-around">
<div class="col-4">
One of two columns
</div>
<div class="col-4">
One of two columns
</div>
</div>
<div class="row justify-content-between">
<div class="col-4">
One of two columns
</div>
<div class="col-4">
One of two columns
</div>
</div>
</div>
kuluw ni ɲɔgɔn cɛ jibolisiraw an ka jatebɔ kalansenw kɔnɔ minnu ɲɛfɔlen don ka kɔn , olu bɛ se ka bɔ ni .no-gutters
. margin
O bɛ s juguw bɔ .row
ani horizontal padding
ka bɔ denmisɛnw ka kolomayɔrɔw bɛɛ la.
Nin ye 'sènfɛ-kode ye min bɛ Kɛ ka nin cogoyaw Dabɔ. aw k' a kɔlɔsi ko kuluw sɛgɛsɛgɛli bɛ kɛ ka ɲɛsin denmisɛnw kulu fɔlɔw dɔrɔn de ma , wa u bɛ laɲini fɛnw sugandili fɛ . Hali n’o bɛ sugandili kɛrɛnkɛrɛnnen dɔ lawuli, kolosinsinnanw bɛ se ka ladilan ka taa a fɛ hali bi ni yɔrɔjan nafamafɛnw ye .
Aw mago bɛ dilan na min bɛ bɔ dakun na ka taa a dan na wa? Aw bɛ bangebaga .container
walima .container-fluid
.
Tiɲɛ na, a bɛ cogo min na, o filɛ nin ye. A kɔlɔsi ko i bɛ se ka t’a fɛ ka baara kɛ ni nin ye ni jatebɔlan tɔw bɛɛ ye minnu ɲɛfɔlen don ka kɔn (o la, kuluw bonya, jaabiw, jatebɔcogo kura, ani fɛn wɛrɛw).
<div class="row no-gutters">
<div class="col-12 col-sm-6 col-md-8">.col-12 .col-sm-6 .col-md-8</div>
<div class="col-6 col-md-4">.col-6 .col-md-4</div>
</div>
Ni kulu minnu ka ca ni 12 ye, olu bilala jirisun kelen kɔnɔ, kulu wɛrɛw kulu kelen-kelen bɛɛ bɛna, i n’a fɔ yɔrɔ kelen, ka siri tigɛli kura kan.
Komin 9 + 4 = 13 > 12, nin div 4-kolon-kɔnɔ in bɛ siri tigɛli kura kan i n’a fɔ unit kelen min bɛ ɲɔgɔn kan.
Kolon minnu bɛ tugu ɲɔgɔn kɔ, olu bɛ tɛmɛ layini kura kan.
<div class="row">
<div class="col-9">.col-9</div>
<div class="col-4">.col-4<br>Since 9 + 4 = 13 > 12, this 4-column-wide div gets wrapped onto a new line as one contiguous unit.</div>
<div class="col-6">.col-6<br>Subsequent columns continue along the new line.</div>
</div>
Kolonw kari ka taa layini kura la flexbox kɔnɔ, o bɛ hakɛ fitinin dɔ de wajibiya: width: 100%
i b’a fɛ k’i ka kuluw siri yɔrɔ o yɔrɔ la ka fɛn dɔ fara tigɛli kura kan. A ka c’a la o bɛ Kɛ ni .row
s caman ye, nka waleyali fɛɛrɛ bɛɛ tɛ Se ka jatebla Kɛ o la.
<div class="row">
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
<!-- Force next columns to break to new line -->
<div class="w-100"></div>
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
<div class="col-6 col-sm-3">.col-6 .col-sm-3</div>
</div>
aw bɛ se fana ka nin lafiɲɛbɔ in kɛ lafiɲɛbɔ kɛrɛnkɛrɛnnenw na ni an ka jaabi jiralanw ye .
<div class="row">
<div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
<div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
<!-- Force next columns to break to new line at md breakpoint and up -->
<div class="w-100 d-none d-md-block"></div>
<div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
<div class="col-6 col-sm-4">.col-6 .col-sm-4</div>
</div>
Baara kɛ ni .order-
kalanw ye walasa ka i ka kɔnɔkow sigicogo ɲɛnama kɔlɔsi. Nin kalan ninnu bɛ jaabi di, o la aw bɛ se ka order
by breakpoint (misali la, .order-1.order-md-2
). A bɛ dɛmɛ don ka 1
tɛmɛn ka 12
tɛmɛn grid tiers duuru bɛɛ kan.
<div class="container">
<div class="row">
<div class="col">
First, but unordered
</div>
<div class="col order-12">
Second, but last
</div>
<div class="col order-1">
Third, but first
</div>
</div>
</div>
.order-first
Jaabi ni .order-last
kalasi fana bɛ yen minnu bɛ fɛn dɔ Changer ni ( ) order
waleyali ye , u kelen-kelen bɛɛ. O kalanw fana bɛ se ka ɲagami ni kalansenw ye minnu jate bɛ kɛ i n’a fɔ a mago bɛ cogo min na.order: -1
order: 13
order: $columns + 1
.order-*
<div class="container">
<div class="row">
<div class="col order-last">
First, but last
</div>
<div class="col">
Second, but unordered
</div>
<div class="col order-first">
Third, but first
</div>
</div>
</div>
Aw bɛ se ka grid kolonw offset cogo fila la: an ka jaabiw .offset-
grid classes ani an ka margin utilities . Grid classes (jatebɔlanw) hakɛ bɛ bonya walasa ka bɛn kuluw ma k’a sɔrɔ margins (dakunw) nafa ka bon kosɛbɛ layidu teliya la yɔrɔ minnu na offset (fɔlikan) bonya bɛ ɲɔgɔn ta.
Aw bɛ kuluw wuli ka taa kinin fɛ ni .offset-md-*
kalanw ye. O kalasiw bɛ dɔ Fàra kulu dɔ kinin fɛ dakun kan *
kuluw fɛ. Misali la, .offset-md-4
a bɛ taa .col-md-4
kulu naani kan.
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 offset-md-4">.col-md-4 .offset-md-4</div>
</div>
<div class="row">
<div class="col-md-3 offset-md-3">.col-md-3 .offset-md-3</div>
<div class="col-md-3 offset-md-3">.col-md-3 .offset-md-3</div>
</div>
<div class="row">
<div class="col-md-6 offset-md-3">.col-md-6 .offset-md-3</div>
</div>
Ka fara kolomaw jɛyali kan jaabiw tiɲɛniyɔrɔw la, i bɛ se ka offsetw labɛn kokura. aw ye nin lajɛ wale la ja misali la .
<div class="row">
<div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
<div class="col-sm-5 offset-sm-2 col-md-6 offset-md-0">.col-sm-5 .offset-sm-2 .col-md-6 .offset-md-0</div>
</div>
<div class="row">
<div class="col-sm-6 col-md-5 col-lg-6">.col-sm-6 .col-md-5 .col-lg-6</div>
<div class="col-sm-6 col-md-5 offset-md-2 col-lg-6 offset-lg-0">.col-sm-6 .col-md-5 .offset-md-2 .col-lg-6 .offset-lg-0</div>
</div>
Ni 'yɔrɔ bɛ flexbox la v4 kɔnɔ, i bɛ Se ka baara Kɛ ni margin utilities ye i n'a fɔ .mr-auto
ka balimakɛw ka kuluw Wajibiya ka Bɔ ɲɔgɔn na.
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 ml-auto">.col-md-4 .ml-auto</div>
</div>
<div class="row">
<div class="col-md-3 ml-md-auto">.col-md-3 .ml-md-auto</div>
<div class="col-md-3 ml-md-auto">.col-md-3 .ml-md-auto</div>
</div>
<div class="row">
<div class="col-auto mr-auto">.col-auto .mr-auto</div>
<div class="col-auto">.col-auto</div>
</div>
Walasa k’i ka kɔnɔkow nest ni grid default ye, i ka kulu kura .row
ni kulu dɔ fara kulu .col-sm-*
dɔ kan min bɛ yen .col-sm-*
. Nested rows ka kan ka kɛ ni kuluw kulu ye minnu bɛ fara ɲɔgɔn kan ka se 12 ma walima ka dɔgɔya (a man kan i ka baara kɛ ni kulu 12 bɛɛ ye minnu bɛ sɔrɔ).
<div class="row">
<div class="col-sm-9">
Level 1: .col-sm-9
<div class="row">
<div class="col-8 col-sm-6">
Level 2: .col-8 .col-sm-6
</div>
<div class="col-4 col-sm-6">
Level 2: .col-4 .col-sm-6
</div>
</div>
</div>
</div>
Ni i bɛ baara Kɛ ni Bootstrap ka source Sass files ye, i bɛ se ka baara Kɛ ni Sass variables ni mixins ye walasa ka ɲɛw labɛncogo ladamulenw, kɔrɔko ani jaabiw dilan. An ka grid kalasi minnu ɲɛfɔlen don ka kɔn, olu bɛ baara kɛ ni nin fɛn caman ɲɔgɔnna ni mixins kelenw ye walasa ka kalan labɛnnenw suite bɛɛ di walasa ka jaabi teliya layidu ta.
Yɛlɛmaw ni kartiw bɛ kuluw hakɛ jira, gutɛri bonya, ani kunnafonidilanw ɲininkali yɔrɔ min na kuluw bɛ wuli ka wuli. An bɛ baara Kɛ ni ninnu ye walasa ka grid classes (jatebɔ-kalanso) minnu ɲɛfɔlen dòn ka Kɔn, olu Sɔrɔ minnu sɛbɛnnen dòn san fɛ, ka Fàra custom mixins (lada mixins) minnu kofɔlen dòn jukɔrɔ.
Mixins bɛ baara kɛ ni grid variables ye walasa ka semantiki CSS dilan grid kulu kelen-kelen bɛɛ kama.
Aw bɛ se ka fɛn caman sɛmɛntiya ka kɛɲɛ ni aw yɛrɛ ka ladamu nafaw ye, walima ka baara kɛ dɔrɔn ni mixins ye n’u ka nafa fɔlɔw ye. Nin ye misali ye min bɛ baara Kɛ ni 'sènfɛ-sɛbɛnni-minɛnw ye walasa ka kulu fla-fla-labɛnni Dabɔ ni danfara bɛ u ni ɲɔgɔn cɛ.
<div class="example-container">
<div class="example-row">
<div class="example-content-main">Main content</div>
<div class="example-content-secondary">Secondary content</div>
</div>
</div>
Baara kɛli ni an ka jatebɔlan Sass fɛn caman sɛgɛsɛgɛli ni kartiw ye minnu bɛ a kɔnɔ, a bɛ se ka jatebɔ kalasi minnu ɲɛfɔlen don ka kɔn, olu bɛrɛbɛn pewu. Yɛlɛma ni tiyɛri hakɛ ye, kunnafonidilan ɲininkali hakɛw, ani minɛnw bonya—o kɔfɛ, aw bɛ segin ka ɲɔgɔn dalajɛ.
Grid kuluw hakɛ bɛ se ka ladilan Sass variables fɛ. $grid-columns
bɛ kɛ ka kulu kelen-kelen bɛɛ bonya (kɛmɛsarada la) lawuli k’a sɔrɔ a $grid-gutter-width
bɛ sira di kariyɔrɔ kɛrɛnkɛrɛnnenw bonya ma minnu tilalen don ɲɔgɔn na kuluw kɔnɔ padding-left
ani padding-right
kuluw ka jibolisiraw kama.
Ni i bɛ tɛmɛ kuluw yɛrɛ kan, i bɛ se fana ka jatebɔlanw hakɛ ladilan. Ni i tun b’a fɛ ka grid tiers naani dɔrɔn de sɔrɔ, i tun bɛna $grid-breakpoints
and update $container-max-widths
ka kɛ nin cogo la:
Ni i bɛ fɛn o fɛn Changer Sass variables walima maps la, i ka kan k’i ka fɛn caman Changements mara ani ka recompile. O kɛli bɛna grid classes (jatebɔlanw) minnu ɲɛfɔlen don ka kɔn, olu kulu kura dɔ bɔ ka ɲɛsin kolosinsinnanw bonya, offsets ani komandiw ma. Responsive visibility utilities fana bɛna ladamu walasa ka baara kɛ ni ladamu breakpoints ye. Aw ye aw jija ka jatebɔlan nafaw sigi px
(a tɛ rem
, em
, walima %
).