mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-29 21:52:22 +01:00
Make .nav flex-powered
- Set an explicit `display: flex` on the base `.nav` class and remove the floats/clearfixes from our navs. - Set some global styles for `.nav-link`, a departure from the previous solution that featured no predefined padding. - Move `.nav-link` from `inline-block` to `block` given this setting was added for our tabs and pills anyway. - Remove horizontal margin from nav tabs; let folks set that on their own from now on.
This commit is contained in:
parent
ec0dbc74a7
commit
699d8a5a80
@ -4,13 +4,15 @@
|
|||||||
// `<nav>`s or `<ul>`s.
|
// `<nav>`s or `<ul>`s.
|
||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
|
display: flex;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-link {
|
.nav-link {
|
||||||
display: inline-block;
|
display: block;
|
||||||
|
padding: $nav-link-padding;
|
||||||
|
|
||||||
@include hover-focus {
|
@include hover-focus {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@ -29,41 +31,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Nav inline
|
|
||||||
|
|
||||||
.nav-inline {
|
|
||||||
.nav-item {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-item + .nav-item,
|
|
||||||
.nav-link + .nav-link {
|
|
||||||
margin-left: $nav-item-inline-spacer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Tabs
|
// Tabs
|
||||||
//
|
//
|
||||||
|
|
||||||
.nav-tabs {
|
.nav-tabs {
|
||||||
border-bottom: $nav-tabs-border-width solid $nav-tabs-border-color;
|
border-bottom: $nav-tabs-border-width solid $nav-tabs-border-color;
|
||||||
@include clearfix();
|
|
||||||
|
|
||||||
.nav-item {
|
.nav-item {
|
||||||
float: left;
|
|
||||||
// Make the list-items overlay the bottom border
|
|
||||||
margin-bottom: -$nav-tabs-border-width;
|
margin-bottom: -$nav-tabs-border-width;
|
||||||
|
|
||||||
+ .nav-item {
|
|
||||||
margin-left: $nav-item-margin;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-link {
|
.nav-link {
|
||||||
display: block;
|
|
||||||
padding: $nav-link-padding;
|
|
||||||
border: $nav-tabs-border-width solid transparent;
|
border: $nav-tabs-border-width solid transparent;
|
||||||
@include border-top-radius($nav-tabs-border-radius);
|
@include border-top-radius($nav-tabs-border-radius);
|
||||||
|
|
||||||
@ -103,19 +82,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
.nav-pills {
|
.nav-pills {
|
||||||
@include clearfix();
|
|
||||||
|
|
||||||
.nav-item {
|
|
||||||
float: left;
|
|
||||||
|
|
||||||
+ .nav-item {
|
|
||||||
margin-left: $nav-item-margin;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-link {
|
.nav-link {
|
||||||
display: block;
|
|
||||||
padding: $nav-link-padding;
|
|
||||||
@include border-radius($nav-pills-border-radius);
|
@include border-radius($nav-pills-border-radius);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user