Summary Files Commits Branches @commit @diff @stats
path: root / docs / layout.html
blob: a0e96ed3b20153895f73d6e4839d6422676582dc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="robots" content="index, follow" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="author" content="https://github.com/picturepan2/" />
  <title>Layout - Spectre.css</title>
  <link rel="stylesheet" href="css/spectre.css" />
  <link rel="stylesheet" href="css/docs.css" />
  <link rel="stylesheet" href="font/style.css" />
</head>
<body>
  <section class="section section-header bg-grey">
    <section class="grid-header container grid-960">
      <nav class="navbar">
        <section class="navbar-section">
          <a href="index.html" class="navbar-brand">Spectre.css</a>
          <a href="index.html" class="btn btn-link">Docs</a>
          <a href="https://github.com/picturepan2/spectre" target="_blank" class="btn btn-link">GitHub</a>
        </section>
        <section class="navbar-section show-xs">
          <a href="#sidebar" class="btn btn-lg btn-link btn-action"><i class="icon icon-menu"></i></a>
        </section>
      </nav>
    </section>
  </section>

  <section class="container grid-960">
    <section class="columns">
      <div id="sidebar" class="docs-sidebar column col-3 col-sm-12">
        <ul class="docs-nav nav">
          <li class="nav-item">
            <a href="index.html">Getting started</a>
          </li>
          <li class="nav-item">
            <a href="elements.html">Elements</a>
          </li>
          <li class="nav-item">
            <a href="layout.html"><strong>Layout</strong></a>
            <ul class="nav">
              <li class="nav-item">
                <a href="layout.html#grid">Flexbox grid</a>
              </li>
              <li class="nav-item">
                <a href="layout.html#responsive">Responsive</a>
              </li>
              <li class="nav-item">
                <a href="layout.html#navbar">Navbar</a>
              </li>
              <li class="nav-item">
                <a href="layout.html#empty">Empty states</a>
              </li>
            </ul>
          </li>
          <li class="nav-item">
            <a href="components.html">Components</a>
          </li>
          <li class="nav-item">
            <a href="utilities.html">Utilities</a>
          </li>
        </ul>
      </div>
      <a href="#sidebar-close" id="sidebar-close" class="docs-nav-clear"></a>

      <div class="docs-content column col-9 col-sm-12">
        <section id="grid" class="container">
          <header class="text-center"><h3>Flexbox grid</h3></header>
          <section class="notes">
            <p><strong>Layout</strong> includes flexbox based responsive grid system with 12 columns. </p>
          </section>
          <div class="columns">
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
            <div class="column">
              <div class="bg-grey"></div>
            </div>
          </div>

          <div class="columns">
            <div class="column col-12">
              <div class="bg-grey">col-12 (100%)</div>
            </div>
          </div>
          <div class="columns">
            <div class="column col-9">
              <div class="bg-grey">col-9 (75%)</div>
            </div>
          </div>
          <div class="columns">
            <div class="column col-6">
              <div class="bg-grey">col-6 (50%)</div>
            </div>
          </div>
          <div class="columns">
            <div class="column col-3">
              <div class="bg-grey">col-3 (25%)</div>
            </div>
          </div>

          <section class="notes">
            <p>Add the class <code>columns</code> to a container with the class <code>container</code>. And add any element you want with classname <code>column</code> inside the container. These columns will take up the space equally. You can specific the width of each column by adding class <code>col-[1-12]</code>.</p>
            <p>And you can add the class <code>col-gapless</code> to have gapless columns.</p>
          </section>

          <div class="columns col-gapless">
            <div class="column col-6">
              <div class="bg-grey">col-6 (gapless)</div>
            </div>
            <div class="column col-6">
              <div class="bg-grey">col-6 (gapless)</div>
            </div>
          </div>

          <section class="notes">
            <p>By default, Spectre grid has multi-line flexbox enabled. You can add the class <code>col-oneline</code> to <code>columns</code> to make all its child columns positioned in the same single row.</p>
          </section>

          <div class="columns col-oneline">
            <div class="column col-8">
              <div class="bg-grey">col-8</div>
            </div>
            <div class="column col-8">
              <div class="bg-grey">col-8</div>
            </div>
          </div>

