Navbar a ni
Bootstrap-a navigation header chak tak, chhanna pe thei, navbar atana documentation leh entirnan. Branding, navigation leh a dangte support a keng tel a, kan collapse plugin support pawh a tel bawk.
A hnathawh dan
Navbar i hman tan hmaa i hriat tur chu hetiang hi a ni:
- Navbars hian responsive collapsing leh color scheme class hrang hrang atan wrapping
.navbar
with a mamawh a..navbar-expand{-sm|-md|-lg|-xl|-xxl}
- Navbar leh a chhunga thil awmte hi default-in fluid a ni. Container chu an horizontal width chu kawng hrang hranga tihtlem turin thlak rawh .
- Navbar chhunga spacing leh alignment control nan kan spacing leh flex utility class te hmang rawh.
- Navbars hi default-in a chhang thei a, mahse chu chu i thlak danglam theih nan awlsam takin i siam danglam thei bawk. Responsive behavior hi kan Collapse JavaScript plugin ah a innghat a ni.
- Element hmangin accessibility ensure
<nav>
emaw, a ang chi element generic zawk hman a nih chuan navbar tinah<div>
a dah belh la, assistive technology hmangtute tan landmark region anga chiang taka hriat theih nan.role="navigation"
aria-current="page"
Tuna page awm mekaria-current="true"
atan emaw, set pakhata thil awm mek atan emaw hmangin item awm mek chu entir rawh .
prefers-reduced-motion
media query ah a innghat a ni. Kan accessibility documentation a reduced motion tih hi en la
.
Supported content a awm bawk
Navbars ah hian sub-component tlemte tan built-in support a awm a. A tul angin a hnuaia mi zingah hian thlang rawh:
.navbar-brand
i company, i thil siam, i project hming atan..navbar-nav
full-height leh lightweight navigation atan (dropdown support te pawh a tel)..navbar-toggler
kan collapse plugin leh navigation toggling behavior dangte nena hman tur.- Form control leh action eng pawh atan flex leh spacing utilities te.
.navbar-text
thuziak vertically centered string dah belh nan..collapse.navbar-collapse
parent breakpoint hmanga navbar contents group leh thup nan.- Optional dah la,
.navbar-scroll
a set amax-height
, expanded navbar content scroll rawh .
Hetah hian responsive light-themed navbar-a sub-component awm zawng zawng entir nan kan rawn tarlang e, chu chu lg
(large) breakpoint-ah automatic-in a collapse vek a ni.
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
He entirnan hian background ( bg-light
) leh spacing ( my-2
, my-lg-0
, me-sm-0
, my-sm-0
) utility class te a hmang a.
Chhinchhiah
The hi .navbar-brand
element tam zawkah hman theih a ni a, mahse anchor hian hna a thawk tha ber a, element thenkhatah chuan utility class emaw custom style emaw a ngai mai thei.
Thumal
.navbar-brand
Class nen element pakhat chhungah i text kha dah la .
<!-- As a link -->
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
</div>
</nav>
<!-- As a heading -->
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<span class="navbar-brand mb-0 h1">Navbar</span>
</div>
</nav>
Thlalak
A chhunga thuziak .navbar-brand
chu <img>
.
<nav class="navbar navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="#">
<img src="/docs/5.0/assets/brand/bootstrap-logo.svg" alt="" width="30" height="24">
</a>
</div>
</nav>
Image leh text
Tin, a ruala image leh text dah belh nan utility dang thenkhat i hmang thei bawk. .d-inline-block
A tih belh leh .align-text-top
a chungah hian chhinchhiah rawh <img>
.
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img src="/docs/5.0/assets/brand/bootstrap-logo.svg" alt="" width="30" height="24" class="d-inline-block align-text-top">
Bootstrap
</a>
</div>
</nav>
Nav
Navbar navigation link te hian kan .nav
option te hmangin anmahni modifier class hmangin an siam a, responsive styling dik tak neih nan toggler class hman a ngai a ni. Navbar-a navigation pawh a lo thang lian ang a, i navbar chhunga thu awmte chu him taka a inmil theih nan horizontal space a tam thei ang ber luah turin a pung ang.
Tuna page awm mek tarlan nan .active
class on kha add rawh ..nav-link
aria-current
Active ah pawh attribute kha i dah tel tur a ni tih hre reng ang che .nav-link
.
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
</div>
</div>
</nav>
Tin, kan navs atan class kan hman avangin i duh chuan list-based approach hi i pumpelh vek thei bawk.
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-link active" aria-current="page" href="#">Home</a>
<a class="nav-link" href="#">Features</a>
<a class="nav-link" href="#">Pricing</a>
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</div>
</div>
</div>
</nav>
I navbar ah dropdown te pawh i hmang thei bawk. Dropdown menu-ah hian positioning atan wrapping element a ngai a, chuvangin a hnuaia tarlan ang hian element hrang hrang leh nested element hmang ngei ang che .nav-item
..nav-link
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownMenuLink" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown link
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
Form hrang hrang
Navbar chhungah form control leh component hrang hrang dah rawh:
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</nav>
Immediately child elements of .navbar
use flex layout leh default ah a awm ang justify-content: space-between
. Hetiang thiltih hi siamrem nan a tul angin flex utility dang hmang bawk ang che .
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand">Navbar</a>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</nav>
Input group te pawhin hna an thawk ve bawk. I navbar chu form pum pui a nih chuan, a tam zawk chu form a nih chuan <form>
element chu container atan i hmang thei a, HTML thenkhat i save thei bawk.
<nav class="navbar navbar-light bg-light">
<form class="container-fluid">
<div class="input-group">
<span class="input-group-text" id="basic-addon1">@</span>
<input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
</div>
</form>
</nav>
Heng navbar form hrang hrangah hian button hrang hrang a support bawk. Hei hi vertical alignment utilities hmangin element size hrang hrang align theih a nih thu pawh hriat nawn tirtu ropui tak a ni.
<nav class="navbar navbar-light bg-light">
<form class="container-fluid justify-content-start">
<button class="btn btn-outline-success me-2" type="button">Main button</button>
<button class="btn btn-sm btn-outline-secondary" type="button">Smaller button</button>
</form>
</nav>
Thumal
Navbars ah hian bits of text a awm thei a, chu chu .navbar-text
. He class hian text string hrang hrangte tan vertical alignment leh horizontal spacing a siamrem thin.
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<span class="navbar-text">
Navbar text with an inline element
</span>
</div>
</nav>
A tul angin component leh utility dang nen mix leh match rawh.
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar w/ text</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarText" aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Pricing</a>
</li>
</ul>
<span class="navbar-text">
Navbar text with an inline element
</span>
</div>
</div>
</nav>
Color scheme hrang hrang te
background-color
Theming class leh utilities te inzawmkhawm avang hian navbar theming hi a awlsam ngai lo . .navbar-light
Background rawng eng tak tak nena hman tur, a nih loh leh background rawng dum nena hman tur atang hian thlang rawh .navbar-dark
. .bg-*
Tichuan, utilities hmangin customize rawh.
<nav class="navbar navbar-dark bg-dark">
<!-- Navbar content -->
</nav>
<nav class="navbar navbar-dark bg-primary">
<!-- Navbar content -->
</nav>
<nav class="navbar navbar-light" style="background-color: #e3f2fd;">
<!-- Navbar content -->
</nav>
Container te pawh a awm
.container
A ngai lo nain, page pakhata center turin navbar chu a-ah i wrap thei a ni –inner container a la mamawh tho tih hre reng ang che. A nih loh leh fixed emaw static top navbar.navbar
chhunga thil awmte chu center-ah chauh dah turin container chhungah i dah thei bawk.
<div class="container">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
</div>
</nav>
</div>
Responsive container eng pawh hmang la, i navbar-a thu awmte chu engzat nge a zau tih thlak rawh.
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-md">
<a class="navbar-brand" href="#">Navbar</a>
</div>
</nav>
Hmun dahna tur
Kan position utilities hmangin navbar te chu non-static position ah dah rawh. Fixed to the top, fixed to the bottom, or stickied to the top atang hian thlang rawh (page chu a chung a thlen thlengin a scroll a, chutah chuan a awm reng ang). Fixed navbars use position: fixed
, chu chu DOM-a normal flow atanga lak chhuah an ni tihna a ni a, element dangte nena overlap loh nan custom CSS (eg, padding-top
on the ) a mamawh thei bawk.<body>
Tin , a .sticky-top
hmang tih pawh hre bawk ang che position: sticky
, chu chu browser tin ah a support kim lo .
<nav class="navbar navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Default</a>
</div>
</nav>
<nav class="navbar fixed-top navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Fixed top</a>
</div>
</nav>
<nav class="navbar fixed-bottom navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Fixed bottom</a>
</div>
</nav>
<nav class="navbar sticky-top navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Sticky top</a>
</div>
</nav>
Scroll a ni
Navbar collapsed-a toggleable contents chhunga vertical scrolling awm theihna .navbar-nav-scroll
turin a .navbar-nav
(or navbar sub-component dang) ah dah rawh. Default-ah chuan scrolling chu 75vh
(or viewport height 75%)-ah a kick in a, mahse chu chu local CSS custom property --bs-navbar-height
emaw custom styles emaw hmangin i override thei a ni. Viewport lian zawkah chuan navbar tihzauh a nih chuan default navbar-a a lan angin content a lang ang.
Khawngaihin, he thiltih hian harsatna awm thei a keng tel tih hre reng ang che overflow
—when setting overflow-y: auto
(hetah hian content scroll tur a ngai), overflow-x
is the equivalent of auto
, chu chuan horizontal content thenkhat a crop ang.
Hetah hian entirnan navbar hmanga .navbar-nav-scroll
with style="--bs-scroll-height: 100px;"
, extra margin utility thenkhat nen optimum spacing atan kan rawn tarlang e.
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar scroll</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarScroll" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarScroll">
<ul class="navbar-nav me-auto my-2 my-lg-0 navbar-nav-scroll" style="--bs-scroll-height: 100px;">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarScrollingDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Link
</a>
<ul class="dropdown-menu" aria-labelledby="navbarScrollingDropdown">
<li><a class="dropdown-item" href="#">Action</a></li>
<li><a class="dropdown-item" href="#">Another action</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="#">Something else here</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Link</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
Chhanna pe thei nungchang
Navbars hian .navbar-toggler
, .navbar-collapse
, leh .navbar-expand{-sm|-md|-lg|-xl|-xxl}
class te hmangin an content chu button hnung lama a collapse hun tur a hriat theih a ni. Utility dang nena inzawm chuan awlsam takin element bikte engtikah nge i lantir dawn emaw, i thup dawn emaw tih i thlang thei a ni.
Navbar collap ngai lo tan chuan .navbar-expand
navbar ah class kha add la. .navbar-expand
Navbar collapse fo thin tan chuan class engmah add suh .
Toggler a ni
Navbar togglers te hi default-in left-aligned an ni a, mahse sibling element ang chi an zawm a nih chuan .navbar-brand
right right-ah automatic-in an align ang. I markup reverse chuan toggler dahna chu a reverse ang. A hnuaia tarlan te hi toggle style hrang hrang entir a ni.
.navbar-brand
Breakpoint tenau ber ah no show a awm lo:
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo01" aria-controls="navbarTogglerDemo01" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo01">
<a class="navbar-brand" href="#">Hidden brand</a>
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
A vei lamah brand hming a lang a, ding lamah toggler a awm bawk:
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">Navbar</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
Vei lamah toggler leh dinglamah brand name awmin:
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarTogglerDemo03" aria-controls="navbarTogglerDemo03" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">Navbar</a>
<div class="collapse navbar-collapse" id="navbarTogglerDemo03">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
</li>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
</nav>
Pawn lam thil awmte
A châng chuan collapse plugin hmangin structurally sits outside of the content atan container element trigger i duh thin .navbar
. Kan plugin hian id
and data-bs-target
matching ah hna a thawh avangin chu chu awlsam takin a ti thei!
<div class="collapse" id="navbarToggleExternalContent">
<div class="bg-dark p-4">
<h5 class="text-white h4">Collapsed content</h5>
<span class="text-muted">Toggleable via the navbar brand.</span>
</div>
</div>
<nav class="navbar navbar-dark bg-dark">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
</nav>
Chutianga i tih hunah chuan a hawn hunah focus chu programmatically-in container-ah i sawn theih nan JavaScript dang dah belh turin kan rawt a che. Chutiang a nih loh chuan keyboard hmangtute leh assistive technology hmangtute chuan thu thar an hmuh chu an harsat phah mai thei - a bik takin container hawn chu document structure-a toggler hmaa a lo kal chuan. Tin, toggler hian aria-controls
attribute a neih ngei ngei tur a ni tih kan rawt bawk a, chu chu id
of the content container-ah a kawhhmuh a ni. Theory-ah chuan, hei hian assistive technology hmangtute chu toggler atanga a control container-ah direct-in a zuang lut thei a–mahse tunah chuan hei hi thlawpna chu a patchy hle.
Sass a ni
Variables te pawh a awm
$navbar-padding-y: $spacer * .5;
$navbar-padding-x: null;
$navbar-nav-link-padding-x: .5rem;
$navbar-brand-font-size: $font-size-lg;
// Compute the navbar-brand padding-y so the navbar-brand will have the same height as navbar-text and nav-link
$nav-link-height: $font-size-base * $line-height-base + $nav-link-padding-y * 2;
$navbar-brand-height: $navbar-brand-font-size * $line-height-base;
$navbar-brand-padding-y: ($nav-link-height - $navbar-brand-height) * .5;
$navbar-brand-margin-end: 1rem;
$navbar-toggler-padding-y: .25rem;
$navbar-toggler-padding-x: .75rem;
$navbar-toggler-font-size: $font-size-lg;
$navbar-toggler-border-radius: $btn-border-radius;
$navbar-toggler-focus-width: $btn-focus-width;
$navbar-toggler-transition: box-shadow .15s ease-in-out;
$navbar-dark-color: rgba($white, .55);
$navbar-dark-hover-color: rgba($white, .75);
$navbar-dark-active-color: $white;
$navbar-dark-disabled-color: rgba($white, .25);
$navbar-dark-toggler-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path stroke='#{$navbar-dark-color}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>");
$navbar-dark-toggler-border-color: rgba($white, .1);
$navbar-light-color: rgba($black, .55);
$navbar-light-hover-color: rgba($black, .7);
$navbar-light-active-color: rgba($black, .9);
$navbar-light-disabled-color: rgba($black, .3);
$navbar-light-toggler-icon-bg: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path stroke='#{$navbar-light-color}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>");
$navbar-light-toggler-border-color: rgba($black, .1);
$navbar-light-brand-color: $navbar-light-active-color;
$navbar-light-brand-hover-color: $navbar-light-active-color;
$navbar-dark-brand-color: $navbar-dark-active-color;
$navbar-dark-brand-hover-color: $navbar-dark-active-color;
Suih
Responsive navbar expand/collapse class (eg, .navbar-expand-lg
) te chu $breakpoints
map nen an inzawm khawm a, loop hmangin scss/_navbar.scss
.
// Generate series of `.navbar-expand-*` responsive classes for configuring
// where your navbar collapses.
.navbar-expand {
@each $breakpoint in map-keys($grid-breakpoints) {
$next: breakpoint-next($breakpoint, $grid-breakpoints);
$infix: breakpoint-infix($next, $grid-breakpoints);
// stylelint-disable-next-line scss/selector-no-union-class-name
&#{$infix} {
@include media-breakpoint-up($next) {
flex-wrap: nowrap;
justify-content: flex-start;
.navbar-nav {
flex-direction: row;
.dropdown-menu {
position: absolute;
}
.nav-link {
padding-right: $navbar-nav-link-padding-x;
padding-left: $navbar-nav-link-padding-x;
}
}
.navbar-nav-scroll {
overflow: visible;
}
.navbar-collapse {
display: flex !important; // stylelint-disable-line declaration-no-important
flex-basis: auto;
}
.navbar-toggler {
display: none;
}
}
}
}
}