From 597a248d4ac8bf873d3227c2db285877061ed7b8 Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Thu, 17 Jan 2013 11:34:46 -0800 Subject: [PATCH] Rearrange navbar.less and improve vertical divider support --- docs/assets/css/bootstrap.css | 181 ++++++++++++------------ less/navbar.less | 250 ++++++++++++++++++---------------- 2 files changed, 222 insertions(+), 209 deletions(-) diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index 151c3dd02c..d001c03cdc 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -2975,6 +2975,52 @@ button.close { clear: both; } +.navbar .nav { + margin-top: 15px; +} + +.navbar .nav > li > a { + padding-top: 15px; + padding-bottom: 15px; + 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: #d5d5d5; +} + +.navbar-static-top { + position: static; + border-radius: 0; +} + +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: 1030; + border-radius: 0; +} + +.navbar-fixed-top { + top: 0; +} + +.navbar-fixed-bottom { + bottom: 0; +} + .navbar .brand { display: inline-block; padding: 7px 15px; @@ -3010,66 +3056,16 @@ button.close { margin-top: 3px; } -.navbar .nav { - margin-top: 15px; +.navbar .divider-vertical { + height: 30px; + margin: 10px 9px; + border-right: 1px solid #fbfbfb; + border-left: 1px solid #e1e1e1; } -.navbar .nav > li > a { - padding-top: 15px; - padding-bottom: 15px; - 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: #d5d5d5; -} - -@media screen and (min-width: 768px) { - .navbar { - padding-top: 0; - padding-bottom: 0; - } - .navbar .brand { - float: left; - padding-top: 15px; - padding-bottom: 15px; - margin-left: -15px; - } - .navbar .nav { - float: left; - margin-top: 0; - } - .navbar .nav:before, - .navbar .nav:after { - display: table; - content: " "; - } - .navbar .nav:after { - clear: both; - } - .navbar .nav.pull-right { - float: right; - } - .navbar .nav > li { - float: left; - } - .navbar .btn-navbar { - display: none; - } - .nav-collapse.collapse { - height: auto !important; - overflow: visible !important; - } +.navbar-form { + margin-top: 9px; + margin-bottom: 9px; } .navbar-inverse { @@ -3110,38 +3106,47 @@ button.close { background-color: #444; } -.navbar-static-top { - position: static; - border-radius: 0; +.navbar-inverse .divider-vertical { + border-right-color: #2f2f2f; + border-left-color: #151515; } -.navbar-fixed-top, -.navbar-fixed-bottom { - position: fixed; - right: 0; - left: 0; - z-index: 1030; - border-radius: 0; -} - -.navbar-fixed-top { - top: 0; -} - -.navbar-fixed-bottom { - bottom: 0; -} - -.navbar .divider-vertical { - height: 26px; - margin: 7px 9px; - border-right: 1px solid #fbfbfb; - border-left: 1px solid #e1e1e1; -} - -.navbar-form { - margin-top: 9px; - margin-bottom: 9px; +@media screen and (min-width: 768px) { + .navbar { + padding-top: 0; + padding-bottom: 0; + } + .navbar .brand { + float: left; + padding-top: 15px; + padding-bottom: 15px; + margin-left: -15px; + } + .navbar .nav { + float: left; + margin-top: 0; + } + .navbar .nav:before, + .navbar .nav:after { + display: table; + content: " "; + } + .navbar .nav:after { + clear: both; + } + .navbar .nav.pull-right { + float: right; + } + .navbar .nav > li { + float: left; + } + .navbar .btn-navbar { + display: none; + } + .nav-collapse.collapse { + height: auto !important; + overflow: visible !important; + } } /* diff --git a/less/navbar.less b/less/navbar.less index be2073fa2e..7484becbdf 100644 --- a/less/navbar.less +++ b/less/navbar.less @@ -11,46 +11,6 @@ .clear_float(); } -// Brand/project name -// ------------------------- - -.navbar .brand { - display: inline-block; - padding: 7px 15px; - font-size: 18px; - font-weight: bold; - line-height: @line-height-base; - color: @navbar-brand-color; - &:hover { - color: @navbar-brand-color-hover; - text-decoration: none; - background-color: @navbar-brand-bg-hover; - } -} - -// Responsive navbar button -// ------------------------- - -.btn-navbar { - float: right; - padding: 10px 12px; - background-color: #ddd; - border: 0; - border-radius: 4px; - - // Bars - .icon-bar { - display: block; - width: 20px; - height: 2px; - background-color: #fff; - border-radius: 1px; - } - .icon-bar + .icon-bar { - margin-top: 3px; - } -} - // Navbar nav links // ------------------------- @@ -77,6 +37,135 @@ } } + + +// +// Navbar alignment options +// -------------------------------------------------- + +// Static navbar +.navbar-static-top { + position: static; + border-radius: 0; +} + +// Fixed navbar +.navbar-fixed-top, +.navbar-fixed-bottom { + position: fixed; + right: 0; + left: 0; + z-index: @zindex-navbar-fixed; + border-radius: 0; +} +.navbar-fixed-top { top: 0; } +.navbar-fixed-bottom { bottom: 0; } + + + +// +// Navbar optional components +// -------------------------------------------------- + +// Brand/project name +.navbar .brand { + display: inline-block; + padding: 7px 15px; + font-size: 18px; + font-weight: bold; + line-height: @line-height-base; + color: @navbar-brand-color; + &:hover { + color: @navbar-brand-color-hover; + text-decoration: none; + background-color: @navbar-brand-bg-hover; + } +} + +// Collapsible navbar toggle +.btn-navbar { + float: right; + padding: 10px 12px; + background-color: #ddd; + border: 0; + border-radius: 4px; + + // Bars + .icon-bar { + display: block; + width: 20px; + height: 2px; + background-color: #fff; + border-radius: 1px; + } + .icon-bar + .icon-bar { + margin-top: 3px; + } +} + +// Dividers in navbar +.navbar .divider-vertical { + height: @navbar-height * .6; + margin: (@navbar-height * .2) 9px; + border-left: 1px solid darken(@navbar-bg, 5%); + border-right: 1px solid lighten(@navbar-bg, 5%); +} + +// Navbar form +.navbar-form { + .navbar-vertical-align(32px); // Vertically center in navbar +} + + + +// Inverse navbar +// -------------------------------------------------- + +.navbar-inverse { + background-color: @navbar-inverse-bg; + + .brand { + color: @navbar-inverse-brand-color; + &:hover { + color: @navbar-inverse-brand-color-hover; + background-color: @navbar-inverse-brand-bg-hover; + } + } + + .navbar-text { + color: @navbar-inverse-text; + } + + .nav > li > a { + color: @navbar-inverse-link-color; + } + .nav > li > a:hover, + .nav > li > a:focus { + color: @navbar-inverse-link-color-hover; + background-color: @navbar-inverse-link-bg-hover; + } + .nav > .active > a, + .nav > .active > a:hover, + .nav > .active > a:focus { + color: @navbar-inverse-link-color-active; + background-color: @navbar-inverse-link-bg-active; + } + + .btn-navbar { + background-color: #444; + } + + .divider-vertical { + border-left-color: darken(@navbar-inverse-bg, 5%); + border-right-color: lighten(@navbar-inverse-bg, 5%); + } +} + + + +// Inverse navbar +// -------------------------------------------------- + @media screen and (min-width: 768px) { .navbar { padding-top: 0; @@ -111,87 +200,6 @@ } } -// Inverse navbar -// ------------------------- - -.navbar-inverse { - background-color: @navbar-inverse-bg; - - .brand { - color: @navbar-inverse-brand-color; - &:hover { - color: @navbar-inverse-brand-color-hover; - background-color: @navbar-inverse-brand-bg-hover; - } - } - - .navbar-text { - color: @navbar-inverse-text; - } - - .nav > li > a { - color: @navbar-inverse-link-color; - } - .nav > li > a:hover, - .nav > li > a:focus { - color: @navbar-inverse-link-color-hover; - background-color: @navbar-inverse-link-bg-hover; - } - .nav > .active > a, - .nav > .active > a:hover, - .nav > .active > a:focus { - color: @navbar-inverse-link-color-active; - background-color: @navbar-inverse-link-bg-active; - } - .btn-navbar { - background-color: #444; - } -} - - - -// -// Navbar alignment options -// -------------------------------------------------- - -// Static navbar -.navbar-static-top { - position: static; - border-radius: 0; -} - -// Fixed navbar -.navbar-fixed-top, -.navbar-fixed-bottom { - position: fixed; - right: 0; - left: 0; - z-index: @zindex-navbar-fixed; - border-radius: 0; -} -.navbar-fixed-top { top: 0; } -.navbar-fixed-bottom { bottom: 0; } - - -// -// Navbar optional components -// -------------------------------------------------- - -// Dividers in navbar -.navbar .divider-vertical { - height: 26px; - margin: 7px 9px; - border-left: 1px solid darken(@navbar-bg, 5%); - border-right: 1px solid lighten(@navbar-bg, 5%); -} - -// Navbar form -.navbar-form { - .navbar-vertical-align(32px); // Vertically center in navbar -} - - - /* // Janky solution for now to account for links outside the .nav