/
index.html
451 lines (430 loc) · 18 KB
/
index.html
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
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
<!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" />
<title>Pylon — Declarative layout primitives for CSS & HTML</title>
<link rel="stylesheet" href="./pylon/pylon.css" />
<link
rel="stylesheet"
href="https://unpkg.com/tachyons@4.10.0/css/tachyons.min.css"
/>
<link
rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.8/styles/github.min.css"
/>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.15.8/highlight.min.js"></script>
<link
href="https://fonts.googleapis.com/css?family=Source+Code+Pro&display=swap"
rel="stylesheet"
/>
<script async defer src="https://buttons.github.io/buttons.js"></script>
<style>
html,
body {
font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI",
Roboto, "Helvetica Neue", Arial, sans-serif;
scroll-behavior: smooth;
}
code {
font-family: "Source Code Pro", monospace;
}
.bg-light-gray {
background: #F8F8F8;
}
.icon {
width: 32px;
height: 32px;
border-radius: 100%;
}
.shadow-3 {
box-shadow: 0 0 0 1px rgba(40,43,48,.1),0 4px 8px rgba(40,43,48,.05),0 2px 3px rgba(40,43,48,.1)
}
[debug] * {
outline: 1px solid #357edd !important;
}
</style>
</head>
<body class="sans-serif">
<div class="mw8 center tr-ns pt3 pt5-ns ph3" style="height:28px;">
<a class="github-button" href="https://github.com/almonk/pylon" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star almonk/pylon on GitHub"></a>
</div>
<div class="mw8 center ph4-ns pa3 flex flex-column flex-row-ns items-center-ns">
<div class="w-100 w-third-ns mr4-ns mt3-ns">
<h1 class="ma0 mb2 mt3 mt0-ns">Pylon</h1>
<h2 class="ma0 mb2 fw4 lh-title">
Declarative layout primitives for CSS & HTML
</h2>
<p class="ma0 lh-copy gray">
Pylon encapsulates Flexbox logic into a set of declarative and expressive tags and attributes which, when combined, form robust user interfaces.
</p>
<p class="ma0 mt2 lh-copy gray">
<vstack spacing=xs class="mt2">
<hstack spacing=xs alignment=leading>
<img src="https://img.icons8.com/material/48/00CCBC/checkmark.png" width=24 height=24>
<text>Easily configurable</text>
</hstack>
<hstack spacing=xs alignment=leading>
<img src="https://img.icons8.com/material/48/00CCBC/checkmark.png" width=24 height=24>
<text>Pure CSS – no JavaScript</text>
</hstack>
<hstack spacing=xs alignment=leading>
<img src="https://img.icons8.com/material/48/00CCBC/checkmark.png" width=24 height=24>
<text>Less than 2kb minified</text>
</hstack>
</vstack>
</p>
<p class="ma0 mt2 lh-copy gray">
A thing by <a href="https://alasdairmonk.com" class="blue link">@almonk</a>
</p>
</div>
<div class="w-100 w-two-thirds-ns relative pt4 blue">
<list spacing=xs debug class="o-60">
<hstack spacing="s">
<div class="icon"></div>
<text>Westminster</text>
<spacer></spacer>
<text>0.5 miles</text>
</hstack>
<hstack spacing="s">
<div class="icon"></div>
<text>Richmond</text>
<spacer></spacer>
<text>2.5 miles</text>
</hstack>
<hstack spacing="s">
<div class="icon"></div>
<text>Hampstead</text>
<spacer></spacer>
<text>4.2 miles</text>
</hstack>
<hstack spacing="s">
<div class="icon"></div>
<text>Balham</text>
<spacer></spacer>
<text>6.0 miles</text>
</hstack>
<hstack spacing="s">
<div class="icon"></div>
<text>Wapping</text>
<spacer></spacer>
<text>10.5 miles</text>
</hstack>
</list>
<pre
class="bg-light-gray blue br3 absolute right-1 right-2-ns mt2 bottom-2-ns overflow-hidden shadow-3 f5 f4-ns top-1"
><code class="html pa2"><list spacing=s>
<hstack spacing=s>
<div class="icon"></div>
<text>Westminster</text>
<spacer></spacer>
<text>0.5 miles</text>
</hstack>
...</code></pre>
</div>
</div>
<div class="bg-light-gray">
<div class="mt5 mw8 center pa4-ns pa3 flex flex-column mb4">
<div class="w-100 mr4 mt2">
<div class="f4 fw6 mb2">Installation</div>
<p class="ma0 gray lh-copy">
Pylon can be used via CDN:
</p>
<pre><code class="html br3 ba b--black-10"><link rel="stylesheet" href="https://unpkg.com/pyloncss@latest/css/pylon.css"/></code></pre>
<p class="ma0 gray lh-copy">
or via npm:
</p>
<pre><code class="bash br3 ba b--black-10">npm install pyloncss</code></pre>
<p class="ma0 mt2 lh-copy gray">
Or, customise and build the code yourself from <a href="https://github.com/almonk/pylon" class="blue link">github.com/almonk/pylon</a>
</p>
</div>
</div>
</div>
<div class="mw8 center pa4-ns pa3 flex flex-column flex-row-ns">
<div class="w-100 w-third-ns mr4 mt2">
<div class="f4 fw6 mb2" id="stacks">Contents</div>
<div class="f5 gray pv2">Elements</div>
<a href="#stacks" class="blue db pv2 link">Stacks</a>
<a href="#lists" class="blue db pv2 link">Lists</a>
<a href="#dividers" class="blue db pv2 link">Dividers</a>
<a href="#spacers" class="blue db pv2 link">Spacers</a>
<a href="#helpers" class="blue db pv2 link">Helpers</a>
</div>
</div>
<div class="mt4 mw8 center pa4-ns pa3 flex flex-column flex-row-ns mb4">
<div class="w-100 w-third-ns mr4 mt2">
<div class="f4 fw6 mb2" id="stacks">Stacks</div>
<p class="ma0 lh-copy gray">
Pylon brings iOS-like Stacks to the web, wrapping Flexbox with a
simple syntax. There are two types of stack:
</p>
<p class="ma0 lh-copy near-black mt2">
<code>hstack</code> — Horizontal stacks
</p>
<p class="ma0 lh-copy near-black mt2">
<code>vstack</code> — Vertical stacks
</p>
<p class="ma0 lh-copy near-black mt3 f6 fw5">Stack Attributes</p>
<vstack spacing="xxs" align-x="left" class="f6 mt2 mb3">
<code class="bg-light-gray br2 pa1">spacing=</code>
<hstack spacing="xxs">
<code class="bg-white ba b--light-gray br2 pa1 gray">xxs</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">xs</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">s</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">m</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">l</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">xl</code>
</hstack>
<div class="gray">Spacing between children within a Stack</div>
</vstack>
<vstack spacing="xxs" align-x="left" class="f6 mt2 mb3">
<code class="bg-light-gray br2 pa1">align-x=</code>
<hstack spacing="xxs">
<code class="bg-white ba b--light-gray br2 pa1 gray">left</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">center</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">right</code>
</hstack>
<div class="gray">Aligns items along the horizontal axis</div>
</vstack>
<vstack spacing="xxs" align-x="left" class="f6 mt2 mb3">
<code class="bg-light-gray br2 pa1">align-y=</code>
<hstack spacing="xxs">
<code class="bg-white ba b--light-gray br2 pa1 gray">top</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">center</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">bottom</code>
</hstack>
<div class="gray">Aligns items along the vertical axis</div>
</vstack>
</div>
<div class="w-100 w-two-thirds-ns">
<div class="ba br--top b--light-gray br3 bg-white pa3 overflow-scroll">
<hstack spacing="s">
<input type="text" placeholder="Your name" />
<input type="email" placeholder="Your email" />
<button>Submit</button>
</hstack>
</div>
<pre
class="ma0 br3 br--bottom bg-white overflow-hidden"
><code class="html"><hstack spacing=s>
<input type="text" placeholder="Your name" />
<input type="email" placeholder="Your email" />
<button>Submit</button>
</hstack></code></pre>
<div class="mt3 ba br--top b--light-gray br3 bg-white pa3 overflow-scroll">
<vstack spacing="s">
<input type="text" placeholder="Your name" />
<input type="email" placeholder="Your email" />
<button>Submit</button>
</vstack>
</div>
<pre
class="ma0 br3 br--bottom bg-white overflow-hidden"
><code class="html"><vstack spacing=s>
<input type="text" placeholder="Your name" />
<input type="email" placeholder="Your email" />
<button>Submit</button>
</vstack></code></pre>
<div class="mt3 ba br--top b--light-gray br3 bg-white pa3 overflow-scroll" style="height:150px" debug>
<vstack stretch align-x=center align-y=center>
Hello world.
</vstack>
</div>
<pre
class="ma0 br3 br--bottom bg-white overflow-hidden"
><code class="html"><vstack stretch align-x=center align-y=center>
Hello world.
</vstack></code></pre>
</div>
</div>
<div class="mw8 center pa4-ns pa3 flex flex-column flex-row-ns mt0 mb4">
<div class="w-100 w-third-ns mr4 mt2">
<div class="f4 fw6 mb2" id="lists">Lists</div>
<p class="ma0 lh-copy gray">
Lists are similar to a <code>vstack</code> but have some built in
conveniences. The List element will assume its immediate children are
row elements and draw borders between them while omitting the last
row.
</p>
<p class="ma0 lh-copy near-black mt3 f6 fw5">List Attributes</p>
<vstack spacing="xxs" align-x="left" class="f6 mt2 mb3">
<code class="bg-light-gray br2 pa1">spacing=</code>
<hstack spacing="xxs">
<code class="bg-white ba b--light-gray br2 pa1 gray">xxs</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">xs</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">s</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">m</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">l</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">xl</code>
</hstack>
<div class="gray">Spacing between children within a Stack</div>
</vstack>
<vstack spacing="xxs" align-x="left" class="f6 mt2 mb3">
<code class="bg-light-gray br2 pa1">align-x=</code>
<hstack spacing="xxs">
<code class="bg-white ba b--light-gray br2 pa1 gray">left</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">center</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">right</code>
</hstack>
<div class="gray">Aligns items along the horizontal axis</div>
</vstack>
<vstack spacing="xxs" align-x="left" class="f6 mt2 mb3">
<code class="bg-light-gray br2 pa1">align-y=</code>
<hstack spacing="xxs">
<code class="bg-white ba b--light-gray br2 pa1 gray">top</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">center</code>
<code class="bg-white ba b--light-gray br2 pa1 gray">bottom</code>
</hstack>
<div class="gray">Aligns items along the vertical axis</div>
</vstack>
</div>
<div class="w-two-thirds-ns w-100">
<div class="ba br--top b--light-gray br3 bg-white pa3 overflow-scroll">
<list spacing=xs>
<text>Red</text>
<text>Green</text>
<text>Blue</text>
</list>
</div>
<pre
class="ma0 br3 br--bottom bg-white overflow-hidden"
><code class="html"><list spacing=xs>
<text>Red</text>
<text>Green</text>
<text>Blue</text>
</list></code></pre>
<div class="ba br--top b--light-gray br3 bg-white pa3 overflow-scroll mt3">
<list spacing="s">
<hstack spacing=xs>
<input type="checkbox" />
<label>Do laundry</label>
<spacer></spacer>
<div>Due today</div>
</hstack>
<hstack spacing=xs>
<input type="checkbox" />
<label>Buy milk</label>
</hstack>
</list>
</div>
<pre
class="ma0 br3 br--bottom bg-white overflow-hidden"
><code class="html"><list spacing="s">
<hstack spacing=xs>
<input type="checkbox" />
<label>Do laundry</label>
<spacer></spacer>
<div>Due today</div>
</hstack>
<hstack spacing=xs>
<input type="checkbox" />
<label>Buy milk</label>
</hstack>
</list></code></pre>
</div>
</div>
<div class="mw8 center pa4-ns pa3 flex flex-column flex-row-ns mt0 mb4">
<div class="w-100 w-third-ns mr4 mt2">
<div class="f4 fw6 mb2" id="dividers">Dividers</div>
<p class="ma0 lh-copy gray">
Dividers are used to visually divide items in a stack.
</p>
</div>
<div class="w-two-thirds-ns w-100">
<div class="ba br--top b--light-gray br3 bg-white pa3 overflow-scroll">
<hstack spacing="xs">
<input stretch type="text" placeholder="Add a todo" />
<button>Add</button>
<divider></divider>
<button>View all</button>
</hstack>
</div>
<pre
class="ma0 br3 br--bottom bg-white overflow-hidden"
><code class="html"><hstack spacing=xs>
<input stretch type="text" placeholder="Add a todo">
<button>Add</button>
<divider></divider>
<button>View all</button>
</hstack></code></pre>
</div>
</div>
<div class="mw8 center pa4-ns pa3 flex flex-column flex-row-ns mt0 mb4">
<div class="w-100 w-third-ns mr4 mt2">
<div class="f4 fw6 mb2" id="spacers">Spacers</div>
<p class="ma0 lh-copy gray">
Spacers stretch to fill available space.
</p>
</div>
<div class="w-two-thirds-ns w-100">
<div class="ba br--top b--light-gray br3 bg-white pa3 overflow-scroll">
<hstack>
<button>Cancel</button>
<spacer></spacer>
<button>Submit</button>
</hstack>
</div>
<pre
class="ma0 br3 br--bottom bg-white overflow-hidden"
><code class="html"><hstack>
<button>Cancel</button>
<spacer></spacer>
<button>Submit</button>
</hstack></code></pre>
</div>
</div>
<div class="mw8 center pa4-ns pa3 flex flex-column flex-row-ns mt0 mb4">
<div class="w-100 w-third-ns mr4 mt2">
<div class="f4 fw6 mb2" id="helpers">Helpers</div>
<p class="ma0 lh-copy gray">
Generic attributes which can be applied to any element.
</p>
<vstack spacing="xxs" align-x="left" class="f6 mt2 mb3">
<code class="bg-light-gray br2 pa1">debug</code>
<div class="gray lh-copy">
Outlines all child elements to visually see boundaries
</div>
</vstack>
<vstack spacing="xxs" align-x="left" class="f6 mt2 mb3">
<code class="bg-light-gray br2 pa1">stretch</code>
<div class="gray lh-copy">
Instructs the element to fill available space
</div>
</vstack>
</div>
<div class="w-two-thirds-ns w-100">
<div class="ba br--top b--light-gray br3 bg-white pa3 overflow-scroll">
<hstack debug>
<button>Cancel</button>
<spacer></spacer>
<button>Submit</button>
</hstack>
</div>
<pre
class="ma0 br3 br--bottom bg-white overflow-hidden"
><code class="html"><hstack debug>
<button>Cancel</button>
<spacer></spacer>
<button>Submit</button>
</hstack></code></pre>
<div class="mt3 ba br--top b--light-gray br3 bg-white pa3 overflow-scroll">
<hstack debug spacing=s>
<button>Cancel</button>
<button stretch>Submit</button>
</hstack>
</div>
<pre
class="ma0 br3 br--bottom bg-white overflow-hidden"
><code class="html"><hstack debug>
<button>Cancel</button>
<button stretch>Submit</button>
</hstack></code></pre>
</div>
</div>
<script>
hljs.initHighlightingOnLoad();
</script>
</body>
</html>