Commit 9482a5f8 authored by Mark Otto's avatar Mark Otto

Merge pull request #9403 from twbs/bs3_navbar_overhaul

BS3: Navbar overhaul
parents a8769b8c bd93ed2c
......@@ -52,9 +52,7 @@
<li>
<a href="#navbar">Navbar</a>
<ul class="nav">
<li><a href="#navbar-basic">Basic navbar</a></li>
<li><a href="#navbar-nav">Nav links</a></li>
<li><a href="#navbar-forms">Forms in navbars</a></li>
<li><a href="#navbar-default">Default navbar</a></li>
<li><a href="#navbar-buttons">Buttons in navbars</a></li>
<li><a href="#navbar-text">Text in navbars</a></li>
<li><a href="#navbar-links">Links in navbars</a></li>
......@@ -62,8 +60,6 @@
<li><a href="#navbar-fixed-top">Fixed top navbar</a></li>
<li><a href="#navbar-fixed-bottom">Fixed bottom navbar</a></li>
<li><a href="#navbar-static-top">Static top navbar</a></li>
<li><a href="#navbar-responsive">Responsive navbar</a></li>
<li><a href="#navbar-scrollable">Scrollable responsive navbar</a></li>
<li><a href="#navbar-inverted">Inverted navbar</a></li>
</ul>
</li>
......
<header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".bs-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
......@@ -7,7 +8,8 @@
<span class="icon-bar"></span>
</button>
<a href="{{ page.base_url }}" class="navbar-brand">Bootstrap 3 RC2</a>
<nav class="nav-collapse collapse bs-navbar-collapse" role="navigation">
</div>
<nav class="collapse navbar-collapse bs-navbar-collapse" role="navigation">
<ul class="nav navbar-nav">
<li{% if page.slug == "getting-started" %} class="active"{% endif %}>
<a href="{{ page.base_url }}getting-started">Getting started</a>
......
......@@ -56,6 +56,9 @@ body {
.bs-docs-nav {
background-color: #563d7c;
}
.bs-docs-nav .navbar-collapse {
border-color: #463265;
}
.bs-docs-nav .navbar-brand {
color: #fff;
}
......@@ -385,11 +388,10 @@ body {
}
/* Tweak display of the examples */
.bs-example + .prettyprint,
.bs-example + .highlight {
margin-top: 0;
border-top-left-radius: 0;
border-top-right-radius: 0;
margin: 0 -15px;
border-radius: 0;
border-width: 0 0 1px;
}
/* Tweak content of examples for optimum awesome */
......@@ -799,6 +801,15 @@ body {
border-radius: 4px 4px 0 0;
box-shadow: none;
}
.bs-example + .prettyprint,
.bs-example + .highlight {
margin-top: 0;
margin-left: 0;
margin-right: 0;
border-width: 1px;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}
.carbonad {
margin: 0 !important;
......
This diff is collapsed.
......@@ -2410,6 +2410,10 @@ textarea.input-group-lg > .input-group-btn > .btn {
position: relative;
}
.dropdown-toggle:focus {
outline: 0;
}
.dropdown-menu {
position: absolute;
top: 100%;
......@@ -3087,11 +3091,9 @@ button.close {
.navbar {
position: relative;
min-height: 50px;
padding-right: 15px;
padding-left: 15px;
margin-bottom: 20px;
background-color: #eeeeee;
border-radius: 4px;
background-color: #f8f8f8;
border: 1px solid #e7e7e7;
}
.navbar:before,
......@@ -3114,104 +3116,119 @@ button.close {
clear: both;
}
.navbar-nav > li > a {
padding-top: 15px;
padding-bottom: 15px;
line-height: 20px;
color: #777777;
@media (min-width: 768px) {
.navbar {
border-radius: 4px;
}
}
.navbar-nav > li > a:hover,
.navbar-nav > li > a:focus {
color: #333333;
background-color: transparent;
.navbar-header {
padding-right: 15px;
padding-left: 15px;
}
.navbar-nav > .active > a,
.navbar-nav > .active > a:hover,
.navbar-nav > .active > a:focus {
color: #555555;
background-color: #d5d5d5;
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-nav > .disabled > a,
.navbar-nav > .disabled > a:hover,
.navbar-nav > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
.navbar-header:after {
clear: both;
}
.navbar-nav.pull-right {
width: 100%;
.navbar-header:before,
.navbar-header:after {
display: table;
content: " ";
}
.navbar-static-top {
border-radius: 0;
.navbar-header:after {
clear: both;
}
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
border-radius: 0;
@media (min-width: 768px) {
.navbar-header {
float: left;
}
}
.navbar-fixed-top {
top: 0;
.navbar-collapse {
max-height: 360px;
padding: 5px 15px;
overflow-x: visible;
overflow-y: scroll;
border-top: 1px solid #e6e6e6;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
-webkit-overflow-scrolling: touch;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.nav-collapse {
padding-bottom: 15px;
.navbar-collapse:after {
clear: both;
}
.nav-collapse:before,
.nav-collapse:after {
.navbar-collapse:before,
.navbar-collapse:after {
display: table;
content: " ";
}
.nav-collapse:after {
.navbar-collapse:after {
clear: both;
}
.nav-collapse:before,
.nav-collapse:after {
display: table;
content: " ";
@media (min-width: 768px) {
.navbar-collapse {
width: auto;
padding-top: 0;
padding-bottom: 0;
border-top: 0;
}
}
.nav-collapse:after {
clear: both;
@media (min-width: 768px) {
.navbar-static-top {
border-width: 0 0 1px;
border-radius: 0;
}
}
.navbar-toggle + .nav-collapse {
width: 100%;
margin-top: 50px;
.navbar-fixed-top,
.navbar-fixed-bottom {
position: fixed;
right: 0;
left: 0;
z-index: 1030;
border-width: 0 0 1px;
}
@media (max-width: 768px) {
.nav-collapse-scrollable {
max-height: 360px;
margin-bottom: 15px;
overflow-y: scroll;
-webkit-overflow-scrolling: touch;
@media (min-width: 768px) {
.navbar-fixed-top,
.navbar-fixed-bottom {
border-radius: 0;
}
}
.navbar-fixed-top {
top: 0;
}
.navbar-fixed-bottom {
bottom: 0;
margin-bottom: 0;
}
.navbar-brand {
float: left;
padding-top: 15px;
padding-bottom: 15px;
margin-right: 15px;
margin-right: 7.5px;
font-size: 18px;
line-height: 20px;
color: #777777;
......@@ -3229,7 +3246,6 @@ button.close {
float: right;
padding: 9px 10px;
margin-top: 8px;
margin-right: -10px;
margin-bottom: 8px;
background-color: transparent;
border: 1px solid #dddddd;
......@@ -3253,9 +3269,94 @@ button.close {
margin-top: 4px;
}
.navbar-nav {
margin-right: -15px;
margin-left: -15px;
}
@media (min-width: 768px) {
.navbar-nav {
margin-right: 0;
margin-left: 0;
}
}
.navbar-nav > li > a {
padding-top: 10px;
padding-bottom: 10px;
line-height: 20px;
color: #777777;
}
.navbar-nav > li > a:hover,
.navbar-nav > li > a:focus {
color: #333333;
background-color: transparent;
}
.navbar-nav > .active > a,
.navbar-nav > .active > a:hover,
.navbar-nav > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.navbar-nav > .disabled > a,
.navbar-nav > .disabled > a:hover,
.navbar-nav > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
.navbar-nav.pull-right {
width: 100%;
}
@media (max-width: 767px) {
.navbar-nav .open .dropdown-menu {
position: static;
float: none;
width: auto;
margin-top: 0;
background-color: transparent;
border: 0;
box-shadow: none;
}
.navbar-nav .open .dropdown-menu > li > a,
.navbar-nav .open .dropdown-menu .dropdown-header {
padding: 5px 15px 5px 25px;
}
.navbar-nav .open .dropdown-menu > li > a {
line-height: 20px;
color: #777777;
}
.navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-nav .open .dropdown-menu > li > a:focus {
color: #333333;
background-color: transparent;
background-image: none;
}
.navbar-nav .open .dropdown-menu > .active > a,
.navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-nav .open .dropdown-menu > .active > a:focus {
color: #555555;
background-color: #e7e7e7;
}
.navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #cccccc;
background-color: transparent;
}
}
.navbar-form {
width: 100%;
padding: 10px 15px;
margin-top: 8px;
margin-bottom: 8px;
border-top: 1px solid #e6e6e6;
border-bottom: 1px solid #e6e6e6;
}
@media (min-width: 768px) {
......@@ -3281,6 +3382,21 @@ button.close {
}
}
@media (max-width: 767px) {
.navbar-form .form-group {
margin-bottom: 5px;
}
}
@media (min-width: 768px) {
.navbar-form {
width: auto;
padding-top: 0;
padding-bottom: 0;
border: 0;
}
}
.navbar-nav > li > .dropdown-menu {
margin-top: 0;
border-top-right-radius: 0;
......@@ -3302,7 +3418,7 @@ button.close {
.navbar-nav > .open > a:hover,
.navbar-nav > .open > a:focus {
color: #555555;
background-color: #d5d5d5;
background-color: #e7e7e7;
}
.navbar-nav > .open > a .caret,
......@@ -3325,6 +3441,7 @@ button.close {
.navbar-inverse {
background-color: #222222;
border-color: #080808;
}
.navbar-inverse .navbar-brand {
......@@ -3378,6 +3495,10 @@ button.close {
background-color: #ffffff;
}
.navbar-inverse .navbar-collapse {
border-top-color: #101010;
}
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
......@@ -3402,10 +3523,30 @@ button.close {
border-bottom-color: #ffffff;
}
@media screen and (min-width: 768px) {
.nav-collapse {
clear: none;
@media (max-width: 767px) {
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a {
color: #999999;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > li > a:focus {
color: #ffffff;
background-color: transparent;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .active > a:focus {
color: #ffffff;
background-color: #080808;
}
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:hover,
.navbar-inverse .navbar-nav .open .dropdown-menu > .disabled > a:focus {
color: #444444;
background-color: transparent;
}
}
@media screen and (min-width: 768px) {
.navbar-nav {
float: left;
margin-top: 0;
......@@ -3415,7 +3556,8 @@ button.close {
float: left;
}
.navbar-nav > li > a {
border-radius: 0;
padding-top: 15px;
padding-bottom: 15px;
}
.navbar-nav.pull-right {
width: auto;
......@@ -3426,7 +3568,7 @@ button.close {
left: auto;
display: none;
}
.nav-collapse.collapse {
.navbar-collapse.collapse {
display: block !important;
height: auto !important;
padding-bottom: 0;
......@@ -3440,7 +3582,6 @@ button.close {
.navbar-text {
float: left;
padding: 0 15px;
margin-top: 15px;
margin-bottom: 15px;
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,6 +21,11 @@
position: relative;
}
// Prevent the focus on the dropdown toggle when closing dropdowns
.dropdown-toggle:focus {
outline: 0;
}
// The dropdown menu (ul)
.dropdown-menu {
position: absolute;
......
This diff is collapsed.
......@@ -231,9 +231,10 @@
// Basics of a navbar
@navbar-height: 50px;
@navbar-color: #777;
@navbar-bg: #eee;
@navbar-margin-bottom: @line-height-computed;
@navbar-color: #777;
@navbar-bg: #f8f8f8;
@navbar-border: darken(@navbar-bg, 6.5%);
@navbar-border-radius: @border-radius-base;
@navbar-padding-horizontal: floor(@grid-gutter-width / 2);
@navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2);
......@@ -243,7 +244,7 @@
@navbar-link-hover-color: #333;
@navbar-link-hover-bg: transparent;
@navbar-link-active-color: #555;
@navbar-link-active-bg: darken(@navbar-bg, 10%);
@navbar-link-active-bg: darken(@navbar-bg, 6.5%);
@navbar-link-disabled-color: #ccc;
@navbar-link-disabled-bg: transparent;
......@@ -263,6 +264,7 @@
// Reset inverted navbar basics
@navbar-inverse-color: @gray-light;
@navbar-inverse-bg: #222;
@navbar-inverse-border: darken(@navbar-inverse-bg, 10%);
// Inverted navbar links
@navbar-inverse-link-color: @gray-light;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment