1
0
Fork 0
mirror of https://github.com/twbs/bootstrap.git synced 2022-11-09 12:25:43 -05:00

replace .visible-{size} with .visible-{size}-{display} ; fixes #8869

This commit is contained in:
Chris Rebert 2014-02-13 11:48:23 -08:00
parent 4b622c60c1
commit bdd7651e32
5 changed files with 278 additions and 45 deletions

View file

@ -5678,6 +5678,20 @@ button.close {
.visible-lg {
display: none !important;
}
.visible-xs-block,
.visible-xs-inline,
.visible-xs-inline-block,
.visible-sm-block,
.visible-sm-inline,
.visible-sm-inline-block,
.visible-md-block,
.visible-md-inline,
.visible-md-inline-block,
.visible-lg-block,
.visible-lg-inline,
.visible-lg-inline-block {
display: none !important;
}
@media (max-width: 767px) {
.visible-xs {
display: block !important;
@ -5693,6 +5707,21 @@ button.close {
display: table-cell !important;
}
}
@media (max-width: 767px) {
.visible-xs-block {
display: block !important;
}
}
@media (max-width: 767px) {
.visible-xs-inline {
display: inline !important;
}
}
@media (max-width: 767px) {
.visible-xs-inline-block {
display: inline-block !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm {
display: block !important;
@ -5708,6 +5737,21 @@ button.close {
display: table-cell !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-block {
display: block !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline {
display: inline !important;
}
}
@media (min-width: 768px) and (max-width: 991px) {
.visible-sm-inline-block {
display: inline-block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md {
display: block !important;
@ -5723,6 +5767,21 @@ button.close {
display: table-cell !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-block {
display: block !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline {
display: inline !important;
}
}
@media (min-width: 992px) and (max-width: 1199px) {
.visible-md-inline-block {
display: inline-block !important;
}
}
@media (min-width: 1200px) {
.visible-lg {
display: block !important;
@ -5738,6 +5797,21 @@ button.close {
display: table-cell !important;
}
}
@media (min-width: 1200px) {
.visible-lg-block {
display: block !important;
}
}
@media (min-width: 1200px) {
.visible-lg-inline {
display: inline !important;
}
}
@media (min-width: 1200px) {
.visible-lg-inline-block {
display: inline-block !important;
}
}
@media (max-width: 767px) {
.hidden-xs {
display: none !important;
@ -5776,6 +5850,30 @@ button.close {
display: table-cell !important;
}
}
.visible-print-block {
display: none !important;
}
@media print {
.visible-print-block {
display: block !important;
}
}
.visible-print-inline {
display: none !important;
}
@media print {
.visible-print-inline {
display: inline !important;
}
}
.visible-print-inline-block {
display: none !important;
}
@media print {
.visible-print-inline-block {
display: inline-block !important;
}
}
@media print {
.hidden-print {
display: none !important;

View file

@ -1165,14 +1165,14 @@ h1[id] {
color: #999;
border: 1px solid #ddd;
}
.visible-on .col-xs-6 .visible-xs,
.visible-on .col-xs-6 .visible-sm,
.visible-on .col-xs-6 .visible-md,
.visible-on .col-xs-6 .visible-lg,
.hidden-on .col-xs-6 .visible-xs,
.hidden-on .col-xs-6 .visible-sm,
.hidden-on .col-xs-6 .visible-md,
.hidden-on .col-xs-6 .visible-lg {
.visible-on .col-xs-6 .visible-xs-block,
.visible-on .col-xs-6 .visible-sm-block,
.visible-on .col-xs-6 .visible-md-block,
.visible-on .col-xs-6 .visible-lg-block,
.hidden-on .col-xs-6 .visible-xs-block,
.hidden-on .col-xs-6 .visible-sm-block,
.hidden-on .col-xs-6 .visible-md-block,
.hidden-on .col-xs-6 .visible-lg-block {
color: #468847;
background-color: #dff0d8;
border: 1px solid #d6e9c6;

View file

@ -302,7 +302,7 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
<div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
<div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
<!-- Optional: clear the XS cols if their content doesn't match in height -->
<div class="clearfix visible-xs"></div>
<div class="clearfix visible-xs-block"></div>
<div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
</div>
</div>
@ -315,7 +315,7 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
<div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
<div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
<!-- Optional: clear the XS cols if their content doesn't match in height -->
<div class="clearfix visible-xs"></div>
<div class="clearfix visible-xs-block"></div>
<div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
</div>
{% endhighlight %}
@ -332,7 +332,7 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
<!-- Add the extra clearfix for only the required viewport -->
<div class="clearfix visible-xs"></div>
<div class="clearfix visible-xs-block"></div>
<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
@ -344,7 +344,7 @@ lead: "Global CSS settings, fundamental HTML elements styled and enhanced with e
<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
<!-- Add the extra clearfix for only the required viewport -->
<div class="clearfix visible-xs"></div>
<div class="clearfix visible-xs-block"></div>
<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
<div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
@ -2569,7 +2569,7 @@ For example, <code>&lt;section&gt;</code> should be wrapped as inline.
<h1 id="responsive-utilities" class="page-header">Responsive utilities</h1>
<p class="lead">For faster mobile-friendly development, use these utility classes for showing and hiding content by device via media query. Also included are utility classes for toggling content when printed.</p>
<p>Try to use these on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation. <strong>Responsive utilities are currently only available for block and table toggling.</strong> Use with inline and table elements is currently not supported.</p>
<p>Try to use these on a limited basis and avoid creating entirely different versions of the same site. Instead, use them to complement each device's presentation.</p>
<h2 id="responsive-utilities-classes">Available classes</h2>
@ -2599,28 +2599,28 @@ For example, <code>&lt;section&gt;</code> should be wrapped as inline.
</thead>
<tbody>
<tr>
<th><code>.visible-xs</code></th>
<th><code>.visible-xs-*</code></th>
<td class="is-visible">Visible</td>
<td class="is-hidden">Hidden</td>
<td class="is-hidden">Hidden</td>
<td class="is-hidden">Hidden</td>
</tr>
<tr>
<th><code>.visible-sm</code></th>
<th><code>.visible-sm-*</code></th>
<td class="is-hidden">Hidden</td>
<td class="is-visible">Visible</td>
<td class="is-hidden">Hidden</td>
<td class="is-hidden">Hidden</td>
</tr>
<tr>
<th><code>.visible-md</code></th>
<th><code>.visible-md-*</code></th>
<td class="is-hidden">Hidden</td>
<td class="is-hidden">Hidden</td>
<td class="is-visible">Visible</td>
<td class="is-hidden">Hidden</td>
</tr>
<tr>
<th><code>.visible-lg</code></th>
<th><code>.visible-lg-*</code></th>
<td class="is-hidden">Hidden</td>
<td class="is-hidden">Hidden</td>
<td class="is-hidden">Hidden</td>
@ -2660,6 +2660,33 @@ For example, <code>&lt;section&gt;</code> should be wrapped as inline.
</table>
</div>
<p>The <code>.visible-*-*</code> classes for each breakpoint come in 3 variations, depending on the CSS <code>display</code> property value applied when the element is visible:</p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Group of classes</th>
<th>CSS <code>display</code></th>
</tr>
</thead>
<tbody>
<tr>
<td><code>.visible-*-block</code></td>
<td><code>display: block;</code></td>
</tr>
<tr>
<td><code>.visible-*-inline</code></td>
<td><code>display: inline;</code></td>
</tr>
<tr>
<td><code>.visible-*-inline-block</code></td>
<td><code>display: inline-block;</code></td>
</tr>
</tbody>
</table>
</div>
<p>So, for extra small (<code>xs</code>) screens for example, the available <code>.visible-*-*</code> classes are: <code>.visible-xs-block</code>, <code>.visible-xs-inline</code>, and <code>.visible-xs-inline-block</code>.</p>
<p>The classes <code>.visible-xs</code>, <code>.visible-sm</code>, <code>.visible-md</code>, and <code>.visible-lg</code> also exist, but are <strong>deprecated</strong> as of v3.1.0. They are approximately equivalent to <code>.visible-*-block</code>, except with additional special cases for <code>&lt;table&gt;</code>-related elements.</p>
<h2 id="responsive-utilities-print">Print classes</h2>
<p>Similar to the regular responsive classes, use these for toggling content for print.</p>
@ -2667,14 +2694,18 @@ For example, <code>&lt;section&gt;</code> should be wrapped as inline.
<table class="table table-bordered table-striped responsive-utilities">
<thead>
<tr>
<th>Class</th>
<th>Classes</th>
<th>Browser</th>
<th>Print</th>
</tr>
</thead>
<tbody>
<tr>
<th><code>.visible-print</code></th>
<th>
<code>.visible-print-block</code><br>
<code>.visible-print-inline</code><br>
<code>.visible-print-inline-block</code>
</th>
<td class="is-hidden">Hidden</td>
<td class="is-visible">Visible</td>
</tr>
@ -2686,6 +2717,7 @@ For example, <code>&lt;section&gt;</code> should be wrapped as inline.
</tbody>
</table>
</div>
<p>The class <code>.visible-print</code> also exists but is <strong>deprecated</strong> as of v3.1.0. It is approximately equivalent to <code>.visible-print-block</code>, except with additional special cases for <code>&lt;table&gt;</code>-related elements.</p>
<h2 id="responsive-utilities-tests">Test cases</h2>
@ -2696,48 +2728,48 @@ For example, <code>&lt;section&gt;</code> should be wrapped as inline.
<div class="row responsive-utilities-test visible-on">
<div class="col-xs-6 col-sm-3">
<span class="hidden-xs">Extra small</span>
<span class="visible-xs">&#10004; Visible on x-small</span>
<span class="visible-xs-block">&#10004; Visible on x-small</span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="hidden-sm">Small</span>
<span class="visible-sm">&#10004; Visible on small</span>
<span class="visible-sm-block">&#10004; Visible on small</span>
</div>
<div class="clearfix visible-xs"></div>
<div class="clearfix visible-xs-block"></div>
<div class="col-xs-6 col-sm-3">
<span class="hidden-md">Medium</span>
<span class="visible-md">&#10004; Visible on medium</span>
<span class="visible-md-block">&#10004; Visible on medium</span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="hidden-lg">Large</span>
<span class="visible-lg">&#10004; Visible on large</span>
<span class="visible-lg-block">&#10004; Visible on large</span>
</div>
</div>
<div class="row responsive-utilities-test visible-on">
<div class="col-xs-6 col-sm-6">
<span class="hidden-xs hidden-sm">Extra small and small</span>
<span class="visible-xs visible-sm">&#10004; Visible on x-small and small</span>
<span class="visible-xs-block visible-sm-block">&#10004; Visible on x-small and small</span>
</div>
<div class="col-xs-6 col-sm-6">
<span class="hidden-md hidden-lg">Medium and large</span>
<span class="visible-md visible-lg">&#10004; Visible on medium and large</span>
<span class="visible-md-block visible-lg-block">&#10004; Visible on medium and large</span>
</div>
<div class="clearfix visible-xs"></div>
<div class="clearfix visible-xs-block"></div>
<div class="col-xs-6 col-sm-6">
<span class="hidden-xs hidden-md">Extra small and medium</span>
<span class="visible-xs visible-md">&#10004; Visible on x-small and medium</span>
<span class="visible-xs-block visible-md-block">&#10004; Visible on x-small and medium</span>
</div>
<div class="col-xs-6 col-sm-6">
<span class="hidden-sm hidden-lg">Small and large</span>
<span class="visible-sm visible-lg">&#10004; Visible on small and large</span>
<span class="visible-sm-block visible-lg-block">&#10004; Visible on small and large</span>
</div>
<div class="clearfix visible-xs"></div>
<div class="clearfix visible-xs-block"></div>
<div class="col-xs-6 col-sm-6">
<span class="hidden-xs hidden-lg">Extra small and large</span>
<span class="visible-xs visible-lg">&#10004; Visible on x-small and large</span>
<span class="visible-xs-block visible-lg-block">&#10004; Visible on x-small and large</span>
</div>
<div class="col-xs-6 col-sm-6">
<span class="hidden-sm hidden-md">Small and medium</span>
<span class="visible-sm visible-md">&#10004; Visible on small and medium</span>
<span class="visible-sm-block visible-md-block">&#10004; Visible on small and medium</span>
</div>
</div>
@ -2746,48 +2778,48 @@ For example, <code>&lt;section&gt;</code> should be wrapped as inline.
<div class="row responsive-utilities-test hidden-on">
<div class="col-xs-6 col-sm-3">
<span class="hidden-xs">Extra small</span>
<span class="visible-xs">&#10004; Hidden on x-small</span>
<span class="visible-xs-block">&#10004; Hidden on x-small</span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="hidden-sm">Small</span>
<span class="visible-sm">&#10004; Hidden on small</span>
<span class="visible-sm-block">&#10004; Hidden on small</span>
</div>
<div class="clearfix visible-xs"></div>
<div class="clearfix visible-xs-block"></div>
<div class="col-xs-6 col-sm-3">
<span class="hidden-md">Medium</span>
<span class="visible-md">&#10004; Hidden on medium</span>
<span class="visible-md-block">&#10004; Hidden on medium</span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="hidden-lg">Large</span>
<span class="visible-lg">&#10004; Hidden on large</span>
<span class="visible-lg-block">&#10004; Hidden on large</span>
</div>
</div>
<div class="row responsive-utilities-test hidden-on">
<div class="col-xs-6 col-sm-6">
<span class="hidden-xs hidden-sm">Extra small and small</span>
<span class="visible-xs visible-sm">&#10004; Hidden on x-small and small</span>
<span class="visible-xs-block visible-sm-block">&#10004; Hidden on x-small and small</span>
</div>
<div class="col-xs-6 col-sm-6">
<span class="hidden-md hidden-lg">Medium and large</span>
<span class="visible-md visible-lg">&#10004; Hidden on medium and large</span>
<span class="visible-md-block visible-lg-block">&#10004; Hidden on medium and large</span>
</div>
<div class="clearfix visible-xs"></div>
<div class="clearfix visible-xs-block"></div>
<div class="col-xs-6 col-sm-6">
<span class="hidden-xs hidden-md">Extra small and medium</span>
<span class="visible-xs visible-md">&#10004; Hidden on x-small and medium</span>
<span class="visible-xs-block visible-md-block">&#10004; Hidden on x-small and medium</span>
</div>
<div class="col-xs-6 col-sm-6">
<span class="hidden-sm hidden-lg">Small and large</span>
<span class="visible-sm visible-lg">&#10004; Hidden on small and large</span>
<span class="visible-sm-block visible-lg-block">&#10004; Hidden on small and large</span>
</div>
<div class="clearfix visible-xs"></div>
<div class="clearfix visible-xs-block"></div>
<div class="col-xs-6 col-sm-6">
<span class="hidden-xs hidden-lg">Extra small and large</span>
<span class="visible-xs visible-lg">&#10004; Hidden on x-small and large</span>
<span class="visible-xs-block visible-lg-block">&#10004; Hidden on x-small and large</span>
</div>
<div class="col-xs-6 col-sm-6">
<span class="hidden-sm hidden-md">Small and medium</span>
<span class="visible-sm visible-md">&#10004; Hidden on small and medium</span>
<span class="visible-sm-block visible-md-block">&#10004; Hidden on small and medium</span>
</div>
</div>
</div>

View file

@ -632,6 +632,7 @@
// Responsive utilities
// -------------------------
// More easily include all the states for responsive-utilities.less.
// Note: Deprecated .responsive-visibility() as of v3.2.0
.responsive-visibility() {
display: block !important;
table& { display: table; }
@ -640,6 +641,7 @@
td& { display: table-cell !important; }
}
// Note: Deprecated .responsive-invisibility() as of v3.2.0
.responsive-invisibility() {
display: none !important;
}

View file

@ -23,6 +23,7 @@
// Visibility utilities
// Note: Deprecated .visible-xs, .visible-sm, .visible-md, and .visible-lg as of v3.2.0
.visible-xs,
.visible-sm,
.visible-md,
@ -30,26 +31,104 @@
.responsive-invisibility();
}
.visible-xs-block,
.visible-xs-inline,
.visible-xs-inline-block,
.visible-sm-block,
.visible-sm-inline,
.visible-sm-inline-block,
.visible-md-block,
.visible-md-inline,
.visible-md-inline-block,
.visible-lg-block,
.visible-lg-inline,
.visible-lg-inline-block {
display: none !important;
}
.visible-xs {
@media (max-width: @screen-xs-max) {
.responsive-visibility();
}
}
.visible-xs-block {
@media (max-width: @screen-xs-max) {
display: block !important;
}
}
.visible-xs-inline {
@media (max-width: @screen-xs-max) {
display: inline !important;
}
}
.visible-xs-inline-block {
@media (max-width: @screen-xs-max) {
display: inline-block !important;
}
}
.visible-sm {
@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
.responsive-visibility();
}
}
.visible-sm-block {
@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
display: block !important;
}
}
.visible-sm-inline {
@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
display: inline !important;
}
}
.visible-sm-inline-block {
@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
display: inline-block !important;
}
}
.visible-md {
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
.responsive-visibility();
}
}
.visible-md-block {
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
display: block !important;
}
}
.visible-md-inline {
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
display: inline !important;
}
}
.visible-md-inline-block {
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
display: inline-block !important;
}
}
.visible-lg {
@media (min-width: @screen-lg-min) {
.responsive-visibility();
}
}
.visible-lg-block {
@media (min-width: @screen-lg-min) {
display: block !important;
}
}
.visible-lg-inline {
@media (min-width: @screen-lg-min) {
display: inline !important;
}
}
.visible-lg-inline-block {
@media (min-width: @screen-lg-min) {
display: inline-block !important;
}
}
.hidden-xs {
@media (max-width: @screen-xs-max) {
@ -77,6 +156,7 @@
//
// Media queries are placed on the inside to be mixin-friendly.
// Note: Deprecated .visible-print as of v3.2.0
.visible-print {
.responsive-invisibility();
@ -84,6 +164,27 @@
.responsive-visibility();
}
}
.visible-print-block {
display: none !important;
@media print {
display: block !important;
}
}
.visible-print-inline {
display: none !important;
@media print {
display: inline !important;
}
}
.visible-print-inline-block {
display: none !important;
@media print {
display: inline-block !important;
}
}
.hidden-print {
@media print {