Files
webawesome/docs/grid-system.html

126 lines
5.3 KiB
HTML
Raw Normal View History

2017-08-08 17:41:40 -04:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="Shoelace doesnt ship with a grid system because you dont need one!">
<link rel="icon" href="../source/img/favicon.png">
2017-08-09 11:22:09 -04:00
<link rel="stylesheet" href="../dist/shoelace.css">
2017-08-08 17:41:40 -04:00
<link rel="stylesheet" href="../source/css/_docs.css">
<link rel="stylesheet" href="https://cdn.rawgit.com/AGMStudio/prism-theme-one-dark/f81fe477/prism-onedark.css">
<title>Grid System</title>
</head>
<body>
<header id="head" class="text-center">
<h1>
<a href="../index.html">
<img src="../source/img/wordmark.svg" alt="Shoelace logo">
</a>
</h1>
2017-08-13 15:41:38 -04:00
<p class="text-secondary text-small">
2017-08-08 17:41:40 -04:00
A back to the basics CSS starter kit. For when you dont need the whole boot.
</p>
</header>
<main id="wrap">
<nav id="nav">
<a href="installing.html">Installing</a>
<a href="customizing.html">Customizing</a>
<a href="content.html">Content</a>
<a href="alerts.html">Alerts</a>
<a href="badges.html">Badges</a>
<a href="buttons.html">Buttons</a>
<a href="dropdowns.html">Dropdowns</a>
<a href="forms.html">Forms</a>
<a href="loaders.html">Loaders</a>
2017-08-11 16:12:13 -04:00
<a href="progress-bars.html">Progress Bars</a>
2017-08-08 17:41:40 -04:00
<a href="switches.html">Switches</a>
<a href="tabs.html">Tabs</a>
<a href="tables.html">Tables</a>
<a href="utilities.html">Utilities</a>
<a href="grid-system.html">Grid System</a>
<a href="icons.html">Icons</a>
<a href="browser-support.html">Browser Support</a>
<a href="attribution.html">Attribution</a>
</nav>
<div id="content">
<h2 id="grid-system">Grid System</h2>
<p>Shoelace doesnt ship with a grid system because <a href="https://rachelandrew.co.uk/archives/2017/07/01/you-do-not-need-a-css-grid-based-grid-system/">you dont need one</a>. You should use the <a href="https://gridbyexample.com/">CSS Grid Layout</a> instead.</p>
2017-08-09 10:20:46 -04:00
<p>This website uses the CSS Grid Layout. Its really simple!</p>
<pre><code class="lang-html">&lt;main id=&quot;wrap&quot;&gt;
&lt;nav id=&quot;nav&quot;&gt;
...
&lt;/nav&gt;
&lt;div id=&quot;content&quot;&gt;
...
&lt;/div&gt;
&lt;/main&gt;
</code></pre>
<p>Now we just need a couple styles to turn the nav and content elements into columns. This will make the nav <code>12rem</code> wide and the content <code>100% - 12rem</code> so it fills the rest of the space.</p>
<pre><code class="lang-css">#wrap {
display: grid;
grid-template-columns: 12rem calc(100% - 12rem);
}
</code></pre>
<p>You can use media queries to make grids responsive. This is how we make the nav appear on top of the content on smaller screens.</p>
<pre><code class="lang-css">@media (max-width: 60rem) {
#wrap {
display: block;
}
}
</code></pre>
2017-08-12 13:49:25 -04:00
<h3 id="for-older-browsers">For Older Browsers</h3>
2017-08-18 13:53:42 -04:00
<p>Support for CSS Grid Layouts is <a href="http://caniuse.com/css-grid">decent</a>, but if you have an obligation to support Internet Explorer or Edge &lt; 16, consider using the <a href="https://evgenyrodionov.github.io/flexboxgrid2/">Flexbox Grid</a> in combination with Shoelace.</p>
<p>You can use it as-is or include the source files and customize it with CSS variables in your build process.</p>
2017-08-08 17:41:40 -04:00
</div>
</main>
<footer id="foot">
<a href="../index.html">
<img src="../source/img/wordmark.svg" alt="Shoelace logo">
</a>
2017-08-18 14:57:46 -04:00
2017-08-13 15:41:38 -04:00
<p class="text-small text-secondary">
2017-08-22 16:58:22 -04:00
1.0.0-beta18
2017-08-08 17:41:40 -04:00
</p>
2017-08-16 21:34:27 -04:00
<p class="mar-y-sm text-center">
2017-08-08 17:41:40 -04:00
<a class="github-button" href="https://github.com/claviska/shoelace-css/fork" data-size="large" aria-label="Fork claviska/shoelace-css on GitHub">Fork</a>
<a class="github-button" href="https://github.com/claviska/shoelace-css/releases" data-icon="octicon-cloud-download" data-size="large" aria-label="Download claviska/shoelace-css on GitHub">Download</a>
<a class="github-button" href="https://github.com/claviska/shoelace-css/issues" data-icon="octicon-issue-opened" data-size="large" aria-label="Issue claviska/shoelace-css on GitHub">Report a Bug</a>
<a class="github-button" href="https://github.com/claviska/shoelace-css" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star claviska/shoelace-css on GitHub">Star</a>
</p>
2017-08-18 14:57:46 -04:00
2017-08-08 17:41:40 -04:00
<p>
2017-08-13 15:57:30 -04:00
<a href="https://twitter.com/shoelacecss" class="button button-info" style="margin-bottom: 1.2rem;">Follow</a>
<a href="https://paypal.me/claviska" class="button button-success" style="margin-bottom: 1.2rem;">Donate</a>
2017-08-08 17:41:40 -04:00
</p>
2017-08-18 14:57:46 -04:00
<p class="text-small text-secondary">
<a href="https://keycdn.com/" class="text-secondary">Accelerated by KeyCDN</a> &middot;
&copy; A Beautiful Site, LLC
</p>
2017-08-08 17:41:40 -04:00
</footer>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.6.0/prism.min.js"></script>
2017-08-09 11:22:09 -04:00
<script src="../dist/shoelace.js"></script>
2017-08-08 17:41:40 -04:00
<script>
$(function() {
// Highlight current nav item
$('#nav a').each(function() {
if(this.pathname === location.pathname) {
$(this).addClass('current');
}
});
});
</script>
<script async defer src="https://buttons.github.io/buttons.js"></script>
</body>
</html>