API Utilidad rehegua
API utilidad rehegua haꞌehína peteĩ tembipuru Sass rehegua oñemboheko hag̃ua umi clase utilidad rehegua.
Umi purupyrã Bootstrap rehegua oñemboheko ñande API purupyrã ndive ha ikatu ojepuru oñemoambue térã oñembotuichave hag̃ua ñande mboajepyréva mboajepyréva mboajepyréva Sass rupive. Ore API utilidad rehegua oñemopyenda peteĩ serie Sass mapa ha función rehegua omoheñói hag̃ua familia clase rehegua oguerekóva opáichagua opción. Ndereikuaáiramo Sass mapakuéra, emoñe’ẽ yvate umi Sass docs oficial -pe eñepyrũ hag̃ua.
Pe $utilities
mapa oguereko opaite ore utilidad ha upéi oñembojoaju ne $utilities
mapa personalizado ndive, oĩramo. Pe mapa utilidad rehegua oguereko peteĩ lista clave reheve umi utilidad aty omoneĩva ko’ã opción:
Ambue ojeporavokuaáva | Hesegua | Valor por defecto rehegua | Techaukaha |
---|---|---|---|
property |
Apopeteĩrã | – Ñemby . | Mbaꞌekuaarã réra, kóva ikatu peteĩ vore térã peteĩ vore ñemohendaha (techapyrã, acolchado horizontal térã margen). |
values |
Apopeteĩrã | – Ñemby . | Lista de valores, térã peteĩ mapa ndereipotáiramo mboꞌepy réra peteĩchaite pe valor ndive. Ojeporúramo null clave mapa ramo, class noñemboguapýi mboꞌepy rérape. |
class |
Poravokuaa | mba'evegua | Mbo’esyry oñembohekopyréva réra. Noñemeꞌeiramo ha property haꞌeramo peteĩ vore vore rehegua, class ojejapóta por defecto peteĩha elemento property matriz rehegua. Noñeme’ẽiramo ha property ha’éramo peteĩ vore, values ojepuru umi clave umi class téra rehegua. |
css-var |
Poravokuaa | false |
Boolean omoheñói hag̃ua CSS mbaꞌekuaarã CSS rembiapoukapy rangue. |
css-variable-name |
Poravokuaa | mba'evegua | Téra jeporupyre ndojeporúiva CSS mbaꞌekuaarãme g̃uarã tembiapoukapy ryepýpe. |
local-vars |
Poravokuaa | mba'evegua | Mapa umi mbaꞌekuaarã CSS pegua rehegua ojejapo hag̃ua CSS reglakuéra ári. |
state |
Poravokuaa | mba'evegua | Lista de variantes seudo-clase rehegua (techapyrã, :hover térã :focus ) ojejapo hag̃ua. |
responsive |
Poravokuaa | false |
Booleano ohechaukáva oñemboheko vaꞌerãpa umi clase ombohováiva. |
rfs |
Poravokuaa | false |
Boolean ikatu hag̃uáicha ojejapo jey escalado líquido rehegua RFS ndive . |
print |
Poravokuaa | false |
Boolean ohechaukáva tekotevẽpa ojejapo umi clase impresión rehegua. |
rtl |
Poravokuaa | true |
Boolean ohechaukáva oñeñongatuvaꞌerãpa utilidad RTL-pe. |
API omyesakã
Opaite mbaꞌekuaarã utilidad rehegua oñembojoapy $utilities
mbaꞌekuaarãme ñande _utilities.scss
kuatiahaipyre ryepýpe. Káda grupo de servicios públicos ojehecha peteĩ mba’e kóicha:
$utilities: (
"opacity": (
property: opacity,
values: (
0: 0,
25: .25,
50: .5,
75: .75,
100: 1,
)
)
);
Mba’épa osẽ ko’ã mba’e:
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: .25; }
.opacity-50 { opacity: .5; }
.opacity-75 { opacity: .75; }
.opacity-100 { opacity: 1; }
Imba'éva
Pe property
clave oñeikotevẽva oñemohendava’erã oimeraẽva purupyrãme g̃uarã, ha oguerekova’erã peteĩ CSS mba’ekuaarã añetegua. Ko mbaꞌekuaarã ojepuru utilidad oñembohekopyréva rembiaporã ryrúpe. Ojehejáramo pe class
clave, oservi avei clase réra por defecto ramo. Ñapensamína pe text-decoration
utilidad rehe:
$utilities: (
"text-decoration": (
property: text-decoration,
values: none underline line-through
)
);
Osẽ: .
.text-decoration-none { text-decoration: none !important; }
.text-decoration-underline { text-decoration: underline !important; }
.text-decoration-line-through { text-decoration: line-through !important; }
Umi mba’ekuaarã
Eipuru values
clave emombeꞌu hag̃ua mbaꞌe valor ojeꞌevaꞌekuépe g̃uarãpa property
ojepuruvaꞌerã umi mboꞌepy réra ha tembiapoukapy oñembohekopyrévape. Ikatu peteĩ lista térã mapa (oñemohenda umi utilidad-pe térã peteĩ Sass variable-pe).
Peteĩ lista ramo, umi text-decoration
utilidad ndive guáicha :
values: none underline line-through
Mapa ramo, umi opacity
utilidad ndive guáicha :
values: (
0: 0,
25: .25,
50: .5,
75: .75,
100: 1,
)
Peteĩ Sass mbaꞌekuaarãicha omoĩva lista térã mapa, ñande position
utilidad -peguáicha :
values: $position-values
Mbo'ehakoty
Eipuru class
opción emoambue hag̃ua mbo’esyry ñepyrũrã ojeporúva CSS oñembohekopyrévape. Techapyrã, oñemoambue hag̃ua guive .opacity-*
a .o-*
:
$utilities: (
"opacity": (
property: opacity,
class: o,
values: (
0: 0,
25: .25,
50: .5,
75: .75,
100: 1,
)
)
);
Osẽ: .
.o-0 { opacity: 0 !important; }
.o-25 { opacity: .25 !important; }
.o-50 { opacity: .5 !important; }
.o-75 { opacity: .75 !important; }
.o-100 { opacity: 1 !important; }
If class: null
, omoheñói clase peteĩteĩva umi values
clave-pe g̃uarã:
$utilities: (
"visibility": (
property: visibility,
class: null,
values: (
visible: visible,
invisible: hidden,
)
)
);
Osẽ: .
.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }
Umi mba’ekuaarã CSS mba’ekuaarã
Emohenda css-var
opción booleano-pe true
ha API omoheñóita umi mbaꞌekuaarã CSS local pe selector oñemeꞌevaꞌekuépe g̃uarã umi property: value
tembiapoukapy jepivegua rangue. Emoĩ peteĩ opcional css-variable-name
emohenda hag̃ua peteĩ CSS mbaꞌekuaarã réra iñambuéva mboꞌepy réragui.
Ñapensamína ñande .text-opacity-*
utilidad rehe. Ñamoĩramo css-variable-name
opción, jahupytýta peteĩ salida personalizada.
$utilities: (
"text-opacity": (
css-var: true,
css-variable-name: text-alpha,
class: text-opacity,
values: (
25: .25,
50: .5,
75: .75,
100: 1
)
),
);
Osẽ: .
.text-opacity-25 { --bs-text-alpha: .25; }
.text-opacity-50 { --bs-text-alpha: .5; }
.text-opacity-75 { --bs-text-alpha: .75; }
.text-opacity-100 { --bs-text-alpha: 1; }
Umi mba’e’oka CSS tendápegua
Eipuru local-vars
opción emombeꞌu hag̃ua peteĩ mapa Sass omoheñóitava umi mbaꞌekuaarã CSS local rehegua pe clase utilidad rehegua reglamento ryepýpe. Eñatendéke ikatuha oikotevẽ tembiapo ambuéva oje’u hag̃ua umi CSS mba’e’oka tendápegua umi CSS rembiapoukapy oñembohekopyrévape. Por ehémplo, ñapensamína ñande .bg-*
utilidadkuérare:
$utilities: (
"background-color": (
property: background-color,
class: bg,
local-vars: (
"bg-opacity": 1
),
values: map-merge(
$utilities-bg-colors,
(
"transparent": transparent
)
)
)
);
Osẽ: .
.bg-primary {
--bs-bg-opacity: 1;
background-color: rgba(var(--bs-primary-rgb), var(--bs-bg-opacity)) !important;
}
Estado-kuéra rehegua
Eipuru state
opción emoheñói hag̃ua variación seudo-clase rehegua. Techapyrã seudo-clase haꞌehína :hover
ha :focus
. Oñemeꞌe jave peteĩ lista estado rehegua, ojejapo mboꞌepy réra upe seudo-clase-pe g̃uarã. Techapyrã, emoambue hag̃ua opacidad hover-pe, emoĩve state: hover
ha rehupytýta .opacity-hover:hover
nde CSS oñembohekopyrévape.
¿Reikotevẽ heta pseudo-clase? Eipuru peteĩ lista ojepeꞌavaꞌekue espacio-pe umi estado rehegua: state: hover focus
.
$utilities: (
"opacity": (
property: opacity,
class: opacity,
state: hover,
values: (
0: 0,
25: .25,
50: .5,
75: .75,
100: 1,
)
)
);
Osẽ: .
.opacity-0-hover:hover { opacity: 0 !important; }
.opacity-25-hover:hover { opacity: .25 !important; }
.opacity-50-hover:hover { opacity: .5 !important; }
.opacity-75-hover:hover { opacity: .75 !important; }
.opacity-100-hover:hover { opacity: 1 !important; }
Ombohováiva
Emoĩ responsive
boolean emoheñói hag̃ua tembipururã ombohováiva (techapyrã, .opacity-md-25
) opaite punto de ruptura rupi .
$utilities: (
"opacity": (
property: opacity,
responsive: true,
values: (
0: 0,
25: .25,
50: .5,
75: .75,
100: 1,
)
)
);
Osẽ: .
.opacity-0 { opacity: 0 !important; }
.opacity-25 { opacity: .25 !important; }
.opacity-50 { opacity: .5 !important; }
.opacity-75 { opacity: .75 !important; }
.opacity-100 { opacity: 1 !important; }
@media (min-width: 576px) {
.opacity-sm-0 { opacity: 0 !important; }
.opacity-sm-25 { opacity: .25 !important; }
.opacity-sm-50 { opacity: .5 !important; }
.opacity-sm-75 { opacity: .75 !important; }
.opacity-sm-100 { opacity: 1 !important; }
}
@media (min-width: 768px) {
.opacity-md-0 { opacity: 0 !important; }
.opacity-md-25 { opacity: .25 !important; }
.opacity-md-50 { opacity: .5 !important; }
.opacity-md-75 { opacity: .75 !important; }
.opacity-md-100 { opacity: 1 !important; }
}
@media (min-width: 992px) {
.opacity-lg-0 { opacity: 0 !important; }
.opacity-lg-25 { opacity: .25 !important; }
.opacity-lg-50 { opacity: .5 !important; }
.opacity-lg-75 { opacity: .75 !important; }
.opacity-lg-100 { opacity: 1 !important; }
}
@media (min-width: 1200px) {
.opacity-xl-0 { opacity: 0 !important; }
.opacity-xl-25 { opacity: .25 !important; }
.opacity-xl-50 { opacity: .5 !important; }
.opacity-xl-75 { opacity: .75 !important; }
.opacity-xl-100 { opacity: 1 !important; }
}
@media (min-width: 1400px) {
.opacity-xxl-0 { opacity: 0 !important; }
.opacity-xxl-25 { opacity: .25 !important; }
.opacity-xxl-50 { opacity: .5 !important; }
.opacity-xxl-75 { opacity: .75 !important; }
.opacity-xxl-100 { opacity: 1 !important; }
}
Impresión rehegua
Ombohapévo print
opción omoheñóita avei clase utilidad impresión-pe g̃uarã, ojeporúva @media print { ... }
consulta medio ryepýpe añoite.
$utilities: (
"opacity": (
property: opacity,
print: true,
values: (
0: 0,
25: .25,
50: .5,
75: .75,
100: 1,
)
)
);
Osẽ: .
.opacity-0 { opacity: 0 !important; }
.opacity-25 { opacity: .25 !important; }
.opacity-50 { opacity: .5 !important; }
.opacity-75 { opacity: .75 !important; }
.opacity-100 { opacity: 1 !important; }
@media print {
.opacity-print-0 { opacity: 0 !important; }
.opacity-print-25 { opacity: .25 !important; }
.opacity-print-50 { opacity: .5 !important; }
.opacity-print-75 { opacity: .75 !important; }
.opacity-print-100 { opacity: 1 !important; }
}
Importancia rehegua
Opaite utilidad omoheñóiva API oike !important
oasegura hag̃ua omboyke componente ha clase modificador oñehaꞌarõháicha. Ikatu emoambue ko ñemboheko globalmente pe $enable-important-utilities
mba’e’oka ndive (oñemoĩva’ekue ñepyrũrãme true
).
Oipurúvo API
Ko’áĝa reikuaa porãma mba’éichapa omba’apo API purupyrã rehegua, eikuaa mba’éichapa ikatu emoĩ ne mbo’esyry jeporupyre ha emoambue ore purupyrã tee.
Oñemboyke umi utilidad rehegua
Embogue umi utilidad oĩmava eipurúvo peteĩchagua clave. Techapyrã, reipotáramo ambue clase utilidad desbordamiento ombohováiva, ikatu rejapo kóva:
$utilities: (
"overflow": (
responsive: true,
property: overflow,
values: visible hidden scroll auto,
),
);
Oñemoĩve umi utilidad
Umi purupyrã pyahu ikatu oñembojoapy $utilities
mapa por defecto-pe peteĩ map-merge
. Ejesareko ore Sass rembiapokue oñeikotevẽva ha _utilities.scss
ojegueru raẽ, upéi eipuru pe map-merge
emoĩ hag̃ua ne purupyrã ambuéva. Techapyrã, ko’ápe ojehechauka mba’éichapa ikatu ñamoĩ peteĩ cursor
utilidad ombohováiva mbohapy valor reheve.
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
$utilities: map-merge(
$utilities,
(
"cursor": (
property: cursor,
class: cursor,
responsive: true,
values: auto pointer grab,
)
)
);
@import "bootstrap/scss/utilities/api";
Omoambue umi utilidad
Omoambue umi utilidad oĩmava $utilities
mapa por defecto-pe map-get
ha umi map-merge
función ndive. Pe techapyrã iguýpe, ñamoĩ hína peteĩ valor adicional umi width
utilidad-pe. Eñepyrũ peteĩ ñepyrũrã reheve map-merge
ha upéi emombe’u mba’e utilidad-pa remoambuese. Upégui, egueru "width"
mapa anidado ndive map-get
eike ha emoambue hag̃ua utilidad opción ha valor-kuéra.
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
$utilities: map-merge(
$utilities,
(
"width": map-merge(
map-get($utilities, "width"),
(
values: map-merge(
map-get(map-get($utilities, "width"), "values"),
(10: 10%),
),
),
),
)
);
@import "bootstrap/scss/utilities/api";
Omboguata ombohováiva
Ikatu emboguata mbo’esyry ombohováiva peteĩ tembipuru’i aty oĩmavape g̃uarã nombohováiva ko’áĝaite ñepyrũrãme. Techapyrã, ikatu haguãicha umi border
clase ombohovái:
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
$utilities: map-merge(
$utilities, (
"border": map-merge(
map-get($utilities, "border"),
( responsive: true ),
),
)
);
@import "bootstrap/scss/utilities/api";
Kóva ko ága omoheñóita variación ombohováiva .border
ha .border-0
petettet punto de ruptura rehegua. Nde CSS remoheñóiva ojehecháta péicha:
.border { ... }
.border-0 { ... }
@media (min-width: 576px) {
.border-sm { ... }
.border-sm-0 { ... }
}
@media (min-width: 768px) {
.border-md { ... }
.border-md-0 { ... }
}
@media (min-width: 992px) {
.border-lg { ... }
.border-lg-0 { ... }
}
@media (min-width: 1200px) {
.border-xl { ... }
.border-xl-0 { ... }
}
@media (min-width: 1400px) {
.border-xxl { ... }
.border-xxl-0 { ... }
}
Embohéra jey umi utilidad
Ofalta umi utilidad v4, térã ojepokuaa ambue convención de nombramiento rehe? Pe API purupyrã rehegua ikatu ojepuru oñemboyke hag̃ua class
peteĩ mbaꞌeporã oñemeꞌevaꞌekue osẽva—techapyrã, oñembohéra jey .ms-*
hag̃ua tembipururã tujaitépe .ml-*
:
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
$utilities: map-merge(
$utilities, (
"margin-start": map-merge(
map-get($utilities, "margin-start"),
( class: ml ),
),
)
);
@import "bootstrap/scss/utilities/api";
Ojepe’a umi utilidad
Eipe’a oimeraẽva umi tembipuru’i tenondegua map-remove()
Sass rembiapokue rupive .
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
// Remove multiple utilities with a comma-separated list
$utilities: map-remove($utilities, "width", "float");
@import "bootstrap/scss/utilities/api";
Ikatu avei eipuru map-merge()
función Sass ha emohenda clave grupo rehegua null
to eipeꞌa hag̃ua utilidad.
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
$utilities: map-merge(
$utilities,
(
"width": null
)
);
@import "bootstrap/scss/utilities/api";
Ombojoapy, oipe’a, omoambue
Ikatu emoĩ, eipe’a ha emoambue heta purupyrã peteĩ jeýpe map-merge()
Sass rembiapo rupive . Ko’ápe ojehecha mba’éichapa ikatu embojoaju umi techapyrã mboyvegua peteĩ mapa tuichavévape.
@import "bootstrap/scss/functions";
@import "bootstrap/scss/variables";
@import "bootstrap/scss/maps";
@import "bootstrap/scss/mixins";
@import "bootstrap/scss/utilities";
$utilities: map-merge(
$utilities,
(
// Remove the `width` utility
"width": null,
// Make an existing utility responsive
"border": map-merge(
map-get($utilities, "border"),
( responsive: true ),
),
// Add new utilities
"cursor": (
property: cursor,
class: cursor,
responsive: true,
values: auto pointer grab,
)
)
);
@import "bootstrap/scss/utilities/api";
Ojepe’a utilidad RTL-pe
Oĩ káso borde rehegua hasýva RTL estilo , haꞌeháicha línea ruptura árabe-pe. Péicha umi utilidad ikatu ojeity RTL osëvagui omohendávo rtl
opción false
:
$utilities: (
"word-wrap": (
property: word-wrap word-break,
class: text,
values: (break: break-word),
rtl: false
),
);
Osẽ: .
/* rtl:begin:remove */
.text-break {
word-wrap: break-word !important;
word-break: break-word !important;
}
/* rtl:end:remove */
Kóva ndosẽi mba’eve RTL-pe, aguyje RTLCSS remove
directiva control rehegua .