Center block disabled by default

This commit is contained in:
Angelos Chalaris 2017-01-31 10:31:04 +02:00
parent 1f03644282
commit dd8f436d64
7 changed files with 39 additions and 87 deletions

View file

@ -1720,11 +1720,6 @@ ul.breadcrumbs {
-webkit-transform: rotateZ(-45deg);
transform: rotateZ(-45deg); }
.center-block {
display: block !important;
margin-left: auto !important;
margin-right: auto !important; }
/*
Custom elements for utilities and helper classes.
*/

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
<html>
<head>
<link rel="stylesheet" href="https://cdn.rawgit.com/Chalarangelo/mini.css/v2.0.2/dist/mini-default.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<title>mini.css - Quick Reference</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -14,7 +14,7 @@
<meta property="og:description" content="mini.css is a tiny CSS toolkit designed to build quick, modern and responsive websites."/>
<meta property="og:image" content="page_thumb.PNG">
<meta property="og:url" content="https://chalarangelo.github.io/mini.css/">
<link rel="icon" type="image/png" href="favicon.png">
<link rel="icon" type="image/png" href="favicon.png">
<style>
/* Classes and ids used in multiple pages - page top and utilities */
#header-logo {
@ -36,7 +36,7 @@
.box-colored.red { background: #e53935; }
.box-centered > .card.fluid {
-webkit-box-pack: start;
-webkit-box-align: start;
-webkit-box-align: start;
-webkit-justify-content: flex-start;
justify-content: flex-start;
-webkit-align-self: auto;
@ -69,7 +69,7 @@
}
</style>
</head>
<body>
<body>
<header>
<a href="index.html"><img class="logo" src="mini-logo.svg" id="header-logo"></a><div style="display: inline; overflow: auto;">
<a href="index.html" class="button">Introduction</a>
@ -239,7 +239,7 @@
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-sm-12&quot;&gt;
&lt;div class=&quot;col-sm-12&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-sm&quot;&gt;
@ -260,7 +260,7 @@
<li>Multiple <code>.col-<span class="fore-primary">SCR_SZ</span></code> and/or <code>.col-<span class="fore-primary">SCR_SZ</span>-<span class="fore-secondary">COL_WD</span></code> elements specify serve as the grid system's columns (fluid and preset respectively)</li>
</ol>
</li>
<li><code><span class="fore-primary">SCR_SZ</span></code> values:
<li><code><span class="fore-primary">SCR_SZ</span></code> values:
<ul>
<li><code><span class="fore-tertiary">sm</span></code> for screens below <code>768px</code> wide</li>
<li><code><span class="fore-tertiary">md</span></code> for screens between <code>768px</code>(inclusive) and <code>1280px</code>(exclusive)</li>
@ -331,11 +331,11 @@
&lt;div class=&quot;col-sm-8 col-sm-offset-4&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;row&quot;&gt;
&lt;div class=&quot;col-sm-5 col-sm-offset-1&quot;&gt;
&lt;div class=&quot;col-sm-5 col-sm-offset-1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;col-sm-5 col-sm-offset-1&quot;&gt;
&lt;div class=&quot;col-sm-5 col-sm-offset-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</pre>
</div>
<div class="col-sm-12 col-md-6">
@ -420,7 +420,7 @@
&lt;span class=&quot;sublink-1&quot;&gt;Events&lt;/span&gt;
&lt;a href=&quot;#&quot; class=&quot;sublink-2&quot;&gt;Course Showcase - 12th, Dec&lt;/a&gt;
&lt;a href=&quot;#&quot; class=&quot;sublink-2&quot;&gt;Staff AMA - 16th, Dec&lt;/a&gt;
&lt;a href=&quot;#&quot; class=&quot;sublink-1&quot;&gt;Policy Update&lt;/a&gt;
&lt;a href=&quot;#&quot; class=&quot;sublink-1&quot;&gt;Policy Update&lt;/a&gt;
&lt;a href=&quot;#&quot;&gt;About&lt;/a&gt;
&lt;a href=&quot;#&quot;&gt;Contact&lt;/a&gt;
&lt;/nav&gt;</pre>
@ -464,11 +464,11 @@
&lt;fieldset&gt;
&lt;legend&gt;Simple form&lt;/legend&gt;
&lt;div class=&quot;input-group&quot;&gt;
&lt;label for=&quot;username&quot;&gt;username&lt;/label&gt;
&lt;label for=&quot;username&quot;&gt;username&lt;/label&gt;
&lt;input type=&quot;email&quot; value=&quot;&quot; id=&quot;username&quot; placeholder=&quot;username&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;input-group&quot;&gt;
&lt;label for=&quot;pwd&quot;&gt;password&lt;/label&gt;
&lt;label for=&quot;pwd&quot;&gt;password&lt;/label&gt;
&lt;input type=&quot;password&quot; value=&quot;&quot; id=&quot;pwd&quot; placeholder=&quot;password&quot;&gt;
&lt;/div&gt;
&lt;/fieldset&gt;
@ -476,7 +476,7 @@
</div>
<div class="col-sm-12 col-md-6">
<h3>Notes</h3>
<ul>
<ul>
<li>Link <code>&lt;label&gt;</code> elements to their respective <code>&lt;input&gt;</code> elements for ease-of-use</li>
<li>Use of the <code>&lt;fieldset&gt;</code> and <code>&lt;legend&gt;</code> elements is highly recommended</li>
<li>Forms are inline by default, use <code>.input-group</code> to align elements inside them</li>
@ -491,12 +491,12 @@
<div class="col-sm-12 col-md-6 col-md-first col-sm-first">
<h3>Checkboxes &amp; radio buttons <a href="https://codepen.io/chalarangelo/pen/yVZPEZ" target="_blank" class="button small"><i class="fa fa-codepen" aria-hidden="true"></i>&nbsp;View on Codepen</a></h3>
<pre>&lt;div class=&quot;input-group&quot;&gt;
&lt;input type=&quot;checkbox&quot; id=&quot;check1&quot; tabindex=&quot;0&quot;&gt;
&lt;input type=&quot;checkbox&quot; id=&quot;check1&quot; tabindex=&quot;0&quot;&gt;
&lt;label for=&quot;check1&quot;&gt;Checkbox&lt;/label&gt;
&lt;/div&gt;
&lt;div class=&quot;input-group&quot;&gt;
&lt;input type=&quot;radio&quot; id=&quot;rad1&quot; tabindex=&quot;0&quot; name=&quot;radio-group-1&quot;&gt;
&lt;input type=&quot;radio&quot; id=&quot;rad1&quot; tabindex=&quot;0&quot; name=&quot;radio-group-1&quot;&gt;
&lt;label for=&quot;rad1&quot;&gt;Radio&lt;/label&gt;
&lt;/div&gt;</pre>
</div>
@ -521,7 +521,7 @@
&lt;input type=&quot;submit&quot; class=&quot;tertiary&quot; value=&quot;Tertiary button&quot;&gt;
&lt;button class=&quot;inverse&quot;&gt;Inverse button&lt;/button&gt;
&lt;button class=&quot;small&quot;&gt;Small button&lt;/button&gt;
&lt;button class=&quot;large&quot;&gt;Large button&lt;/button&gt;
&lt;button class=&quot;large&quot;&gt;Large button&lt;/button&gt;
&lt;button disabled&gt;Disabled button&lt;/button&gt;
&lt;a href=&quot;#&quot; class=&quot;button&quot;&gt;Link button&lt;/a&gt;
&lt;label class=&quot;button&quot;&gt;Label button&lt;/label&gt;
@ -876,7 +876,7 @@
&lt;div&gt;
&lt;h3&gt;Section 1&lt;/h3&gt;
&lt;p&gt;This is the first accordion section's content.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;input type=&quot;radio&quot; name=&quot;accordion&quot; id=&quot;a2&quot;aria-hidden=&quot;true&quot;&gt;
&lt;label for=&quot;a2&quot; aria-hidden=&quot;true&quot;&gt;Accordion section 2&lt;/label&gt;
&lt;div&gt;
@ -1084,25 +1084,6 @@
</ul>
</div>
</div>
<div class="section row">
<div class="col-sm-12 col-md-6 col-md-first col-sm-first">
<h3>Floats, centering &amp; clearfix <a href="https://codepen.io/chalarangelo/pen/pNGGjE" target="_blank" class="button small"><i class="fa fa-codepen" aria-hidden="true"></i>&nbsp;View on Codepen</a></h3>
<pre>&lt;span class=&quot;float-left&quot;&gt;Float left&lt;/span&gt;
&lt;span class=&quot;float-right&quot;&gt;Float right&lt;/span&gt;
&lt;span class=&quot;clearfix&quot;&gt;Clearfix&lt;/span&gt;
&lt;span class=&quot;center-block&quot;&gt;Center block&lt;/span&gt;</pre>
</div>
<div class="col-sm-12 col-md-6">
<h3>Notes</h3>
<ul>
<li>Use <code>.float-left</code> or <code>.float-right</code> for quick floats</li>
<li>Use <code>.center-block</code> for centered blocks</li>
<li>Use <code>.clearfix</code> to clear floats</li>
<li>All classes use <code><span class="fore-secondary">!important</span></code> declarations</li>
<li>Do not combine these classes with each other, except for <code>.clearfix</code></li>
</ul>
</div>
</div>
<div class="section row">
<div class="col-sm-12 col-md-6 col-md-first col-sm-first">
<h3>Generic borders &amp; shadows <a href="https://codepen.io/chalarangelo/pen/aBXXvE" target="_blank" class="button small"><i class="fa fa-codepen" aria-hidden="true"></i>&nbsp;View on Codepen</a></h3>
@ -1184,4 +1165,4 @@
<!-- End of page content-->
<footer><strong>mini.css</strong> was designed and built with <i class="fa fa-heart-o" aria-hidden="true"></i> by <a href="https://github.com/Chalarangelo">@Chalarangelo</a>. It is licensed under the <a href="https://github.com/Chalarangelo/mini.css/blob/master/LICENSE">MIT License</a>. You can view the project's source code on <a href="https://github.com/Chalarangelo/mini.css">Github</a>.</footer>
</body>
</html>
</html>

View file

@ -2,7 +2,7 @@
<html>
<head>
<link rel="stylesheet" href="https://cdn.rawgit.com/Chalarangelo/mini.css/v2.0.2/dist/mini-default.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<title>mini.css - Utility</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -14,7 +14,7 @@
<meta property="og:description" content="mini.css is a tiny CSS toolkit designed to build quick, modern and responsive websites."/>
<meta property="og:image" content="page_thumb.PNG">
<meta property="og:url" content="https://chalarangelo.github.io/mini.css/">
<link rel="icon" type="image/png" href="favicon.png">
<link rel="icon" type="image/png" href="favicon.png">
<style>
/* Classes and ids used in multiple pages - page top and utilities */
#header-logo {
@ -36,7 +36,7 @@
.box-colored.red { background: #b71c1c; }
.box-centered > .card.fluid {
-webkit-box-pack: start;
-webkit-box-align: start;
-webkit-box-align: start;
-webkit-justify-content: flex-start;
justify-content: flex-start;
-webkit-align-self: auto;
@ -71,7 +71,7 @@
}
</style>
</head>
<body>
<body>
<header>
<a href="index.html"><img class="logo" src="mini-logo.svg" id="header-logo"></a><div style="display: inline; overflow: auto;">
<a href="index.html" class="button">Introduction</a>
@ -148,38 +148,6 @@
</div>
</div>
</div>
<div class="row">
<div class="col-sm">
<div class="card fluid">
<div class="section">
<h2>Floats, centering &amp; clearfix</h2>
</div>
<div class="section row">
<div class="col-sm-12 col-sm-first">
<p>You can easily make content float left or right, using the <code>.float-left</code> and <code>.float-right</code> classes. Clear all floats, using the <code>.clearfix</code> class, based on the <a href="http://nicolasgallagher.com/micro-clearfix-hack/">micro clearfix</a> by Nicolas Gallagher. Finally, use the <code>.center-block</code> class to make an element center and display as a block.</p>
<h3>Sample code</h3>
<pre>&lt;span class=&quot;float-left&quot;&gt;Float left&lt;/span&gt;
&lt;span class=&quot;float-right&quot;&gt;Float right&lt;/span&gt;
&lt;span class=&quot;clearfix&quot;&gt;Clearfix&lt;/span&gt;
&lt;span class=&quot;center-block&quot;&gt;Center block&lt;/span&gt;</pre>
</div>
</div>
<div class="section">
<h3>Notes</h3>
<ul>
<li>All of these classes utilize <code><span class="fore-secondary">!important</span></code> declarations, so be careful when and how to use them.</li>
</ul>
<hr>
<div class="row">
<div class="col-sm-12">
<pre>&lt;span class=&quot;float-left float-right&quot;&gt;Avoid this&lt;/span&gt;</pre>
<p class="dont"><mark class="secondary">Don't:</mark>&nbsp;Avoid combining any two of the above classes (except if you use <code>.clearfix</code> to temporarily clear a float or something similar), as they might overwrite each other and cause unexpected behavior.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm">
<div class="card fluid">
@ -372,4 +340,4 @@
<!-- End of page content-->
<footer><strong>mini.css</strong> was designed and built with <i class="fa fa-heart-o" aria-hidden="true"></i> by <a href="https://github.com/Chalarangelo">@Chalarangelo</a>. It is licensed under the <a href="https://github.com/Chalarangelo/mini.css/blob/master/LICENSE">MIT License</a>. You can view the project's source code on <a href="https://github.com/Chalarangelo/mini.css">Github</a>.</footer>
</body>
</html>
</html>

View file

@ -794,3 +794,6 @@
- Added flags for `floats` and `clearfix`, turned both utilites of by default, as they are mostly useless.
- After removing the two components mentioned above, size is now `6.89KB`.
- `center-block` turned off using a flag by default. File size is now `6.87KB`. All legacy utilites have been disabled by default.
- Updated `utility.html` page to reflect the fact that these utilities are no longer present by default.
- Updated `quick_reference.html` to reflect the fact that these utilities are no longer present by default.

View file

@ -572,12 +572,14 @@ $responsive-padding-medium-value: // Padding value for responsive pad
$responsive-padding-large-value:6px 8px; // Padding value for responsive padding on large screens
$include-floats: false; // Should floats be included? (`true`/`false`) [1]
$include-clearfix: false; // Should clearfix be included? (`true`/`false`) [2]
$center-block-name: 'center-block'; // Class name for center block
$include-center-block-name: false; // Should center block be included? (`true`/`false`) [3]
// Notes:
// [1] - If the value of $include-floats is `true`, float classes will be created using the value of $float-prefix to determine the class
// names that will be used.
// [2] - If the value of $include-clearfix is true, a clearfix class will be created using the value of $clearfix-name to determine the
// class name of the clearfix component.
// [3] - If the value of $include-center-block is true, a center block class will be created using the value of $center-block-name to
// determine the class name of the center block class.
// Load modules. If you do not want to use a module, comment out its `@import` statement, along with any mixin `@include`s that are part of
// that module and marked as such below it.
@import '../mini/core';

View file

@ -203,8 +203,9 @@ ul.#{$breadcrumbs-name} {
}
}
}
$include-floats: false !default; // Should floats be included?
$include-clearfix: false !default; // Should clearfix be included?
$include-floats: false !default; // Should floats be included?
$include-clearfix: false !default; // Should clearfix be included?
$include-center-block: false !default; // Should center block be included?
// Floats. ATTENTION: Uses !important.
// NOTE: Might be obsolete and not play well with others.
@if $include-floats {
@ -227,8 +228,10 @@ $include-clearfix: false !default; // Should clearfix be included?
}
}
// Center block. ATTENTION: Uses !important.
.#{$center-block-name} {
display: block !important;
margin-left: auto !important;
margin-right: auto !important;
@if $include-center-block {
.#{$center-block-name} {
display: block !important;
margin-left: auto !important;
margin-right: auto !important;
}
}