mini.css/docs/customization/grid.html
Angelos Chalaris 74faf3f708 Customization documentation for grid
Fully documented grid module for developers.
2017-04-11 21:37:22 +03:00

186 lines
14 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://cdn.rawgit.com/Chalarangelo/mini.css/v2.1.0/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://fonts.googleapis.com/css?family=Noto+Sans">
<title>mini.css - Grid</title>
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="mini.css - Minimal, responsive, style-agnostic CSS framework">
<meta name="keywords" content="mini, mini.css, CSS, framework, minimal, responsive, style-agnostic, front-end, frontend, Sass, module, grid ">
<meta name="author" content="Angelos Chalaris (chalarangelo)">
<meta property="og:title" content="mini.css - Minimal, responsive, style-agnostic CSS framework">
<meta property="og:description" content="mini.css is a tiny CSS framework designed to build quick, modern and responsive websites."/>
<meta property="og:type" content="website"/><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">
<style>
#header-logo { background: -webkit-linear-gradient(#07020d 20%, #150627 45%, #220a40 70%, #300d5a); background: linear-gradient(#07020d 20%, #150627 45%, #220a40 70%, #300d5a); line-height:1; font-size: 39px; width: 48px; height: 48px; padding: 8px; margin-left: -9px; }
.box-centered { text-align: center; } .box-colored { background: #0277bd; border-radius: 2px; padding: 14px; margin-bottom: 8px; min-height: 14px;} .box-colored.red { background: #e53935; }
.box-centered > .card.fluid {-webkit-box-pack: start; -webkit-box-align: start; -webkit-justify-content: flex-start; justify-content: flex-start; -webkit-align-self: auto; align-self: auto; } [class^='col-'] .card.fluid { margin: 2px 0 20px; }
[class^='fore-'] { font-family: monospace, monospace;} .fore-primary { color: #0d47a1;} .fore-secondary { color: #b71c1c;} .fore-tertiary { color: #1b5e20;}
.col-sm-12.col-sm-last.col-md-4.col-md-normal {box-sizing: border-box;border-right: 1px solid #bdbdbd;}
@media (max-width: 767px){.col-sm-12.col-sm-last.col-md-4.col-md-normal { border: 0; border-top: 1px solid #bdbdbd;} }
.box-colored.green { background: #689f38; } .do {border-top: 15px solid #689f38;padding-top: 10px;} .dont {border-top: 15px solid #e53935;padding-top: 10px;}
.box-colored {color: #f5f5f5; } header.sticky a.button {padding: 4px 6px; font-size: 0.95em;}
.col-sm-12.col-sm-last.col-md-12.col-md-normal {box-sizing: border-box;border-bottom: 1px solid #bdbdbd;margin-bottom: 16px;padding-bottom: 12px;}
@media (max-width: 767px){ .col-sm-12.col-sm-last.col-md-12.col-md-normal { border: 0; border-top: 1px solid #bdbdbd; margin-bottom: 0;}}
td:first-child, td:last-child { font-family: monospace, monospace; }
td:first-child::before, td:last-child::before { font-family: -apple-system, BlinkMacSystemFont,"Segoe UI","Roboto", "Droid Sans","Helvetica Neue", Helvetica, Arial, sans-serif;} sup a { text-decoration: none; padding: 2px;}
</style>
</head>
<body>
<header>
<a href="../index.html" class="logo"><span id="header-logo">m</span></a>
<a href="../index.html" class="button">Introduction</a> <a href="../modules.html" class="button">Modules</a>
<a href="../flavors.html" class="button">Flavors</a> <a href="index.html" class="button">Customization</a>
<a href="../quick_reference.html" class="button">Quick Reference</a>
<a href="https://github.com/Chalarangelo/mini.css" class="button"><i class="fa fa-github" aria-hidden="true" style="font-size: 1.3em; position: relative; bottom: -2px; margin-right: 2px;"></i>&nbsp;Github</a>
</header>
<header class="sticky" style="height:36px;">
<a href="core.html" class="button">Core</a> <a href="grid.html" class="button">Grid</a>
<a href="navigation.html" class="button">Navigation</a> <a href="input_control.html" class="button">Input Control</a>
<a href="table.html" class="button">Table</a> <a href="card.html" class="button">Card</a>
<a href="tab.html" class="button">Tab</a> <a href="contextual.html" class="button">Contextual</a>
<a href="progress.html" class="button">Progress</a> <a href="utility.html" class="button">Utility</a>
</header>
<!-- Insert your page content here-->
<main><div class="container">
<div class="row" style="padding-top: 40px;">
<div class="col-sm col-lg-10 col-lg-offset-1">
<h1>Grid</h1>
<p>The <strong>grid</strong> module provides you with a modern, responsive grid system based on the Flexible Layout Module (commonly known as <em>flexbox</em>). The structure of the grid is simple and logical, allowing you to quickly build your pages from scratch. Setting the layout for a page is easy and will behave the way you want them to on mobile devices and smaller screens.</p>
<p><small>All examples showcased refer to the mini-default flavor, some class names and styles might differ based on the flavor you're using.</small></p>
<ul class="breadcrumbs"><li><a href="../index.html">Home</a></li><li><a href="index.html">Customization</a></li><li>Grid</li></ul>
</div>
</div>
<div class="row">
<div class="col-sm col-lg-10 col-lg-offset-1">
<div class="card fluid">
<div class="section">
<h2>Quick overview</h2>
<p>Easy page layout is one of the main advantages of using a CSS framework over writing your own styles. The <strong>grid</strong> module utilizes the <a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/">Flexbox Layout</a> to provide you with a modern and responsive layout grid system for all your needs. Rules in the <strong>grid</strong> module help you create basic fluid containers for your grid and allow you to design layouts that work well on all screen sizes using a simple row and column structure. The grid system contains definitions for both fluid columns that resize according to their siblings and columns with preset sizes on different screen sizes, as well as rules that allow you to offset or move certain columns to the first or last place on the grid's row on different devices, helping you present the page in a different layout without duplicating any content. All of the rules in the module are built around accessibility, so screen readers can easily read you pages.</p><br>
</div>
<div class="section">
<h2>Quick start</h2>
<p>To customize the <strong>grid</strong> module, duplicate an existing flavor file (we suggest you use the <code>mini-default.scss</code> flavor file) and use this page's variable tables and mixins as a reference to change only the values you need. Remember to compile your flavor file (not the module's partial file) using a Sass preprocessor (we highly recommend using <a href="https://atom.io/packages/sass-autocompile">sass-autocompile</a> if you are working with <a href="https://atom.io/">Atom</a>).</p><br>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-lg-10 col-lg-offset-1">
<div class="card fluid">
<div class="section"><h2>Classes &amp; breakpoints</h2></div>
<div class="section">
<p>The <strong>grid</strong> module's systems are based on custom-named classes for containers, rows and columns, as well as reordering and ofsetting classes, breakpoints and padding.</p><br/>
<table width="100%" class="striped">
<thead>
<tr><th>Variable</th><th>Type</th><th>Description</th><th>Sample value</th></tr>
</thead>
<tbody>
<tr>
<td data-label="Variable">$grid-container-name</td><td data-label="Type">String</td>
<td data-label="Description">The class name for the grid system's container</td><td data-label="Sample value">'container'</td>
</tr>
<tr>
<td data-label="Variable">$grid-container-side-padding</td><td data-label="Type">Padding (single value)</td>
<td data-label="Description">Left and right padding for the grid system's container</td><td data-label="Sample value">10px</td>
</tr>
<tr>
<td data-label="Variable">$grid-container-column-count</td><td data-label="Type">Integer</td>
<td data-label="Description">Number of columns in the grid</td><td data-label="Sample value">12</td>
</tr>
<tr>
<td data-label="Variable">$grid-column-padding</td><td data-label="Type">Padding</td>
<td data-label="Description">Padding for the grid system's columns</td><td data-label="Sample value">0 4px</td>
</tr>
<tr>
<td data-label="Variable">$grid-row-name</td><td data-label="Type">String</td>
<td data-label="Description">The class name for the grid system's rows</td><td data-label="Sample value">'row'</td>
</tr>
<tr>
<td data-label="Variable">$grid-column-prefix</td><td data-label="Type">String</td>
<td data-label="Description">The class prefix for the grid sytem's columns</td><td data-label="Sample value">'col'</td>
</tr>
<tr>
<td data-label="Variable">$use-four-step-grid</td><td data-label="Type">Logical</td>
<td data-label="Description">Toggles the 4-step grid on or off<sup><a href="#grid-note-one">1</a></sup></td><td data-label="Sample value">false</td>
</tr>
<tr>
<td data-label="Variable">$grid-extra-small-prefix</td><td data-label="Type">String</td>
<td data-label="Description">The class prefix for extra small screen columns<sup><a href="#grid-note-one">1</a></sup></td><td data-label="Sample value">'xs'</td>
</tr>
<tr>
<td data-label="Variable">$grid-small-breakpoint</td><td data-label="Type">Breakpoint</td>
<td data-label="Description">The grid system's breakpoint for small screens<sup><a href="#grid-note-one">1</a></sup></td><td data-label="Sample value">480px</td>
</tr>
<tr>
<td data-label="Variable">$grid-small-prefix</td><td data-label="Type">String</td>
<td data-label="Description">The class prefix for small screen columns</td><td data-label="Sample value">'sm'</td>
</tr>
<tr>
<td data-label="Variable">$grid-medium-breakpoint</td><td data-label="Type">Breakpoint</td>
<td data-label="Description">The grid system's breakpoint for medium-sized screens</td><td data-label="Sample value">768px</td>
</tr>
<tr>
<td data-label="Variable">$grid-medium-prefix</td><td data-label="Type">String</td>
<td data-label="Description">The class prefix for medium-sized screen columns</td><td data-label="Sample value">'md'</td>
</tr>
<tr>
<td data-label="Variable">$grid-large-breakpoint</td><td data-label="Type">Breakpoint</td>
<td data-label="Description">The grid system's breakpoint for large screens</td><td data-label="Sample value">1280px</td>
</tr>
<tr>
<td data-label="Variable">$grid-large-prefix</td><td data-label="Type">String</td>
<td data-label="Description">The class prefix for large screen columns</td><td data-label="Sample value">'lg'</td>
</tr>
<tr>
<td data-label="Variable">$include-parent-layout</td><td data-label="Type">Logical</td>
<td data-label="Description">Enables rows defining the column layout of their children<sup><a href="#grid-note-two">2</a></sup></td><td data-label="Sample value">true</td>
</tr>
<tr>
<td data-label="Variable">$grid-rows-parent-layout-prefix</td><td data-label="Type">String</td>
<td data-label="Description">The class prefix for the grid's row parents<sup><a href="#grid-note-two">2</a></sup></td><td data-label="Sample value">'cols'</td>
</tr>
<tr>
<td data-label="Variable">$grid-column-offset-suffix</td><td data-label="Type">String</td>
<td data-label="Description">The class suffix for the grid system's offset columns</td><td data-label="Sample value">'offset'</td>
</tr>
<tr>
<td data-label="Variable">$grid-column-normal-suffix</td><td data-label="Type">String</td>
<td data-label="Description">The class suffix for the grid system's normal order columns</td><td data-label="Sample value">'normal'</td>
</tr>
<tr>
<td data-label="Variable">$grid-column-first-suffix</td><td data-label="Type">String</td>
<td data-label="Description">The class suffix for the grid system's first order columns</td><td data-label="Sample value">'first'</td>
</tr>
<tr>
<td data-label="Variable">$grid-column-last-suffix</td><td data-label="Type">String</td>
<td data-label="Description">The class suffix for the grid system's last order columns</td><td data-label="Sample value">'last'</td>
</tr>
</tbody>
</table><br/>
</div>
<div class="section">
<h3>Notes:</h3>
<ol>
<li id="grid-note-one">The values of <code>$grid-extra-small-prefix</code> and <code>$grid-small-breakpoint</code> will only be used if <code>$use-four-step-grid</code> is set to <code class="fore-tertiary">true</code>.</li>
<li id="grid-note-two">The value of <code>$grid-row-parent-layout-prefix</code> will only be used if <code>$include-parent-layout</code> is set to <code class="fore-tertiary">true</code>.</li>
</ol>
</div>
</div>
</div>
</div>
<div class="row" style="padding-bottom: 20px; padding-top:20px;">
<div class="col-sm-12 col-lg-10 col-lg-offset-1">
<p>If you want to learn more about customizing <strong>mini.css</strong>, go back to the <a href="index.html">customization page</a> or choose a module from the top menu to see its documentation.</p>
</div>
</div>
</div></main>
<!-- 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>