<!-- layout example -->
<pre>
<code class="code lang-html" data-lang="HTML">&lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;container&quot;</span>&gt;
  &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;columns&quot;</span>&gt;
    &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;column col-6&quot;</span>&gt;col-6&lt;<span class="tag">/div</span>&gt;
    &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;column col-3&quot;</span>&gt;col-3&lt;<span class="tag">/div</span>&gt;
    &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;column col-2&quot;</span>&gt;col-2&lt;<span class="tag">/div</span>&gt;
    &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;column col-1&quot;</span>&gt;col-1&lt;<span class="tag">/div</span>&gt;
  &lt;<span class="tag">/div</span>&gt;

  &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;columns col-gapless&quot;</span>&gt;
    &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;column col-6&quot;</span>&gt;col-6&lt;<span class="tag">/div</span>&gt;
    &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;column col-6&quot;</span>&gt;col-6&lt;<span class="tag">/div</span>&gt;
  &lt;<span class="tag">/div</span>&gt;
&lt;<span class="tag">/div</span>&gt;</code>
</pre>

        </section>

        <section id="responsive" class="container">
          <header class="text-center"><h3>Responsive grid</h3></header>
          <div class="columns col-multiline">
            <div class="column col-md-6 col-xs-12">
              <div class="bg-grey">col-md-6</div>
            </div>
            <div class="column col-md-3 col-xs-12">
              <div class="bg-grey">col-md-3</div>
            </div>
            <div class="column col-md-3 col-xs-12">
              <div class="bg-grey">col-md-3</div>
            </div>
          </div>

          <div class="columns">
            <div class="column col-sm-6">
              <div class="bg-grey">col-sm-6</div>
            </div>
            <div class="column col-sm-3">
              <div class="bg-grey">col-sm-3</div>
            </div>
            <div class="column col-sm-3">
              <div class="bg-grey">col-sm-3</div>
            </div>
          </div>

          <div class="columns">
            <div class="column col-xs-6">
              <div class="bg-grey">col-xs-6</div>
            </div>
            <div class="column col-xs-3">
              <div class="bg-grey">col-xs-3</div>
            </div>
            <div class="column col-xs-3">
              <div class="bg-grey">col-xs-3</div>
            </div>
          </div>

          <section class="notes">
            <p>Spectre provides a neat responsive layout grid system. There are <code>col-xs-[1-12]</code>, <code>col-sm-[1-12]</code>, <code>col-md-[1-12]</code>, <code>col-lg-[1-12]</code> and <code>col-xl-[1-12]</code> available for flexible grid across mobile, tablet and desktop viewport usage.</p>
            <ul>
              <li>For window width less than <strong>480px</strong>, all columns will show as a single row.</li>
              <li><code>col-xs-[1-12]</code> apply to window width smaller than or equal to <strong>480px</strong>. </li>
              <li><code>col-sm-[1-12]</code> apply to window width smaller than or equal to <strong>600px</strong>. </li>
              <li><code>col-md-[1-12]</code> apply to window width smaller than or equal to <strong>840px</strong>. </li>
              <li><code>col-lg-[1-12]</code> apply to window width smaller than or equal to <strong>960px</strong>. </li>
              <li><code>col-xl-[1-12]</code> apply to window width smaller than or equal to <strong>1280px</strong>. </li>
            </ul>
          </section>

<!-- layout example -->
<pre>
<code class="code lang-html" data-lang="HTML">&lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;container&quot;</span>&gt;
  &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;columns&quot;</span>&gt;
    &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;column col-xs-6&quot;</span>&gt;col-xs-6&lt;<span class="tag">/div</span>&gt;
    &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;column col-xs-3&quot;</span>&gt;col-xs-3&lt;<span class="tag">/div</span>&gt;
    &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;column col-xs-3&quot;</span>&gt;col-xs-3&lt;<span class="tag">/div</span>&gt;
  &lt;<span class="tag">/div</span>&gt;
