Commit c0eacca0 authored by Mark Otto's avatar Mark Otto
Browse files

Navs refactor, restoring .nav-list

parent a12eb2b9
main cleanup-floating-forms cssvar-function dependabot/npm_and_yarn/stylelint-and-stylelint-config-twbs-bootstrap-15.3.0 extend-snippets feat/data-target floating-always-visible floating-labels-icons fod-main-banner form-controls-with-icons gh-pages gh-pages-530-alpha2 github/fork/719media/patch-13 github/fork/719media/patch-14 github/fork/719media/patch-9 github/fork/ChellyAhmed/fix-typo-reboot.md github/fork/ChellyAhmed/offcanvas-scroll-back github/fork/CtrlAltLilith/main github/fork/Elysiome/offcanvas-optional-window-resizing github/fork/JanSargsyan/main github/fork/LunicLynx/support-different-line-height-for-buttons github/fork/Psixodelik/main github/fork/Ronid1/ronid1/offcanvas_static_backdrop github/fork/RyanBerliner/tooltip-accessibility github/fork/SantiagoPVazquez/Feature-default-border-bottom-to-dropdown-item github/fork/Sir-Genius/utils github/fork/Sumit-Singh-8/main github/fork/Viktor-VERA2020/offcanvas-slide github/fork/Zivangu9/input-group-for-form-control-plaintext github/fork/alpadev/alpadev/call-dispose-on-component-reinstantiation github/fork/astagi/fix/tree-shake-modules github/fork/compnerd/dark-accordion-icon github/fork/derSascha/dropdown-dont-close-on-input-click github/fork/dev-ph1l/main github/fork/donquixote/issue-33861-utl-mixin github/fork/florianlacreuse/mixin-make-row-gutter-y github/fork/gregorw/main github/fork/iteggmbh/transitionend-dispose-race github/fork/jdelStrother/patch-1 github/fork/jonnysp/form-floating github/fork/jonnysp/independent-offcanvas github/fork/jonnysp/theme-dark-on-card-and-modal-fix github/fork/josefdlange/floating-label-placeholder-opacity github/fork/julien-deramond/enhance-change-version.js github/fork/julien-deramond/main-jd-fix-offset-content github/fork/julien-deramond/main-jd-issue-with-utitlies github/fork/julien-deramond/main-xmr-pa11y-ci-jd-add-hideElements github/fork/kyletsang/fix-tooltip-padding github/fork/lacutah/CheckboxCenteringDocumentation github/fork/lekoala/patch-3 github/fork/louismaximepiton/main-kld-lmp-collapse-proposal github/fork/louismaximepiton/main-lmp-card-inner-border-radius-fix github/fork/louismaximepiton/main-lmp-carousel-multiple-images github/fork/louismaximepiton/main-lmp-css-var-init github/fork/louismaximepiton/main-lmp-disabled-floating-label-fix github/fork/louismaximepiton/main-lmp-input-range-fix github/fork/louismaximepiton/main-lmp-shift-color github/fork/louismaximepiton/main-lmp-table-active-tr-fix github/fork/maciek-szn/switch github/fork/michael-roth/feature/19964-multiple-tab-targets github/fork/mistic100/dom-utils github/fork/nkdas91/accordion github/fork/nstungcom/fix-missing-modal-open-class github/fork/oraliahdz/animation-utilities github/fork/pine3ree/patch-7 github/fork/pouwerkerk/unindent-scss-docs-shortcode github/fork/smares/smares-no-scolling-on-modal-close github/fork/tgm-git/patch-1 gs-forms gs-toasts-with-animated-progress-bar gs/add-history-helper gs/change-version-dir-on-docs gs/data-must-set-onlu-one-instance gs/docs/fix-drop-down-error gs/event-handler-2 gs/make-docs-js-build gs/make-simple-attribute-toggler gs/popover-fix-doc gs/provide-steConfig-method gs/scrollspy-smoothscroll-option-use-browser-history gs/streamline-jqueryInterface gs/support-drop-down-in-navbar gs/test-js-generic-trigger gs/try-web-components gs/tweak-collapse-js-selector gs/use-event-handler-in-cocmponent gs/use-rollup-replace-for-version jo-docs-thanks-page jo-ssr-friendly logical-props-spacing-utils main-fod-disabled-form-check-label main-fod-nested-accordion main-fod-simpler-table-structure main-fod-table-separator main-fod-utilities-contrast main-jd-abbr-title main-jd-add-chips main-jd-add-doc-for-sass-custom-colors main-jd-add-enable-host-to-handle-web-components main-jd-browserstack-fine-tune main-jd-browserstack-updates main-jd-docs-consistent-usage-of-css-sections-step-2 main-jd-fix-docs-headers-in-white main-jd-fix-highlight-docs-border-radius main-jd-fix-placeholder-color-background-params-for-img-markup main-jd-glossary-experiment main-jd-postcss-drop-empty-css-vars main-jd-proto-doc-astro main-jd-skip-navigation-component main-jd-stackblitz-for-examples main-jd-upgrade-browserlistrc main-jd-use-host main-lmp-dark-theme-customization main-lmp-handle-scroll-target main-lmp-tab-fix main-mc-opensearch main-xmr-bundlewatch-action main-xmr-eslint-plugin-compat main-xmr-hugo-docs-vendor main-xmr-hugo-rm-ver main-xmr-linkinator-prod main-xmr-min-mangle main-xmr-pa11y-ci more-darkmode-examples nested-dropdowns patrickhlauke-issue37428 patrickhlauke-use-of-color-tweaks pr/34102 pr/37590 previous-next-docs-links sticky-thead utilities-functions-mixin v3-dev v4-dev v4-dev-dropdown-hide-method v530-dev v6-postcss-custom-media v6-spinner-dots v6/gs/use-floating-ui-in-place-of-popper xmr/dev xmr/docs-png xmr/docs-svgs xmr/hugo-reorg-files xmr/js-2 xmr/markdownlint xmr/prepare-530-alpha2 xmr/xo v5.3.0-alpha1 v5.2.3 v5.2.2 v5.2.1 v5.2.0 v5.2.0-beta1 v5.1.3 v5.1.2 v5.1.1 v5.1.0 v5.0.2 v5.0.1 v5.0.0 v5.0.0-beta3 v5.0.0-beta2 v5.0.0-beta1 v5.0.0-alpha3 v5.0.0-alpha2 v5.0.0-alpha1 v4.6.2 v4.6.1 v4.6.0 v4.5.3 v4.5.2 v4.5.1 v4.5.0 v4.4.1 v4.4.0 v4.3.1 v4.3.0 v4.2.1 v4.2.0 v4.1.3 v4.1.2 v4.1.1 v4.1.0 v4.0.0 v4.0.0-beta.3 v4.0.0-beta.2 v4.0.0-beta v4.0.0-alpha.6 v4.0.0-alpha.5 v4.0.0-alpha.4 v4.0.0-alpha.3 v4.0.0-alpha.2 v4.0.0-alpha v3.4.1 v3.4.0 v3.3.7 v3.3.6 v3.3.5 v3.3.4 v3.3.2 v3.3.1 v3.3.0 v3.2.0 v3.1.1 v3.1.0 v3.0.3 v3.0.2 v3.0.1 v3.0.0 v3.0.0-rc.2 v3.0.0-rc1
21 merge requests!7033Fix backdrop undefined bug in modal,!8635ignore Gruntfile.js in jekyll,!8339Fix broken links to navbar component in docs examples,!7329Fix for issue #7328,!7219Fix for mini typo mistake in css.html,!7674Clear float on all when navbar is collapsed - v3,!7344Fixed .spanX selector (*= instead of ^=),!7346Fix compilation error,!7775added some tests for tooltip title setter,!8157Close Me: Docs "Customize and Download" button fix,!7509Proposed fix for allowing Collapse events ('show'/'hide') to be cancelled,!7964commit fixes #7792,!8656Added rel="stylesheet" to CDN-Examples,!8527Inner properties move 1,!8245Interactive color picker - Closed: request against wrong branch,!7865Patch 2,!7651Drop the sizzle dependency to allow smaller builds targeting mobile devices,!6853typeahead: do not store item data in an attribute,!6666Patch 1,!65463.0.0 wip - fixed the issue in which the test pid isn't killed if a test fails,!6503control markup changes added
Showing with 204 additions and 302 deletions
+204 -302
......@@ -3439,8 +3439,24 @@ input[type="button"].btn-block {
list-style: none;
}
.nav:before,
.nav:after {
display: table;
line-height: 0;
content: "";
}
.nav:after {
clear: both;
}
.nav > li {
float: left;
}
.nav > li > a {
display: block;
padding: 8px 12px;
}
.nav > li > a:hover {
......@@ -3475,33 +3491,6 @@ input[type="button"].btn-block {
border-bottom: 1px solid #ffffff;
}
.nav-tabs:before,
.nav-pills:before,
.nav-tabs:after,
.nav-pills:after {
display: table;
line-height: 0;
content: "";
}
.nav-tabs:after,
.nav-pills:after {
clear: both;
}
.nav-tabs > li,
.nav-pills > li {
float: left;
}
.nav-tabs > li > a,
.nav-pills > li > a {
padding-right: 12px;
padding-left: 12px;
margin-right: 2px;
line-height: 14px;
}
.nav-tabs {
border-bottom: 1px solid #ddd;
}
......@@ -3511,8 +3500,7 @@ input[type="button"].btn-block {
}
.nav-tabs > li > a {
padding-top: 8px;
padding-bottom: 8px;
margin-right: 2px;
line-height: 20px;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
......@@ -3531,78 +3519,81 @@ input[type="button"].btn-block {
border-bottom-color: transparent;
}
.nav-pills > li > a {
padding-top: 8px;
padding-bottom: 8px;
margin-top: 2px;
margin-bottom: 2px;
border-radius: 5px;
.nav-list {
background-color: #fff;
border-radius: 6px;
-webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.065);
}
.nav-pills > .active > a,
.nav-pills > .active > a:hover {
color: #ffffff;
background-color: #0088cc;
.nav-list > li {
float: none;
}
.nav-stacked > li {
float: none;
.nav-list > li > a {
margin-bottom: -1px;
border: 1px solid #e5e5e5;
}
.nav-stacked > li > a {
margin-right: 0;
.nav-list > li > a:hover {
background-color: #f5f5f5;
}
.nav-tabs.nav-stacked {
border-bottom: 0;
.nav-list > li:first-child > a {
border-radius: 6px 6px 0 0;
}
.nav-tabs.nav-stacked > li > a {
border: 1px solid #ddd;
border-radius: 0;
.nav-list > li:last-child > a {
border-radius: 0 0 6px 6px;
}
.nav-tabs.nav-stacked > li:first-child > a {
-webkit-border-top-right-radius: 4px;
border-top-right-radius: 4px;
-webkit-border-top-left-radius: 4px;
border-top-left-radius: 4px;
-moz-border-radius-topright: 4px;
-moz-border-radius-topleft: 4px;
.nav-list > .active > a,
.nav-list > .active > a:hover {
position: relative;
z-index: 2;
padding: 9px 15px;
color: #fff;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
background-color: #0088cc;
border-width: 0;
-webkit-box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.1), inset -1px 0 0 rgba(0, 0, 0, 0.1);
box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.1), inset -1px 0 0 rgba(0, 0, 0, 0.1);
}
.nav-tabs.nav-stacked > li:last-child > a {
-webkit-border-bottom-right-radius: 4px;
border-bottom-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
border-bottom-left-radius: 4px;
-moz-border-radius-bottomright: 4px;
-moz-border-radius-bottomleft: 4px;
.nav-pills > li > a {
border-radius: 5px;
}
.nav-tabs.nav-stacked > li > a:hover {
z-index: 2;
border-color: #ddd;
.nav-pills > li + li > a {
margin-left: 2px;
}
.nav-pills.nav-stacked > li > a {
margin-bottom: 3px;
.nav-pills > .active > a,
.nav-pills > .active > a:hover {
color: #ffffff;
background-color: #0088cc;
}
.nav-pills.nav-stacked > li:last-child > a {
margin-bottom: 1px;
.nav-stacked > li {
float: none;
}
.nav-tabs .dropdown-menu {
border-radius: 0 0 6px 6px;
.nav-stacked > li + li > a {
margin-top: 2px;
margin-left: 0;
}
.nav-pills .dropdown-menu {
border-radius: 6px;
.nav-tabs .dropdown-menu {
-webkit-border-top-right-radius: 0;
border-top-right-radius: 0;
-webkit-border-top-left-radius: 0;
border-top-left-radius: 0;
-moz-border-radius-topright: 0;
-moz-border-radius-topleft: 0;
}
.nav .dropdown-toggle .caret {
margin-top: 6px;
margin-top: 8px;
border-top-color: #0088cc;
border-bottom-color: #0088cc;
}
......@@ -3612,12 +3603,6 @@ input[type="button"].btn-block {
border-bottom-color: #005580;
}
/* move down carets for tabs */
.nav-tabs .dropdown-toggle .caret {
margin-top: 8px;
}
.nav .active .dropdown-toggle .caret {
border-top-color: #fff;
border-bottom-color: #fff;
......@@ -4071,7 +4056,7 @@ input[type="button"].btn-block {
background-image: -o-linear-gradient(top, #222222, #111111);
background-image: linear-gradient(to bottom, #222222, #111111);
background-repeat: repeat-x;
border-color: #252525;
border-color: #111111;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff111111', GradientType=0);
}
......
......@@ -754,41 +754,6 @@ form.bs-docs-example {
.bs-docs-sidenav {
width: 228px;
margin: 30px 0 0;
padding: 0;
background-color: #fff;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: 0 1px 4px rgba(0,0,0,.065);
-moz-box-shadow: 0 1px 4px rgba(0,0,0,.065);
box-shadow: 0 1px 4px rgba(0,0,0,.065);
}
.bs-docs-sidenav > li > a {
display: block;
width: 190px \9;
margin: 0 0 -1px;
padding: 8px 14px;
border: 1px solid #e5e5e5;
}
.bs-docs-sidenav > li:first-child > a {
-webkit-border-radius: 6px 6px 0 0;
-moz-border-radius: 6px 6px 0 0;
border-radius: 6px 6px 0 0;
}
.bs-docs-sidenav > li:last-child > a {
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
}
.bs-docs-sidenav > .active > a {
position: relative;
z-index: 2;
padding: 9px 15px;
border: 0;
text-shadow: 0 1px 0 rgba(0,0,0,.15);
-webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
-moz-box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
box-shadow: inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1);
}
/* Chevrons */
.bs-docs-sidenav .icon-chevron-right {
......@@ -797,9 +762,6 @@ form.bs-docs-example {
margin-right: -6px;
opacity: .25;
}
.bs-docs-sidenav > li > a:hover {
background-color: #f5f5f5;
}
.bs-docs-sidenav a:hover .icon-chevron-right {
opacity: .5;
}
......
......@@ -668,18 +668,17 @@
<!-- Nav, Tabs, & Pills
<!-- Navs
================================================== -->
<section id="navs">
<div class="page-header">
<h1>Nav: tabs, pills, and lists</small></h1>
<h1>Navs</small></h1>
</div>
<h2>Lightweight defaults <small>Same markup, different classes</small></h2>
<p>All nav components here&mdash;tabs, pills, and lists&mdash;<strong>share the same base markup and styles</strong> through the <code>.nav</code> class.</p>
<p class="lead">Navs available in Bootstrap have shared markup, starting with the base <code>.nav</code> class, as well as shared states. Swap modifier classes to switch between each style.</p>
<h3>Basic tabs</h3>
<p>Take a regular <code>&lt;ul&gt;</code> of links and add <code>.nav-tabs</code>:</p>
<h2>Tabs</h2>
<p>Note the <code>.nav-tabs</code> class requires the <code>.nav</code> base class.</p>
<div class="bs-docs-example">
<ul class="nav nav-tabs">
<li class="active"><a href="#">Home</a></li>
......@@ -697,17 +696,17 @@
&lt;/ul&gt;
</pre>
<h3>Basic pills</h3>
<p>Take that same HTML, but use <code>.nav-pills</code> instead:</p>
<h2>List</h2>
<p>Swap the tabs class for <code>.nav-list</code>.</p>
<div class="bs-docs-example">
<ul class="nav nav-pills">
<ul class="nav nav-list" style="max-width: 300px;">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Profile</a></li>
<li><a href="#">Messages</a></li>
</ul>
</div>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-pills"&gt;
&lt;ul class="nav nav-list"&gt;
&lt;li class="active"&gt;
&lt;a href="#"&gt;Home&lt;/a&gt;
&lt;/li&gt;
......@@ -716,50 +715,27 @@
&lt;/ul&gt;
</pre>
<h3>Disabled state</h3>
<p>For any nav component (tabs, pills, or list), add <code>.disabled</code> for <strong>gray links and no hover effects</strong>. Links will remain clickable, however, unless you remove the <code>href</code> attribute. Alternatively, you could implement custom JavaScript to prevent those clicks.</p>
<h2>Pills</h2>
<p>Take that same HTML, but use <code>.nav-pills</code> instead:</p>
<div class="bs-docs-example">
<ul class="nav nav-pills">
<li><a href="#">Clickable link</a></li>
<li><a href="#">Clickable link</a></li>
<li class="disabled"><a href="#">Disabled link</a></li>
</ul>
</div>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-pills"&gt;
...
&lt;li class="disabled"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
...
&lt;/ul&gt;
</pre>
<h3>Component alignment</h3>
<p>To align nav links, use the <code>.pull-left</code> or <code>.pull-right</code> utility classes. Both classes will add a CSS float in the specified direction.</p>
<hr class="bs-docs-separator">
<h2>Stackable</h2>
<p>As tabs and pills are horizontal by default, just add a second class, <code>.nav-stacked</code>, to make them appear vertically stacked.</p>
<h3>Stacked tabs</h3>
<div class="bs-docs-example">
<ul class="nav nav-tabs nav-stacked">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Profile</a></li>
<li><a href="#">Messages</a></li>
</ul>
</div>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-tabs nav-stacked"&gt;
...
&lt;ul class="nav nav-pills"&gt;
&lt;li class="active"&gt;
&lt;a href="#"&gt;Home&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;...&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;...&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<h3>Stacked pills</h3>
<p>Pills are also vertically stackable. Just add <code>.nav-stacked</code>.</p>
<div class="bs-docs-example">
<ul class="nav nav-pills nav-stacked">
<ul class="nav nav-pills nav-stacked" style="max-width: 300px;">
<li class="active"><a href="#">Home</a></li>
<li><a href="#">Profile</a></li>
<li><a href="#">Messages</a></li>
......@@ -771,16 +747,28 @@
&lt;/ul&gt;
</pre>
<h3>Horizontal dividers</h3>
<p>Add a horizontal divider by creating an empty list item with the class <code>.divider</code>, like so:</p>
<h2>Options</h2>
<h3>Disabled state</h3>
<p>For any nav component (tabs, pills, or list), add <code>.disabled</code> for <strong>gray links and no hover effects</strong>. Links will remain clickable, however, unless you remove the <code>href</code> attribute. Alternatively, you could implement custom JavaScript to prevent those clicks.</p>
<div class="bs-docs-example">
<ul class="nav nav-pills">
<li><a href="#">Clickable link</a></li>
<li><a href="#">Clickable link</a></li>
<li class="disabled"><a href="#">Disabled link</a></li>
</ul>
</div>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-tabs nav-stacked"&gt;
&lt;ul class="nav nav-pills"&gt;
...
&lt;li class="divider"&gt;&lt;/li&gt;
&lt;li class="disabled"&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt;
...
&lt;/ul&gt;
</pre>
<h3>Component alignment</h3>
<p>To align nav links, use the <code>.pull-left</code> or <code>.pull-right</code> utility classes. Both classes will add a CSS float in the specified direction.</p>
<hr class="bs-docs-separator">
......
......@@ -599,18 +599,17 @@
<!-- Nav, Tabs, & Pills
<!-- Navs
================================================== -->
<section id="navs">
<div class="page-header">
<h1>{{_i}}Nav: tabs, pills, and lists{{/i}}</small></h1>
<h1>{{_i}}Navs{{/i}}</small></h1>
</div>
<h2>{{_i}}Lightweight defaults{{/i}} <small>{{_i}}Same markup, different classes{{/i}}</small></h2>
<p>{{_i}}All nav components here&mdash;tabs, pills, and lists&mdash;<strong>share the same base markup and styles</strong> through the <code>.nav</code> class.{{/i}}</p>
<p class="lead">{{_i}}Navs available in Bootstrap have shared markup, starting with the base <code>.nav</code> class, as well as shared states. Swap modifier classes to switch between each style.{{/i}}</p>
<h3>{{_i}}Basic tabs{{/i}}</h3>
<p>{{_i}}Take a regular <code>&lt;ul&gt;</code> of links and add <code>.nav-tabs</code>:{{/i}}</p>
<h2>{{_i}}Tabs{{/i}}</h2>
<p>{{_i}}Note the <code>.nav-tabs</code> class requires the <code>.nav</code> base class.{{/i}}</p>
<div class="bs-docs-example">
<ul class="nav nav-tabs">
<li class="active"><a href="#">{{_i}}Home{{/i}}</a></li>
......@@ -628,17 +627,17 @@
&lt;/ul&gt;
</pre>
<h3>{{_i}}Basic pills{{/i}}</h3>
<p>{{_i}}Take that same HTML, but use <code>.nav-pills</code> instead:{{/i}}</p>
<h2>{{_i}}List{{/i}}</h2>
<p>{{_i}}Swap the tabs class for <code>.nav-list</code>.{{/i}}</p>
<div class="bs-docs-example">
<ul class="nav nav-pills">
<ul class="nav nav-list" style="max-width: 300px;">
<li class="active"><a href="#">{{_i}}Home{{/i}}</a></li>
<li><a href="#">{{_i}}Profile{{/i}}</a></li>
<li><a href="#">{{_i}}Messages{{/i}}</a></li>
</ul>
</div>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-pills"&gt;
&lt;ul class="nav nav-list"&gt;
&lt;li class="active"&gt;
&lt;a href="#"&gt;{{_i}}Home{{/i}}&lt;/a&gt;
&lt;/li&gt;
......@@ -647,50 +646,27 @@
&lt;/ul&gt;
</pre>
<h3>{{_i}}Disabled state{{/i}}</h3>
<p>{{_i}}For any nav component (tabs, pills, or list), add <code>.disabled</code> for <strong>gray links and no hover effects</strong>. Links will remain clickable, however, unless you remove the <code>href</code> attribute. Alternatively, you could implement custom JavaScript to prevent those clicks.{{/i}}</p>
<h2>{{_i}}Pills{{/i}}</h2>
<p>{{_i}}Take that same HTML, but use <code>.nav-pills</code> instead:{{/i}}</p>
<div class="bs-docs-example">
<ul class="nav nav-pills">
<li><a href="#">{{_i}}Clickable link{{/i}}</a></li>
<li><a href="#">{{_i}}Clickable link{{/i}}</a></li>
<li class="disabled"><a href="#">{{_i}}Disabled link{{/i}}</a></li>
</ul>
</div>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-pills"&gt;
...
&lt;li class="disabled"&gt;&lt;a href="#"&gt;{{_i}}Home{{/i}}&lt;/a&gt;&lt;/li&gt;
...
&lt;/ul&gt;
</pre>
<h3>{{_i}}Component alignment{{/i}}</h3>
<p>{{_i}}To align nav links, use the <code>.pull-left</code> or <code>.pull-right</code> utility classes. Both classes will add a CSS float in the specified direction.{{/i}}</p>
<hr class="bs-docs-separator">
<h2>{{_i}}Stackable{{/i}}</h2>
<p>{{_i}}As tabs and pills are horizontal by default, just add a second class, <code>.nav-stacked</code>, to make them appear vertically stacked.{{/i}}</p>
<h3>{{_i}}Stacked tabs{{/i}}</h3>
<div class="bs-docs-example">
<ul class="nav nav-tabs nav-stacked">
<li class="active"><a href="#">{{_i}}Home{{/i}}</a></li>
<li><a href="#">{{_i}}Profile{{/i}}</a></li>
<li><a href="#">{{_i}}Messages{{/i}}</a></li>
</ul>
</div>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-tabs nav-stacked"&gt;
...
&lt;ul class="nav nav-pills"&gt;
&lt;li class="active"&gt;
&lt;a href="#"&gt;{{_i}}Home{{/i}}&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;...&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="#"&gt;...&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</pre>
<h3>{{_i}}Stacked pills{{/i}}</h3>
<p>{{_i}}Pills are also vertically stackable. Just add <code>.nav-stacked</code>.{{/i}}</p>
<div class="bs-docs-example">
<ul class="nav nav-pills nav-stacked">
<ul class="nav nav-pills nav-stacked" style="max-width: 300px;">
<li class="active"><a href="#">{{_i}}Home{{/i}}</a></li>
<li><a href="#">{{_i}}Profile{{/i}}</a></li>
<li><a href="#">{{_i}}Messages{{/i}}</a></li>
......@@ -702,16 +678,28 @@
&lt;/ul&gt;
</pre>
<h3>{{_i}}Horizontal dividers{{/i}}</h3>
<p>{{_i}}Add a horizontal divider by creating an empty list item with the class <code>.divider</code>, like so:{{/i}}</p>
<h2>{{_i}}Options{{/i}}</h2>
<h3>{{_i}}Disabled state{{/i}}</h3>
<p>{{_i}}For any nav component (tabs, pills, or list), add <code>.disabled</code> for <strong>gray links and no hover effects</strong>. Links will remain clickable, however, unless you remove the <code>href</code> attribute. Alternatively, you could implement custom JavaScript to prevent those clicks.{{/i}}</p>
<div class="bs-docs-example">
<ul class="nav nav-pills">
<li><a href="#">{{_i}}Clickable link{{/i}}</a></li>
<li><a href="#">{{_i}}Clickable link{{/i}}</a></li>
<li class="disabled"><a href="#">{{_i}}Disabled link{{/i}}</a></li>
</ul>
</div>
<pre class="prettyprint linenums">
&lt;ul class="nav nav-tabs nav-stacked"&gt;
&lt;ul class="nav nav-pills"&gt;
...
&lt;li class="divider"&gt;&lt;/li&gt;
&lt;li class="disabled"&gt;&lt;a href="#"&gt;{{_i}}Home{{/i}}&lt;/a&gt;&lt;/li&gt;
...
&lt;/ul&gt;
</pre>
<h3>{{_i}}Component alignment{{/i}}</h3>
<p>{{_i}}To align nav links, use the <code>.pull-left</code> or <code>.pull-right</code> utility classes. Both classes will add a CSS float in the specified direction.{{/i}}</p>
<hr class="bs-docs-separator">
......
......@@ -3,18 +3,21 @@
// --------------------------------------------------
// BASE CLASS
// ----------
// Base class
// -------------------------
.nav {
margin-left: 0;
margin-bottom: @baseLineHeight;
list-style: none;
.clearfix();
}
.nav > li {
float: left;
}
// Make links block level
.nav > li > a {
display: block;
padding: 8px 12px;
}
.nav > li > a:hover {
text-decoration: none;
......@@ -49,28 +52,8 @@
// TABS AND PILLS
// -------------
// Common styles
.nav-tabs,
.nav-pills {
.clearfix();
}
.nav-tabs > li,
.nav-pills > li {
float: left;
}
.nav-tabs > li > a,
.nav-pills > li > a {
padding-right: 12px;
padding-left: 12px;
margin-right: 2px;
line-height: 14px; // keeps the overall height an even number
}
// TABS
// ----
// Tabs
// -------------------------
// Give the tabs something to sit on
.nav-tabs {
......@@ -82,8 +65,7 @@
}
// Actual tabs (as links)
.nav-tabs > li > a {
padding-top: 8px;
padding-bottom: 8px;
margin-right: 2px;
line-height: @baseLineHeight;
border: 1px solid transparent;
border-radius: 4px 4px 0 0;
......@@ -102,17 +84,55 @@
}
// PILLS
// -----
// Lists
// -------------------------
.nav-list {
background-color: #fff;
border-radius: 6px;
.box-shadow(0 1px 4px rgba(0,0,0,.065))
}
.nav-list > li {
float: none;
}
.nav-list > li > a {
margin-bottom: -1px; // pull up the following link for a 1px border between
border: 1px solid #e5e5e5;
}
.nav-list > li > a:hover {
background-color: #f5f5f5;
}
.nav-list > li:first-child > a {
border-radius: 6px 6px 0 0;
}
.nav-list > li:last-child > a {
border-radius: 0 0 6px 6px;
}
.nav-list > .active > a,
.nav-list > .active > a:hover {
position: relative;
z-index: 2;
padding: 9px 15px;
color: #fff;
text-shadow: 0 1px 0 rgba(0,0,0,.15);
background-color: @linkColor;
border-width: 0;
.box-shadow(~"inset 1px 0 0 rgba(0,0,0,.1), inset -1px 0 0 rgba(0,0,0,.1)")
}
// Pills
// -------------------------
// Links rendered as pills
.nav-pills > li > a {
padding-top: 8px;
padding-bottom: 8px;
margin-top: 2px;
margin-bottom: 2px;
border-radius: 5px;
}
.nav-pills > li + li > a {
margin-left: 2px;
}
// Active state
.nav-pills > .active > a,
......@@ -121,56 +141,23 @@
background-color: @linkColor;
}
// STACKED NAV
// -----------
// Stacked tabs and pills
// Stacked pills
.nav-stacked > li {
float: none;
}
.nav-stacked > li > a {
margin-right: 0; // no need for the gap between nav items
}
// Tabs
.nav-tabs.nav-stacked {
border-bottom: 0;
}
.nav-tabs.nav-stacked > li > a {
border: 1px solid #ddd;
border-radius: 0;
}
.nav-tabs.nav-stacked > li:first-child > a {
.border-top-radius(4px);
}
.nav-tabs.nav-stacked > li:last-child > a {
.border-bottom-radius(4px);
}
.nav-tabs.nav-stacked > li > a:hover {
border-color: #ddd;
z-index: 2;
}
// Pills
.nav-pills.nav-stacked > li > a {
margin-bottom: 3px;
}
.nav-pills.nav-stacked > li:last-child > a {
margin-bottom: 1px; // decrease margin to match sizing of stacked tabs
.nav-stacked > li + li > a {
margin-top: 2px;
margin-left: 0; // no need for the gap between nav items
}
// DROPDOWNS
// ---------
// Dropdowns
// -------------------------
.nav-tabs .dropdown-menu {
border-radius: 0 0 6px 6px; // remove the top rounded corners here since there is a hard edge above the menu
}
.nav-pills .dropdown-menu {
border-radius: 6px; // make rounded corners match the pills
// Remove the top rounded corners here since there is a hard edge above the menu
.border-top-radius(0);
}
// Default dropdown links
......@@ -179,16 +166,12 @@
.nav .dropdown-toggle .caret {
border-top-color: @linkColor;
border-bottom-color: @linkColor;
margin-top: 6px;
margin-top: 8px;
}
.nav .dropdown-toggle:hover .caret {
border-top-color: @linkColorHover;
border-bottom-color: @linkColorHover;
}
/* move down carets for tabs */
.nav-tabs .dropdown-toggle .caret {
margin-top: 8px;
}
// Active dropdown links
// -------------------------
......@@ -231,12 +214,8 @@
// TABBABLE
// --------
// COMMON STYLES
// -------------
// Tabbable tabs
// -------------------------
// Clear any floats
.tabbable {
......@@ -258,8 +237,8 @@
// DISABLED STATES
// ---------------
// Disabled state
// -------------------------
// Gray out text
.nav > .disabled > a {
......
......@@ -197,7 +197,7 @@
// Inverted navbar
@navbarInverseBackground: #111111;
@navbarInverseBackgroundHighlight: #222222;
@navbarInverseBorder: #252525;
@navbarInverseBorder: #111111;
@navbarInverseText: @grayLight;
@navbarInverseLinkColor: @grayLight;
......
Supports Markdown
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