diff --git a/docs/assets/css/bootstrap.css b/docs/assets/css/bootstrap.css index 0f936bae31..e3460137e6 100644 --- a/docs/assets/css/bootstrap.css +++ b/docs/assets/css/bootstrap.css @@ -3579,6 +3579,40 @@ input[type="button"].btn-block { border-bottom-color: transparent; } +.nav-pills > li > a { + border-radius: 5px; +} + +.nav-pills > li + li > a { + margin-left: 2px; +} + +.nav-pills > .active > a, +.nav-pills > .active > a:hover { + color: #ffffff; + background-color: #0088cc; +} + +.nav-stacked > li { + float: none; +} + +.nav-stacked > li + li > a { + margin-top: 2px; + margin-left: 0; +} + +.nav-justified { + max-height: 37px; +} + +.nav-justified > li { + display: table-cell; + float: none; + width: 1%; + text-align: center; +} + .nav-list { background-color: #fff; border-radius: 6px; @@ -3620,29 +3654,6 @@ input[type="button"].btn-block { box-shadow: inset 1px 0 0 rgba(0, 0, 0, 0.1), inset -1px 0 0 rgba(0, 0, 0, 0.1); } -.nav-pills > li > a { - border-radius: 5px; -} - -.nav-pills > li + li > a { - margin-left: 2px; -} - -.nav-pills > .active > a, -.nav-pills > .active > a:hover { - color: #ffffff; - background-color: #0088cc; -} - -.nav-stacked > li { - float: none; -} - -.nav-stacked > li + li > a { - margin-top: 2px; - margin-left: 0; -} - .nav-tabs .dropdown-menu { -webkit-border-top-right-radius: 0; border-top-right-radius: 0; diff --git a/docs/components.html b/docs/components.html index 3c47835c3d..14e9041f3b 100644 --- a/docs/components.html +++ b/docs/components.html @@ -748,6 +748,31 @@

Options

+

Justified links

+

Easily make tabs or pills equal widths of their parent with .nav-justified.

+
+ +
+ +
+
+<ul class="nav nav-tabs nav-justified">
+  ...
+</ul>
+
+<ul class="nav nav-pills nav-justified">
+  ...
+</ul>
+
+

Disabled state

For any nav component (tabs, pills, or list), add .disabled for gray links and no hover effects. Links will remain clickable, however, unless you remove the href attribute. Alternatively, you could implement custom JavaScript to prevent those clicks.

diff --git a/docs/templates/pages/components.mustache b/docs/templates/pages/components.mustache index b72cd01eda..9e796b9ba2 100644 --- a/docs/templates/pages/components.mustache +++ b/docs/templates/pages/components.mustache @@ -680,6 +680,31 @@

{{_i}}Options{{/i}}

+

{{_i}}Justified links{{/i}}

+

{{_i}}Easily make tabs or pills equal widths of their parent with .nav-justified.{{/i}}

+
+ +
+ +
+
+<ul class="nav nav-tabs nav-justified">
+  ...
+</ul>
+
+<ul class="nav nav-pills nav-justified">
+  ...
+</ul>
+
+

{{_i}}Disabled state{{/i}}

{{_i}}For any nav component (tabs, pills, or list), add .disabled for gray links and no hover effects. Links will remain clickable, however, unless you remove the href attribute. Alternatively, you could implement custom JavaScript to prevent those clicks.{{/i}}

diff --git a/less/navs.less b/less/navs.less index 5ca43f9e0d..bfdec50ed5 100644 --- a/less/navs.less +++ b/less/navs.less @@ -85,6 +85,51 @@ +// Pills +// ------------------------- + +// Links rendered as pills +.nav-pills > li > a { + border-radius: 5px; +} +.nav-pills > li + li > a { + margin-left: 2px; +} + +// Active state +.nav-pills > .active > a, +.nav-pills > .active > a:hover { + color: @white; + background-color: @linkColor; +} + +// Stacked pills +.nav-stacked > li { + float: none; +} +.nav-stacked > li + li > a { + margin-top: 2px; + margin-left: 0; // no need for the gap between nav items +} + + + +// Justified navs +// ------------------------- + +.nav-justified { + // Negative margin doesn't work, so we hack it + max-height: 37px; +} +.nav-justified > li { + float: none; + display: table-cell; + width: 1%; + text-align: center; +} + + + // Lists // ------------------------- @@ -123,35 +168,6 @@ -// Pills -// ------------------------- - -// Links rendered as pills -.nav-pills > li > a { - border-radius: 5px; -} -.nav-pills > li + li > a { - margin-left: 2px; -} - -// Active state -.nav-pills > .active > a, -.nav-pills > .active > a:hover { - color: @white; - background-color: @linkColor; -} - -// Stacked pills -.nav-stacked > li { - float: none; -} -.nav-stacked > li + li > a { - margin-top: 2px; - margin-left: 0; // no need for the gap between nav items -} - - - // Dropdowns // -------------------------