aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2017-01-03 19:24:24 -0800
committerMark Otto <[email protected]>2017-01-03 19:24:24 -0800
commitf3d0fee91ec30aa6cde08de821b06fd6f337a3a3 (patch)
treee7dcdc38b576cb1c8f24f6c85953cd2a7f83038c
parent8b5c5408bb1a00993809a3f6c2b8e5a97433a55d (diff)
downloadbootstrap-f3d0fee91ec30aa6cde08de821b06fd6f337a3a3.tar.xz
bootstrap-f3d0fee91ec30aa6cde08de821b06fd6f337a3a3.zip
fixes #21454 by revamping some docs styles for dropdowns
-rw-r--r--docs/assets/scss/_component-examples.scss11
-rw-r--r--docs/components/dropdowns.md60
2 files changed, 29 insertions, 42 deletions
diff --git a/docs/assets/scss/_component-examples.scss b/docs/assets/scss/_component-examples.scss
index 908e30c49..cea237de0 100644
--- a/docs/assets/scss/_component-examples.scss
+++ b/docs/assets/scss/_component-examples.scss
@@ -251,17 +251,6 @@
}
}
-// Example dropdowns
-.bd-example > .dropdown > .dropdown-toggle {
- float: left;
-}
-.bd-example > .dropdown > .dropdown-menu {
- position: static;
- display: block;
- margin-bottom: .25rem;
- clear: left;
-}
-
// Example tabbable tabs
.bd-example-tabs .nav-tabs {
margin-bottom: 1rem;
diff --git a/docs/components/dropdowns.md b/docs/components/dropdowns.md
index d26de6eef..3c68f9453 100644
--- a/docs/components/dropdowns.md
+++ b/docs/components/dropdowns.md
@@ -21,7 +21,7 @@ Wrap the dropdown's toggle (your button or link) and the dropdown menu within `.
Any single `.btn` can be turned into a dropdown toggle with some markup changes. Here's how you can put them to work with either `<button>` elements:
{% example html %}
-<div class="dropdown show">
+<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown button
</button>
@@ -252,7 +252,7 @@ Button dropdowns work with buttons of all sizes, including default and split dro
<a class="dropdown-item" href="#">Separated link</a>
</div>
</div><!-- /btn-group -->
- <div class="btn-group">
+ <div class="btn-group ml-2">
<button type="button" class="btn btn-lg btn-secondary">Large split button</button>
<button type="button" class="btn btn-lg btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
@@ -279,7 +279,7 @@ Button dropdowns work with buttons of all sizes, including default and split dro
<a class="dropdown-item" href="#">Separated link</a>
</div>
</div><!-- /btn-group -->
- <div class="btn-group">
+ <div class="btn-group ml-2">
<button type="button" class="btn btn-sm btn-secondary">Small split button</button>
<button type="button" class="btn btn-sm btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
@@ -344,34 +344,32 @@ Button dropdowns work with buttons of all sizes, including default and split dro
Trigger dropdown menus above elements by adding `.dropup` to the parent element.
<div class="bd-example">
- <div class="btn-toolbar" role="toolbar">
- <div class="btn-group dropup">
- <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Dropup
- </button>
- <div class="dropdown-menu">
- <a class="dropdown-item" href="#">Action</a>
- <a class="dropdown-item" href="#">Another action</a>
- <a class="dropdown-item" href="#">Something else here</a>
- <div class="dropdown-divider"></div>
- <a class="dropdown-item" href="#">Separated link</a>
- </div>
+ <div class="btn-group dropup">
+ <button type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ Dropup
+ </button>
+ <div class="dropdown-menu">
+ <a class="dropdown-item" href="#">Action</a>
+ <a class="dropdown-item" href="#">Another action</a>
+ <a class="dropdown-item" href="#">Something else here</a>
+ <div class="dropdown-divider"></div>
+ <a class="dropdown-item" href="#">Separated link</a>
</div>
+ </div>
- <div class="btn-group dropup">
- <button type="button" class="btn btn-secondary">
- Split dropup
- </button>
- <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- <span class="sr-only">Toggle Dropdown</span>
- </button>
- <div class="dropdown-menu">
- <a class="dropdown-item" href="#">Action</a>
- <a class="dropdown-item" href="#">Another action</a>
- <a class="dropdown-item" href="#">Something else here</a>
- <div class="dropdown-divider"></div>
- <a class="dropdown-item" href="#">Separated link</a>
- </div>
+ <div class="btn-group dropup">
+ <button type="button" class="btn btn-secondary">
+ Split dropup
+ </button>
+ <button type="button" class="btn btn-secondary dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ <span class="sr-only">Toggle Dropdown</span>
+ </button>
+ <div class="dropdown-menu">
+ <a class="dropdown-item" href="#">Action</a>
+ <a class="dropdown-item" href="#">Another action</a>
+ <a class="dropdown-item" href="#">Something else here</a>
+ <div class="dropdown-divider"></div>
+ <a class="dropdown-item" href="#">Separated link</a>
</div>
</div>
</div>
@@ -407,7 +405,7 @@ Trigger dropdown menus above elements by adding `.dropup` to the parent element.
Historically dropdown menu contents *had* to be links, but that's no longer the case with v4. Now you can optionally use `<button>` elements in your dropdowns instead of just `<a>`s.
{% example html %}
-<div class="dropdown show">
+<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</button>
@@ -510,7 +508,7 @@ $('.dropdown-toggle').dropdown()
{% endhighlight %}
{% callout info %}
-#### `data-toggle="dropdown"` still required
+##### `data-toggle="dropdown"` still required
Regardless of whether you call your dropdown via JavaScript or instead use the data-api, `data-toggle="dropdown"` is always required to be present on the dropdown's trigger element.
{% endcallout %}