123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 |
- // NAVBAR (FIXED AND STATIC)
- // -------------------------
- // COMMON STYLES
- // -------------
- .navbar {
- // Fix for IE7's bad z-indexing so dropdowns don't appear below content that follows the navbar
- *position: relative;
- *z-index: 2;
- overflow: visible;
- margin-bottom: @baseLineHeight;
- }
- // Gradient is applied to it's own element because overflow visible is not honored by IE when filter is present
- .navbar-inner {
- padding-left: 20px;
- padding-right: 20px;
- #gradient > .vertical(@navbarBackgroundHighlight, @navbarBackground);
- .border-radius(4px);
- @shadow: 0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);
- .box-shadow(@shadow);
- }
- // Set width to auto for default container
- // We then reset it for fixed navbars in the #gridSystem mixin
- .navbar .container {
- width: auto;
- }
- // Navbar button for toggling navbar items in responsive layouts
- .btn-navbar {
- display: none;
- float: right;
- padding: 7px 10px;
- margin-left: 5px;
- margin-right: 5px;
- .buttonBackground(@navbarBackgroundHighlight, @navbarBackground);
- @shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);
- .box-shadow(@shadow);
- }
- .btn-navbar .icon-bar {
- display: block;
- width: 18px;
- height: 2px;
- background-color: #f5f5f5;
- .border-radius(1px);
- .box-shadow(0 1px 0 rgba(0,0,0,.25));
- }
- .btn-navbar .icon-bar + .icon-bar {
- margin-top: 3px;
- }
- // Override the default collapsed state
- .nav-collapse.collapse {
- height: auto;
- }
- // Brand, links, text, and buttons
- .navbar {
- color: @navbarText;
- // Hover and active states
- .brand:hover {
- text-decoration: none;
- }
- // Website or project name
- .brand {
- float: left;
- display: block;
- padding: 8px 20px 12px;
- margin-left: -20px; // negative indent to left-align the text down the page
- font-size: 20px;
- font-weight: 200;
- line-height: 1;
- color: @white;
- }
- // Plain text in topbar
- .navbar-text {
- margin-bottom: 0;
- line-height: @navbarHeight;
- }
- // Buttons in navbar
- .btn,
- .btn-group {
- .navbarVerticalAlign(30px); // Vertically center in navbar
- }
- .btn-group .btn {
- margin-top: 0; // then undo the margin here so we don't accidentally double it
- }
- }
- // Navbar forms
- .navbar-form {
- margin-bottom: 0; // remove default bottom margin
- .clearfix();
- input,
- select,
- .radio,
- .checkbox {
- .navbarVerticalAlign(30px); // Vertically center in navbar
- }
- input,
- select {
- display: inline-block;
- margin-bottom: 0;
- }
- input[type="image"],
- input[type="checkbox"],
- input[type="radio"] {
- margin-top: 3px;
- }
- .input-append,
- .input-prepend {
- margin-top: 6px;
- white-space: nowrap; // preven two items from separating within a .navbar-form that has .pull-left
- input {
- margin-top: 0; // remove the margin on top since it's on the parent
- }
- }
- }
- // Navbar search
- .navbar-search {
- position: relative;
- float: left;
- .navbarVerticalAlign(28px); // Vertically center in navbar
- margin-bottom: 0;
- .search-query {
- padding: 4px 9px;
- #font > .sans-serif(13px, normal, 1);
- color: @white;
- background-color: @navbarSearchBackground;
- border: 1px solid @navbarSearchBorder;
- @shadow: inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0px rgba(255,255,255,.15);
- .box-shadow(@shadow);
- .transition(none);
- // Placeholder text gets special styles; can't be a grouped selector
- &:-moz-placeholder {
- color: @navbarSearchPlaceholderColor;
- }
- &::-webkit-input-placeholder {
- color: @navbarSearchPlaceholderColor;
- }
- // Focus states (we use .focused since IE7-8 and down doesn't support :focus)
- &:focus,
- &.focused {
- padding: 5px 10px;
- color: @grayDark;
- text-shadow: 0 1px 0 @white;
- background-color: @navbarSearchBackgroundFocus;
- border: 0;
- .box-shadow(0 0 3px rgba(0,0,0,.15));
- outline: 0;
- }
- }
- }
- // FIXED NAVBAR
- // ------------
- // Shared (top/bottom) styles
- .navbar-fixed-top,
- .navbar-fixed-bottom {
- position: fixed;
- right: 0;
- left: 0;
- z-index: @zindexFixedNavbar;
- margin-bottom: 0; // remove 18px margin for static navbar
- }
- .navbar-fixed-top .navbar-inner,
- .navbar-fixed-bottom .navbar-inner {
- padding-left: 0;
- padding-right: 0;
- .border-radius(0);
- }
- .navbar-fixed-top .container,
- .navbar-fixed-bottom .container {
- #grid > .core > .span(@gridColumns);
- }
- // Fixed to top
- .navbar-fixed-top {
- top: 0;
- }
- // Fixed to bottom
- .navbar-fixed-bottom {
- bottom: 0;
- }
- // NAVIGATION
- // ----------
- .navbar .nav {
- position: relative;
- left: 0;
- display: block;
- float: left;
- margin: 0 10px 0 0;
- }
- .navbar .nav.pull-right {
- float: right; // redeclare due to specificity
- }
- .navbar .nav > li {
- display: block;
- float: left;
- }
- // Links
- .navbar .nav > li > a {
- float: none;
- padding: 10px 10px 11px;
- line-height: 19px;
- color: @navbarLinkColor;
- text-decoration: none;
- text-shadow: 0 -1px 0 rgba(0,0,0,.25);
- }
- // Hover
- .navbar .nav > li > a:hover {
- background-color: @navbarLinkBackgroundHover; // "transparent" is default to differentiate :hover from .active
- color: @navbarLinkColorHover;
- text-decoration: none;
- }
- // Active nav items
- .navbar .nav .active > a,
- .navbar .nav .active > a:hover {
- color: @navbarLinkColorActive;
- text-decoration: none;
- background-color: @navbarLinkBackgroundActive;
- }
- // Dividers (basically a vertical hr)
- .navbar .divider-vertical {
- height: @navbarHeight;
- width: 1px;
- margin: 0 9px;
- overflow: hidden;
- background-color: @navbarBackground;
- border-right: 1px solid @navbarBackgroundHighlight;
- }
- // Secondary (floated right) nav in topbar
- .navbar .nav.pull-right {
- margin-left: 10px;
- margin-right: 0;
- }
- // Dropdown menus
- // --------------
- // Menu position and menu carets
- .navbar .dropdown-menu {
- margin-top: 1px;
- .border-radius(4px);
- &:before {
- content: '';
- display: inline-block;
- border-left: 7px solid transparent;
- border-right: 7px solid transparent;
- border-bottom: 7px solid #ccc;
- border-bottom-color: @dropdownBorder;
- position: absolute;
- top: -7px;
- left: 9px;
- }
- &:after {
- content: '';
- display: inline-block;
- border-left: 6px solid transparent;
- border-right: 6px solid transparent;
- border-bottom: 6px solid @dropdownBackground;
- position: absolute;
- top: -6px;
- left: 10px;
- }
- }
- // Menu position and menu caret support for dropups via extra dropup class
- .navbar-fixed-bottom .dropdown-menu {
- &:before {
- border-top: 7px solid #ccc;
- border-top-color: @dropdownBorder;
- border-bottom: 0;
- bottom: -7px;
- top: auto;
- }
- &:after {
- border-top: 6px solid @dropdownBackground;
- border-bottom: 0;
- bottom: -6px;
- top: auto;
- }
- }
- // Dropdown toggle caret
- .navbar .nav .dropdown-toggle .caret,
- .navbar .nav .open.dropdown .caret {
- border-top-color: @white;
- border-bottom-color: @white;
- }
- .navbar .nav .active .caret {
- .opacity(100);
- }
- // Remove background color from open dropdown
- .navbar .nav .open > .dropdown-toggle,
- .navbar .nav .active > .dropdown-toggle,
- .navbar .nav .open.active > .dropdown-toggle {
- background-color: transparent;
- }
- // Dropdown link on hover
- .navbar .nav .active > .dropdown-toggle:hover {
- color: @white;
- }
- // Right aligned menus need alt position
- // TODO: rejigger this at some point to simplify the selectors
- .navbar .nav.pull-right .dropdown-menu,
- .navbar .nav .dropdown-menu.pull-right {
- left: auto;
- right: 0;
- &:before {
- left: auto;
- right: 12px;
- }
- &:after {
- left: auto;
- right: 13px;
- }
- }
|