&lt;<span class="tag">/div</span>&gt;</code>
</pre>

          <section class="notes">
            <p>For hiding elements on specific viewport sizes, there are classes <code>hide-xs</code>, <code>hide-sm</code>, <code>hide-md</code>, <code>hide-lg</code> and <code>hide-xl</code> available.</p>
            <ul>
              <li><code>hide-xs</code> hides elements when the window width is smaller than or equal to <strong>480px</strong>. </li>
              <li><code>hide-sm</code> hides elements when the window width is smaller than or equal to <strong>600px</strong>. </li>
              <li><code>hide-md</code> hides elements when the window width is smaller than or equal to <strong>840px</strong>. </li>
              <li><code>hide-lg</code> hides elements when the window width is smaller than or equal to <strong>960px</strong>. </li>
              <li><code>hide-xl</code> hides elements when the window width is smaller than or equal to <strong>1280px</strong>. </li>
            </ul>
            <p>Spectre also has a responsive web test tool Responsive Resizer. You can use it locally in the directory <code>/tools/resizer</code>.</p>
          </section>
        </section>

        <section id="navbar" class="container">
          <header class="text-center"><h3>Navbar</h3></header>
          <section class="notes">
            <p><strong>Navbar</strong> is a layout container that appears in the header of apps and websites. </p>
          </section>
          <div class="columns">
            <div class="column">
              <section class="navbar">
                <section class="navbar-section">
                  <a href="#navbar" class="navbar-brand">
                    <i class="icon icon-pages"></i> Spectre.css
                  </a>
                  <a href="#navbar" class="btn btn-link">features</a>
                  <a href="#navbar" class="btn btn-link">documents</a>
                </section>
                <section class="navbar-section">
                  <div class="input-group input-inline">
                    <input class="form-input" type="text" placeholder="search" />
                    <button class="btn btn-primary input-group-btn">Search</button>
                  </div>
                </section>
              </section>
            </div>
          </div>

          <section class="notes">
            <p>A navbar component can include logo brand, nav links and buttons, search box or any combination of those elements. Each section with the class <code>navbar-section</code> will be evenly distributed in the container.</p>
          </section>

<!-- navbar example -->
<pre>
<code class="code lang-html" data-lang="HTML">&lt;<span class="tag">header</span> <span class="atn">class</span>=<span class="atv">&quot;navbar&quot;</span>&gt;
  &lt;<span class="tag">section</span> <span class="atn">class</span>=<span class="atv">&quot;navbar-section&quot;</span>&gt;
    &lt;<span class="tag">a</span> <span class="atn">href</span>=<span class="atv">&quot;#&quot;</span> <span class="atn">class</span>=<span class="atv">&quot;navbar-brand&quot;</span>&gt;
      &lt;<span class="tag">i</span> <span class="atn">class</span>=<span class="atv">&quot;icon icon-pages&quot;</span>&gt;&lt;<span class="tag">/i</span>&gt; Spectre.css
    &lt;<span class="tag">/a</span>&gt;
    &lt;<span class="tag">a</span> <span class="atn">href</span>=<span class="atv">&quot;#&quot;</span> <span class="atn">class</span>=<span class="atv">&quot;btn btn-link&quot;</span>&gt;features&lt;<span class="tag">/a</span>&gt;
    &lt;<span class="tag">a</span> <span class="atn">href</span>=<span class="atv">&quot;#&quot;</span> <span class="atn">class</span>=<span class="atv">&quot;btn btn-link&quot;</span>&gt;documents&lt;<span class="tag">/a</span>&gt;
  &lt;<span class="tag">/section</span>&gt;
  &lt;<span class="tag">section</span> <span class="atn">class</span>=<span class="atv">&quot;navbar-section&quot;</span>&gt;
    &lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;input-group input-inline&quot;</span>&gt;
      &lt;<span class="tag">input</span> <span class="atn">class</span>=<span class="atv">&quot;form-input&quot;</span> <span class="atn">type</span>=<span class="atv">&quot;text&quot;</span> <span class="atn">placeholder</span>=<span class="atv">&quot;search&quot;</span> /&gt;
      &lt;<span class="tag">button</span> <span class="atn">class</span>=<span class="atv">&quot;btn btn-primary input-group-btn&quot;</span>&gt;Search&lt;<span class="tag">/button</span>&gt;
    &lt;<span class="tag">/div</span>&gt;
  &lt;<span class="tag">/section</span>&gt;
