0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00
Bootstrap/less/responsive-navbar.less

186 lines
4.0 KiB
Plaintext
Raw Normal View History

2012-06-29 06:46:45 +02:00
//
// Responsive: Navbar
// --------------------------------------------------
2012-03-23 05:54:54 +01:00
// TABLETS AND BELOW
// -----------------
2012-12-01 00:33:56 +01:00
@media (max-width: @navbar-collapse-width) {
2012-03-23 05:54:54 +01:00
// UNFIX THE TOPBAR
// ----------------
// Remove any padding from the body
body {
padding-top: 0;
}
// Unfix the navbars
.navbar-fixed-top,
.navbar-fixed-bottom {
2012-03-23 05:54:54 +01:00
position: static;
}
.navbar-fixed-top {
margin-bottom: @line-height-base;
2012-03-23 05:54:54 +01:00
}
.navbar-fixed-bottom {
margin-top: @line-height-base;
}
.navbar-fixed-top,
.navbar-fixed-bottom {
2012-03-23 05:54:54 +01:00
padding: 5px;
}
.navbar .container {
width: auto;
padding: 0;
}
// Account for brand name
.navbar .brand {
padding-left: 10px;
padding-right: 10px;
margin: 0 0 0 -5px;
}
// COLLAPSIBLE NAVBAR
// ------------------
2012-03-23 05:54:54 +01:00
// Nav collapse clears brand
.nav-collapse {
clear: both;
2012-03-23 05:54:54 +01:00
}
// Block-level the nav
.nav-collapse .nav {
2012-03-23 05:54:54 +01:00
float: none;
margin: 0 0 (@line-height-base / 2);
2012-03-23 05:54:54 +01:00
}
.nav-collapse .nav > li {
2012-03-23 05:54:54 +01:00
float: none;
}
.nav-collapse .nav > li > a {
2012-03-23 05:54:54 +01:00
margin-bottom: 2px;
}
.nav-collapse .nav > .divider-vertical {
2012-03-23 05:54:54 +01:00
display: none;
}
.nav-collapse .nav .nav-header {
2012-12-01 00:33:56 +01:00
color: @navbar-text;
2012-03-23 05:54:54 +01:00
text-shadow: none;
}
// Nav and dropdown links in navbar
.nav-collapse .nav > li > a,
.nav-collapse .dropdown-menu a {
padding: 9px 15px;
2012-03-23 05:54:54 +01:00
font-weight: bold;
2012-12-01 00:33:56 +01:00
color: @navbar-link-color;
border-radius: 3px;
2012-03-23 05:54:54 +01:00
}
// Buttons
.nav-collapse .btn {
padding: 4px 10px 4px;
font-weight: normal;
border-radius: @border-radius-base;
}
.nav-collapse .dropdown-menu li + li a {
2012-03-23 05:54:54 +01:00
margin-bottom: 2px;
}
.nav-collapse .nav > li > a:hover,
.nav-collapse .dropdown-menu a:hover {
2012-12-01 00:33:56 +01:00
background-color: @navbar-background;
2012-03-23 05:54:54 +01:00
}
.navbar-inverse .nav-collapse .nav > li > a,
.navbar-inverse .nav-collapse .dropdown-menu a {
2012-12-01 00:33:56 +01:00
color: @navbar-inverse-link-color;
}
.navbar-inverse .nav-collapse .nav > li > a:hover,
.navbar-inverse .nav-collapse .dropdown-menu a:hover {
2012-12-01 00:33:56 +01:00
background-color: @navbar-inverse-background;
}
// Buttons in the navbar
.nav-collapse.in .btn-group {
margin-top: 5px;
padding: 0;
}
2012-03-23 05:54:54 +01:00
// Dropdowns in the navbar
.nav-collapse .dropdown-menu {
2012-03-23 05:54:54 +01:00
position: static;
top: auto;
left: auto;
float: none;
display: none;
2012-03-23 05:54:54 +01:00
max-width: none;
margin: 0 15px;
padding: 0;
background-color: transparent;
border: none;
border-radius: 0;
2012-03-23 05:54:54 +01:00
.box-shadow(none);
}
.nav-collapse .open > .dropdown-menu {
display: block;
}
.nav-collapse .dropdown-menu:before,
.nav-collapse .dropdown-menu:after {
2012-03-23 05:54:54 +01:00
display: none;
}
.nav-collapse .dropdown-menu .divider {
2012-03-23 05:54:54 +01:00
display: none;
}
.nav-collapse .nav > li > .dropdown-menu {
&:before,
&:after {
display: none;
}
}
2012-03-23 05:54:54 +01:00
// Forms in navbar
.nav-collapse .navbar-form,
.nav-collapse .navbar-search {
2012-03-23 05:54:54 +01:00
float: none;
padding: (@line-height-base / 2) 15px;
margin: (@line-height-base / 2) 0;
2012-12-01 00:33:56 +01:00
border-top: 1px solid @navbar-background;
border-bottom: 1px solid @navbar-background;
.box-shadow(~"inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1)");
2012-03-23 05:54:54 +01:00
}
.navbar-inverse .nav-collapse .navbar-form,
.navbar-inverse .nav-collapse .navbar-search {
2012-12-01 00:33:56 +01:00
border-top-color: @navbar-inverse-background;
border-bottom-color: @navbar-inverse-background;
}
2012-03-23 05:54:54 +01:00
// Pull right (secondary) nav content
.navbar .nav-collapse .nav.pull-right {
2012-03-23 05:54:54 +01:00
float: none;
margin-left: 0;
}
// Hide everything in the navbar save .brand and toggle button */
.nav-collapse,
.nav-collapse.collapse {
overflow: hidden;
height: 0;
2012-03-23 05:54:54 +01:00
}
// Navbar button
.navbar .btn-navbar {
2012-03-23 05:54:54 +01:00
display: block;
}
// STATIC NAVBAR
// -------------
.navbar-static {
padding-left: 10px;
padding-right: 10px;
2012-03-23 05:54:54 +01:00
}
2012-03-23 05:54:54 +01:00
}
// DEFAULT DESKTOP
// ---------------
2012-12-01 00:33:56 +01:00
@media (min-width: @navbar-collapse-width-desktop) {
// Required to make the collapsing navbar work on regular desktops
2012-03-23 05:54:54 +01:00
.nav-collapse.collapse {
height: auto !important;
overflow: visible !important;
}
}