Overhaul the responsive utility classes:
1. Rename file from responsive-utility-classes.less to responsive-utilities.less 2. Add additional help text around the documentation for the classes in Scaffolding 3. Remove unnecessary display values on initial classes 4. Drop block values for inherit for better support on inline and table elements 5. Make use of \!important on every class to avoid classes with more specific selectors (e.g., .span* classes for the grid)
This commit is contained in:
parent
d1864b3608
commit
a7b8e52f8e
Binary file not shown.
|
@ -43,49 +43,40 @@
|
|||
visibility: hidden;
|
||||
}
|
||||
.visible-phone {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
.visible-tablet {
|
||||
display: none;
|
||||
}
|
||||
.visible-desktop {
|
||||
display: block;
|
||||
}
|
||||
.hidden-phone {
|
||||
display: block;
|
||||
}
|
||||
.hidden-tablet {
|
||||
display: block;
|
||||
display: none !important;
|
||||
}
|
||||
.hidden-desktop {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.visible-phone {
|
||||
display: block;
|
||||
display: inherit !important;
|
||||
}
|
||||
.hidden-phone {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
.hidden-desktop {
|
||||
display: block;
|
||||
display: inherit !important;
|
||||
}
|
||||
.visible-desktop {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px) and (max-width: 979px) {
|
||||
.visible-tablet {
|
||||
display: block;
|
||||
display: inherit !important;
|
||||
}
|
||||
.hidden-tablet {
|
||||
display: none;
|
||||
display: none !important;
|
||||
}
|
||||
.hidden-desktop {
|
||||
display: block;
|
||||
display: inherit !important;
|
||||
}
|
||||
.visible-desktop {
|
||||
display: none;
|
||||
display: none !important ;
|
||||
}
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
<label class="checkbox"><input checked="checked" type="checkbox" value="utilities.less"> Utilities</label>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="component-animations.less"> Component animations</label>
|
||||
<h3>Responsive</h3>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="responsive-utility-classes.less"> Visible/hidden classes</label>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="responsive-utilities.less"> Visible/hidden classes</label>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="responsive-767px-max.less"> Narrow tablets and below (<767px)</label>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="responsive-768px-979px.less"> Tablets to desktops (767-979px)</label>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="responsive-1200px-min.less"> Large desktops (>1200px)</label>
|
||||
|
|
|
@ -609,12 +609,14 @@
|
|||
<h3>Test case</h3>
|
||||
<p>Resize your browser or load on different devices to test the above classes.</p>
|
||||
<h4>Visible on...</h4>
|
||||
<p>Green checkmarks indicate that class is visible in your current viewport.</p>
|
||||
<ul class="responsive-utilities-test">
|
||||
<li>Phone<span class="visible-phone">✔ Phone</span></li>
|
||||
<li>Tablet<span class="visible-tablet">✔ Tablet</span></li>
|
||||
<li>Desktop<span class="visible-desktop">✔ Desktop</span></li>
|
||||
</ul>
|
||||
<h4>Hidden on...</h4>
|
||||
<p>Here, green checkmarks indicate that class is hidden in your current viewport.</p>
|
||||
<ul class="responsive-utilities-test hidden-on">
|
||||
<li>Phone<span class="hidden-phone">✔ Phone</span></li>
|
||||
<li>Tablet<span class="hidden-tablet">✔ Tablet</span></li>
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<label class="checkbox"><input checked="checked" type="checkbox" value="utilities.less"> {{_i}}Utilities{{/i}}</label>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="component-animations.less"> {{_i}}Component animations{{/i}}</label>
|
||||
<h3>{{_i}}Responsive{{/i}}</h3>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="responsive-utility-classes.less"> {{_i}}Visible/hidden classes{{/i}}</label>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="responsive-utilities.less"> {{_i}}Visible/hidden classes{{/i}}</label>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="responsive-767px-max.less"> {{_i}}Narrow tablets and below (<767px){{/i}}</label>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="responsive-768px-979px.less"> {{_i}}Tablets to desktops (767-979px){{/i}}</label>
|
||||
<label class="checkbox"><input checked="checked" type="checkbox" value="responsive-1200px-min.less"> {{_i}}Large desktops (>1200px){{/i}}</label>
|
||||
|
|
|
@ -532,16 +532,18 @@
|
|||
<h3>{{_i}}Test case{{/i}}</h3>
|
||||
<p>{{_i}}Resize your browser or load on different devices to test the above classes.{{/i}}</p>
|
||||
<h4>{{_i}}Visible on...{{/i}}</h4>
|
||||
<p>{{_i}}Green checkmarks indicate that class is visible in your current viewport.{{/i}}</p>
|
||||
<ul class="responsive-utilities-test">
|
||||
<li>Phone<span class="visible-phone">✔ Phone</span></li>
|
||||
<li>Tablet<span class="visible-tablet">✔ Tablet</span></li>
|
||||
<li>Desktop<span class="visible-desktop">✔ Desktop</span></li>
|
||||
<li>{{_i}}Phone{{/i}}<span class="visible-phone">✔ {{_i}}Phone{{/i}}</span></li>
|
||||
<li>{{_i}}Tablet{{/i}}<span class="visible-tablet">✔ {{_i}}Tablet{{/i}}</span></li>
|
||||
<li>{{_i}}Desktop{{/i}}<span class="visible-desktop">✔ {{_i}}Desktop{{/i}}</span></li>
|
||||
</ul>
|
||||
<h4>{{_i}}Hidden on...{{/i}}</h4>
|
||||
<p>{{_i}}Here, green checkmarks indicate that class is hidden in your current viewport.{{/i}}</p>
|
||||
<ul class="responsive-utilities-test hidden-on">
|
||||
<li>Phone<span class="hidden-phone">✔ Phone</span></li>
|
||||
<li>Tablet<span class="hidden-tablet">✔ Tablet</span></li>
|
||||
<li>Desktop<span class="hidden-desktop">✔ Desktop</span></li>
|
||||
<li>{{_i}}Phone{{/i}}<span class="hidden-phone">✔ {{_i}}Phone{{/i}}</span></li>
|
||||
<li>{{_i}}Tablet{{/i}}<span class="hidden-tablet">✔ {{_i}}Tablet{{/i}}</span></li>
|
||||
<li>{{_i}}Desktop{{/i}}<span class="hidden-desktop">✔ {{_i}}Desktop{{/i}}</span></li>
|
||||
</ul>
|
||||
</div><!-- /.span -->
|
||||
</div><!-- /.row -->
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
// RESPONSIVE CLASSES
|
||||
// ------------------
|
||||
|
||||
// Hide from screenreaders and browsers
|
||||
// Credit: HTML5 Boilerplate
|
||||
.hidden {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
// Visibility utilities
|
||||
|
||||
// For desktops
|
||||
.visible-phone { display: none !important; }
|
||||
.visible-tablet { display: none !important; }
|
||||
.visible-desktop { } // Don't set initially
|
||||
.hidden-phone { }
|
||||
.hidden-tablet { }
|
||||
.hidden-desktop { display: none !important; }
|
||||
|
||||
// Phones only
|
||||
@media (max-width: 767px) {
|
||||
// Show
|
||||
.visible-phone { display: inherit !important; } // Use inherit to restore previous behavior
|
||||
// Hide
|
||||
.hidden-phone { display: none !important; }
|
||||
// Hide everything else
|
||||
.hidden-desktop { display: inherit !important; }
|
||||
.visible-desktop { display: none !important; }
|
||||
}
|
||||
|
||||
// Tablets & small desktops only
|
||||
@media (min-width: 768px) and (max-width: 979px) {
|
||||
// Show
|
||||
.visible-tablet { display: inherit !important; }
|
||||
// Hide
|
||||
.hidden-tablet { display: none !important; }
|
||||
// Hide everything else
|
||||
.hidden-desktop { display: inherit !important; }
|
||||
.visible-desktop { display: none !important ; }
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
// RESPONSIVE CLASSES
|
||||
// ------------------
|
||||
|
||||
// Hide from screenreaders and browsers
|
||||
// Credit: HTML5 Boilerplate
|
||||
.hidden {
|
||||
display: none;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
// Visibility utilities
|
||||
|
||||
// For desktops
|
||||
.visible-phone { display: none; }
|
||||
.visible-tablet { display: none; }
|
||||
.visible-desktop { display: block; }
|
||||
.hidden-phone { display: block; }
|
||||
.hidden-tablet { display: block; }
|
||||
.hidden-desktop { display: none; }
|
||||
|
||||
// Phones only
|
||||
@media (max-width: 767px) {
|
||||
// Show
|
||||
.visible-phone { display: block; }
|
||||
// Hide
|
||||
.hidden-phone { display: none; }
|
||||
// Hide everything else
|
||||
.hidden-desktop { display: block; }
|
||||
.visible-desktop { display: none; }
|
||||
}
|
||||
|
||||
// Tablets & small desktops only
|
||||
@media (min-width: 768px) and (max-width: 979px) {
|
||||
// Show
|
||||
.visible-tablet { display: block; }
|
||||
// Hide
|
||||
.hidden-tablet { display: none; }
|
||||
// Hide everything else
|
||||
.hidden-desktop { display: block; }
|
||||
.visible-desktop { display: none; }
|
||||
}
|
|
@ -24,7 +24,7 @@
|
|||
// RESPONSIVE CLASSES
|
||||
// ------------------
|
||||
|
||||
@import "responsive-utility-classes.less";
|
||||
@import "responsive-utilities.less";
|
||||
|
||||
|
||||
// MEDIA QUERIES
|
||||
|
|
Loading…
Reference in New Issue