&lt;<span class="tag">/header</span>&gt;</code>
</pre>

        </section>

        <section id="empty" class="container">
          <header class="text-center"><h3>Empty states / blank slates</h3></header>
          <section class="notes">
            <p><strong>Empty states/blank slates</strong> are commonly used as placeholders for first time use, empty data and error screens.</p>
          </section>
          <div class="columns">
            <div class="column col-8 col-xs-12">
              <section class="empty">
                <i class="icon icon-markunread"></i>
                <p class="empty-title">You have no new messages</p>
                <p class="empty-meta">Click the button to start a conversation.</p>
                <button class="empty-action btn btn-primary">Send a message</button>
              </section>
            </div>
            <div class="column col-8 col-xs-12">
              <section class="empty">
                <i class="icon icon-people"></i>
                <p class="empty-title">You are not following anyone</p>
                <div class="empty-action input-group">
                  <input type="text" class="form-input" placeholder="" />
                  <button class="btn btn-primary input-group-btn">Search</button>
                </div>
              </section>
            </div>
          </div>

          <section class="notes">
            <p>An empty state component can include icons, messages(title and meta messages) and action buttons or any combination of those elements. Add <code>empty-title</code>, <code>empty-meta</code> or <code>empty-action</code> to the elements. HTML structure is exampled below. </p>
          </section>

<!-- empty states example -->
<pre>
<code class="code lang-html" data-lang="HTML">&lt;<span class="tag">div</span> <span class="atn">class</span>=<span class="atv">&quot;empty&quot;</span>&gt;
  &lt;<span class="tag">i</span> <span class="atn">class</span>=<span class="atv">&quot;icon icon-people&quot;</span>&gt;&lt;<span class="tag">/i</span>&gt;
  &lt;<span class="tag">p</span> <span class="atn">class</span>=<span class="atv">&quot;empty-title&quot;</span>&gt;You have no new messages&lt;<span class="tag">/p</span>&gt;
  &lt;<span class="tag">p</span> <span class="atn">class</span>=<span class="atv">&quot;empty-meta&quot;</span>&gt;Click the button to start a conversation.&lt;<span class="tag">/p</span>&gt;
  &lt;<span class="tag">button</span> <span class="atn">class</span>=<span class="atv">&quot;empty-action btn btn-primary&quot;</span>&gt;Send a message&lt;<span class="tag">/button</span>&gt;
&lt;<span class="tag">/div</span>&gt;</code>
</pre>
        </section>

        <section class="container">
          <div class="divider"></div>
          <ul class="pagination">
            <li class="page-item page-prev">
              <a href="elements.html">
                <p class="page-item-meta">Previous</p>
                <h4 class="page-item-title">Elements</h4>
              </a>
            </li>
            <li class="page-item page-next">
              <a href="components.html">
                <p class="page-item-meta">Next</p>
                <h4 class="page-item-title">Components</h4>
              </a>
            </li>
          </ul>
        </section>
      </div>
    </section>
  </section>

  <footer class="bg-grey">
    <section id="copyright" class="grid-footer container grid-960">
      <p>
        <a href="index.html#introduction" target="_blank">Documents</a> | <a href="https://github.com/picturepan2/spectre" target="_blank">GitHub Repo</a> | Version <span class="version"></span>
      </p>
      <p>Designed and built with ♥ by <a href="https://twitter.com/picturepan2" target="_blank">Yan Zhu</a>. Licensed under the <a href="https://github.com/picturepan2/spectre/blob/master/LICENSE" target="_blank">MIT License</a>.</p>
    </section>
  </footer>
  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-2702768-8', 'auto');
    ga('send', 'pageview');
  </script>
</body>
</html>