Commit 6af693d1 authored by Mark Otto's avatar Mark Otto

Fixes #8770: mobile-first (stacked by default) horizontal dls

parent 41eef69e
...@@ -807,7 +807,7 @@ base_url: "../" ...@@ -807,7 +807,7 @@ base_url: "../"
{% endhighlight %} {% endhighlight %}
<h4>Horizontal description</h4> <h4>Horizontal description</h4>
<p>Make terms and descriptions in <code>&lt;dl&gt;</code> line up side-by-side.</p> <p>Make terms and descriptions in <code>&lt;dl&gt;</code> line up side-by-side. Starts off stacked like default <code>&lt;dl&gt;</code>s, but when the navbar expands, so do these.</p>
<div class="bs-example"> <div class="bs-example">
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Description lists</dt> <dt>Description lists</dt>
......
...@@ -564,7 +564,8 @@ dd { ...@@ -564,7 +564,8 @@ dd {
margin-left: 0; margin-left: 0;
} }
.dl-horizontal dt { @media (min-width: 768px) {
.dl-horizontal dt {
float: left; float: left;
width: 160px; width: 160px;
overflow: hidden; overflow: hidden;
...@@ -572,30 +573,26 @@ dd { ...@@ -572,30 +573,26 @@ dd {
text-align: right; text-align: right;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.dl-horizontal dd {
.dl-horizontal dd {
margin-left: 180px; margin-left: 180px;
} }
.dl-horizontal dd:before,
.dl-horizontal dd:before, .dl-horizontal dd:after {
.dl-horizontal dd:after {
display: table; display: table;
content: " "; content: " ";
} }
.dl-horizontal dd:after {
.dl-horizontal dd:after {
clear: both; clear: both;
} }
.dl-horizontal dd:before,
.dl-horizontal dd:before, .dl-horizontal dd:after {
.dl-horizontal dd:after {
display: table; display: table;
content: " "; content: " ";
} }
.dl-horizontal dd:after {
.dl-horizontal dd:after {
clear: both; clear: both;
}
} }
abbr[title], abbr[title],
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -141,8 +141,14 @@ dt { ...@@ -141,8 +141,14 @@ dt {
dd { dd {
margin-left: 0; // Undo browser default margin-left: 0; // Undo browser default
} }
// Horizontal layout (like forms)
.dl-horizontal { // Horizontal description lists
//
// Defaults to being stacked without any of the below styles applied, until the
// grid breakpoint is reached (default of ~768px).
@media (min-width: @grid-float-breakpoint) {
.dl-horizontal {
dt { dt {
float: left; float: left;
width: (@component-offset-horizontal - 20); width: (@component-offset-horizontal - 20);
...@@ -151,8 +157,9 @@ dd { ...@@ -151,8 +157,9 @@ dd {
.text-overflow(); .text-overflow();
} }
dd { dd {
.clearfix(); // Clear the floated `dt` if an empty `dd` is present
margin-left: @component-offset-horizontal; margin-left: @component-offset-horizontal;
.clearfix(); // Clear the floated `dt` if an empty `dd` is present
}
} }
} }
......
Markdown is supported
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