RFS
Igwe ngbanwe nke Bootstrap na-anabata nke ọma na-atụba akụrụngwa CSS a na-ahụkarị iji jiri ohere dị n'ofe ebe nlele na ngwaọrụ.
Kedu ihe bụ RFS?
Ọrụ n'akụkụ Bootstrap RFS bụ igwe na-emezigharị nkeji nke emepụtara na mbụ iji megharịa nha mkpụrụedemede (ya mere mbiri ya maka nha Font Responsive Font). Ugbu a RFS nwere ike iweghachi ọtụtụ akụrụngwa CSS nwere ụkpụrụ otu dịka margin
, padding
, border-radius
, ma ọ bụ ọbụna box-shadow
.
Usoro ahụ na-agbakọ ụkpụrụ kwesịrị ekwesị na-akpaghị aka dabere na akụkụ nke ihe nlele ihe nchọgharị ahụ. A ga-achịkọta ya n'ime calc()
ọrụ yana ngwakọta rem
na nkeji nlele iji mee ka omume mkpali na-anabata.
Iji RFS
Ngwakọta ndị ahụ gụnyere na Bootstrap ma dị ozugbo ị gụnyere Bootstrap's scss
. Enwere ike itinye RFS naanị ma ọ dị mkpa.
Iji mixins
Ngwakọta rfs()
ahụ nwere aka mkpirisi maka font-size
, margin
, margin-top
, margin-right
, margin-bottom
, margin-left
, padding
, padding-top
, padding-right
, padding-bottom
na padding-left
. Lee ihe atụ dị n'okpuru maka isi iyi Sass yana CSS chịkọtara.
.title {
@include font-size(4rem);
}
.title {
font-size: calc(1.525rem + 3.3vw);
}
@media (min-width: 1200px) {
.title {
font-size: 4rem;
}
}
Enwere ike ịnyefe ihe onwunwe ọ bụla na rfs()
mixin dị ka nke a:
.selector {
@include rfs(4rem, border-radius);
}
!important
nwekwara ike ịgbakwunye na uru ọ bụla ịchọrọ:
.selector {
@include padding(2.5rem !important);
}
Iji ọrụ
Mgbe ịchọghị iji ihe gụnyere, enwekwara ọrụ abụọ:
rfs-value()
na-atụgharị uru n'imerem
uru ma ọ bụrụpx
na agafere uru, n'ọnọdụ ndị ọzọ ọ na-eweghachi otu nsonaazụ ahụ.rfs-fluid-value()
na-eweghachi ụdị mmiri nke uru ma ọ bụrụ na ihe onwunwe ahụ chọrọ mbelata.
N'ọmụmaatụ a, anyị na-eji otu n'ime Bootstrap arụnyere n'ime anabata nkwụsịtụ mixins iji tinye naanị ịke n'okpuru ebe lg
nkwụsịtụ.
.selector {
@include media-breakpoint-down(lg) {
padding: rfs-fluid-value(2rem);
font-size: rfs-fluid-value(1.125rem);
}
}
@media (max-width: 991.98px) {
.selector {
padding: calc(1.325rem + 0.9vw);
font-size: 1.125rem; /* 1.125rem is small enough, so RFS won't rescale this */
}
}
Akwụkwọ agbatịgoro
RFS bụ ọrụ dị iche n'okpuru nzukọ Bootstrap. Enwere ike ịchọta ihe gbasara RFS na nhazi ya na ebe nchekwa GitHub ya .