-
-
Notifications
You must be signed in to change notification settings - Fork 348
/
config.html
2423 lines (827 loc) · 36 KB
/
config.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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Grid Configuration | Susy Documentation</title>
<link href="assets/img/favicon.ico" rel="shortcut icon">
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:400,600|Source+Sans+Pro:400,400i,700,700i" rel="stylesheet">
<link rel="stylesheet" href="assets/webpack/app_styles.min.css" />
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" hidden>
<symbol id="icon-logo" viewBox="0 0 16 16">
<path d="M.2 8L0 7.8v-.2C.8 6.9 1.9 5.9 2.7 5l.4.3c-.5.8-1.1 1.6-1.8 2.3 1 1.2 1 1.3 1.7 2.4l-.4.3c-.4-.4-.5-.6-1-1C1 8.6 1.1 8.7.2 8zM13 10c.6-1.1.7-1.1 1.7-2.4-.6-.6-1.3-1.5-1.7-2.3l.3-.3c.8.8 1.8 1.8 2.7 2.6v.2l-.8.7c-.3.3-1.2 1.1-1.8 1.7L13 10z"/><path d="M2.6 13.1H3c.9 0 1.1-.2 1.1-1.4V4.2c0-1.1-.2-1.4-1.1-1.4h-.4v-.6h4.5v.7h-.3c-.9 0-1.1.2-1.1 1.4v3.2h4.6V4.2c0-1.1-.2-1.4-1.1-1.4h-.3v-.6h4.5v.7H13c-.9 0-1.1.2-1.1 1.4v7.5c0 1.1.2 1.4 1.1 1.4h.4v.7H8.9v-.7h.3c.9 0 1.1-.2 1.1-1.4V8.2H5.7v3.5c0 1.1.2 1.4 1.1 1.4h.3v.7H2.6v-.7z"/>
</symbol>
<symbol id="icon-menu" viewBox="0 0 24 28">
<path d="M24 21v2c0 .547-.453 1-1 1H1c-.547 0-1-.453-1-1v-2c0-.547.453-1 1-1h22c.547 0 1 .453 1 1zm0-8v2c0 .547-.453 1-1 1H1c-.547 0-1-.453-1-1v-2c0-.547.453-1 1-1h22c.547 0 1 .453 1 1zm0-8v2c0 .547-.453 1-1 1H1c-.547 0-1-.453-1-1V5c0-.547.453-1 1-1h22c.547 0 1 .453 1 1z"/>
</symbol>
</svg>
<div data-region="app">
<header data-region="banner">
<button data-nav-toggle data-toggle="button" aria-controls="nav" aria-pressed="false" type="button" data-toggle-synced="false">
<svg data-icon="menu" data-icon-size="nav-icon" ><title>menu</title><use xlink:href="#icon-menu" />
</svg>
</button>
<div class="project-title">
<a href="index.html" rel="home" class="project-name">Susy</a>
<span class="project-version">3.0.6</span>
</div>
</header>
<div data-region="container">
<nav data-region="nav" data-toggle="target" id="nav" data-target-id="nav" aria-expanded="false" data-auto-closing="false" data-auto-closing-on-any-click="false">
<form action="search.html">
<input type="text" name="q" placeholder="Search…" required minlength="3">
</form>
<div class="nav-subsection">
<h3 class="nav-home">
<a href="index.html" data-nav="is-not-active">Susy</a>
</h3>
<ul>
<li class="nav-item">
<a href="PHILOSOPHY.html" data-nav="is-not-active">Philosophy</a>
</li>
<li class="nav-item">
<a href="CHANGELOG.html" data-nav="is-not-active">Changelog</a>
</li>
<li class="nav-item">
<a href="CONTRIBUTING.html" data-nav="is-not-active">Contributing</a>
</li>
</ul>
</div>
<div class="nav-subsection">
<ul>
<li class="nav-subsection">
<h3 class="nav-title">Public Grid API</h3>
<ul>
<li class="nav-item">
<a href="config.html" data-nav="is-active">Grid Configuration</a>
</li>
<li class="nav-item">
<a href="api.html" data-nav="is-not-active">Grid Functions</a>
</li>
</ul>
</li>
<li class="nav-subsection">
<h3 class="nav-title">Extras</h3>
<ul>
<li class="nav-item">
<a href="plugin-utils.html" data-nav="is-not-active">Extending Susy</a>
</li>
<li class="nav-item">
<a href="su-math.html" data-nav="is-not-active">Su: Core Math<span class="widont"> </span>Engine</a>
</li>
<li class="nav-item">
<a href="plugin_svg-grid.html" data-nav="is-not-active">Plugin: SVG Grid<span class="widont"> </span>Image</a>
</li>
</ul>
</li>
<li class="nav-subsection">
<h3 class="nav-title">Internal Functions (Private)</h3>
<ul>
<li class="nav-item">
<a href="_normal.html" data-nav="is-not-active">Susy Normalization</a>
</li>
<li class="nav-item">
<a href="_parser.html" data-nav="is-not-active">Susy Syntax<span class="widont"> </span>Parser</a>
</li>
<li class="nav-item">
<a href="_validation.html" data-nav="is-not-active">Su Input<span class="widont"> </span>Validation</a>
</li>
<li class="nav-item">
<a href="_version.html" data-nav="is-not-active">Versioning</a>
</li>
</ul>
</li></ul>
</div>
<div class="nav-subsection">
<h3 class="nav-title">
External Links
</h3>
<ul>
<li class="nav-item">
<a href="http://oddbird.net/susy/" data-nav="is-not-active">Susy Website</a>
</li>
<li class="nav-item">
<a href="http://twitter.com/sasssusy/" data-nav="is-not-active">Twitter @SassSusy</a>
</li>
<li class="nav-item">
<a href="http://oddbird.net/2017/06/28/susy3" data-nav="is-not-active">Intro to<span class="widont"> </span>Susy3</a>
</li>
<li class="nav-item">
<a href="http://susy.readthedocs.io" data-nav="is-not-active">Susy2 Documentation</a>
</li>
<li class="nav-item">
<a href="http://oddbird.net/" data-nav="is-not-active">OddBird</a>
</li>
</ul>
</div>
<aside class="footer-credit">
<a href="http://oddbird.net/herman/" class="footer-icon">
<svg data-icon="logo" data-icon-size="footer-logo" ><use xlink:href="#icon-logo" />
</svg>
</a>
<span>
Documented with
<a href="http://oddbird.net/herman/" class="footer-link">
Herman
</a>
</span>
<span>
by
<a href="http://oddbird.net/" class="footer-link">
OddBird
</a>
</span>
</aside>
</nav>
<main data-region="main">
<nav class="breadcrumb">
<a href="index.html" >Susy</a> »
<strong>Grid Configuration</strong>
</nav>
<div data-page="config">
<section class="item" >
<div data-item-section="prose" class="text-block">
<h1 id="susy3-configuration">Susy3 Configuration</h1>
<p>Susy3 has 4 core settings, in a single settings map.
You’ll notice a few differences from<span class="widont"> </span>Susy2:</p>
<p><strong>Columns</strong> no longer accept a single number, like <code>12</code>,
but use a syntax more similar to the new
CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-template-columns">grid-template-columns</a> –
a list of relative sizes for each column on the grid.
Unitless numbers in Susy act very similar to <code>fr</code> units in CSS,
and the <code>susy-repeat()</code> function (similar to the css <code>repeat()</code>)
helps quickly establish equal-width<span class="widont"> </span>columns.</p>
<ul>
<li><code>susy-repeat(12)</code> will create 12 fluid, equal-width<span class="widont"> </span>columns</li>
<li><code>susy-repeat(6, 120px)</code> will create 6 equal <code>120px</code>-wide columns</li>
<li><code>120px susy-repeat(4) 120px</code> will create 6 columns,
the first and last are <code>120px</code>,
while the middle 4 are equal fractions of the remainder.
Susy will output <code>calc()</code> values in order to achieve<span class="widont"> </span>this.</li>
</ul>
<p><strong>Gutters</strong> haven’t changed –
a single fraction or explicit width –
but the <code>calc()</code> output feature
means you can now use any combination of units and fractions
to create static-gutters on a fluid grid,<span class="widont"> </span>etc.</p>
<p><strong>Spread</strong> existed in the Susy2 API as a span option,
and was otherwise handled behind the scenes.
Now we’re giving you full control over all spread issues.
You can find a more <a href="http://oddbird.net/2017/06/13/susy-spread/">detailed explanation of spread on the<span class="widont"> </span>blog</a>.</p>
<p>You can access your global settings at any time
with the <code>susy-settings()</code> function,
or grab a single setting from the global scope
with <code>susy-get('columns')</code>, <code>susy-get('gutters')</code> etc.</p>
</div>
<div data-item-section="related">
<h3 class="item-subtitle">
<span class="item-subtitle-main">Related</span>
</h3>
<div class="param-list">
<h4 class="param-title">
<a href="http://oddbird.net/2017/06/13/susy-spread/" class="item-name">Article: Understanding Spread in Susy3</a>
<span class="item-note">[external]</span>
</h4>
</div>
<div class="param-list">
<h4 class="param-title">
<a href="
config.html#variable--susy" class="item-name">$susy</a>
</h4>
</div>
<div class="param-list">
<h4 class="param-title">
<span class="item-type">@function</span>
<a href="
config.html#function--susy-settings" class="item-name">susy-settings()</a>
</h4>
</div>
<div class="param-list">
<h4 class="param-title">
<span class="item-type">@function</span>
<a href="
config.html#function--susy-get" class="item-name">susy-get()</a>
</h4>
</div>
</div>
</section>
<section class="item" id="variable--susy">
<div data-item-section="header">
<h2 class="item-title">
<span class="item-type"></span>
<a href="#variable--susy" class="item-name">$susy</a>
<span class="value-type">(Map)</span>
</h2>
<div class="code-block">
<div class="code-header">
<span class="code-language">
scss
</span>
</div>
<pre class="hljs-pre"><code class="lang-scss">$susy: () !default;</code></pre>
</div>
<div class="text-block">
<p>The grid is defined in a single map variable,
with four initial properties:
<code>columns</code>, <code>gutters</code>, <code>spread</code> and <code>container-spread</code>.
Anything you put in the root <code>$susy</code> variable map
will be treated as a global project default.
You can create similar configuration maps
under different variable names,
to override the defaults<span class="widont"> </span>as-needed.</p>
<section class="summary-subsection">
<h3 class="summary-subtitle">Since <code>3.0.0-beta.1</code>:</h3>
<div class="subsection-details"><p><code>columns</code> setting no longer accepts numbers
(e.g. <code>12</code>) for symmetrical fluid grids,
or the initial <code>12 x 120px</code> syntax for
symmetrical fixed-unit grids.
Use <code>susy-repeat(12)</code> or <code>susy-repeat(12, 120px)</code> instead.</p>
</div>
</section>
</div>
</div>
<div data-item-section="property">
<h3 class="item-subtitle">
<span class="item-subtitle-main">Map Properties</span>
</h3>
<div class="param-list">
<h4 class="param-title">
<span class="item-name">columns:</span>
<span class="value-type">(list)</span>
</h4>
<div class="param-details text-block">
<p>Columns are described by a list of numbers,
representing the relative width of each column.
The syntax is a simplified version of CSS native
<code>grid-template-columns</code>,
expecting a list of grid-column widths.
Unitless numbers create fractional fluid columns
(similar to the CSS-native <code>fr</code> unit),
while length values (united numbers)
are used to define static columns.
You can mix-and match units and fractions,
to create a mixed grid.
Susy will generate <code>calc()</code> values when necessary,
to make all your units work<span class="widont"> </span>together.</p>
<p>Use the <code>susy-repeat($count, $value)</code> function
to more easily repetative columns,
similar to the CSS-native <code>repeat()</code>.</p>
<ul>
<li><code>susy-repeat(8)</code>:
an 8-column, symmetrical, fluid grid.
<br />Identical to <code>(1 1 1 1 1 1 1 1)</code>.</li>
<li><code>susy-repeat(6, 8em)</code>:
a 6-column, symmetrical, em-based grid.
<br />Identical to <code>(8em 8em 8em 8em 8em 8em)</code>.</li>
<li><code>(300px susy-repeat(4) 300px)</code>:
a 6-column, asymmetrical, mixed fluid/static grid
using <code>calc()</code> output.
<br />Identical to <code>(300px 1 1 1 1 300px)</code>.</li>
</ul>
<p><strong>NOTE</strong> that <code>12</code> is no longer a valid 12-column grid definition,
and you must list all the columns individually
(or by using the <code>susy-repeat()</code> function).</p>
</div>
</div>
<div class="param-list">
<h4 class="param-title">
<span class="item-name">gutters:</span>
<span class="value-type">(number)</span>
</h4>
<div class="param-details text-block">
<p>Gutters are defined as a single width,
or fluid ratio, similar to the native-CSS
<code>grid-column-gap</code> syntax.
Similar to columns,
gutters can use any valid CSS length unit,
or unitless numbers to define a relative<span class="widont"> </span>fraction.</p>
<ul>
<li><code>0.5</code>:
a fluid gutter, half the size of a single-fraction<span class="widont"> </span>column.</li>
<li><code>1em</code>:
a static gutter, <code>1em</code> wide.</li>
</ul>
<p>Mix static gutters with fluid columns, or vice versa,
and Susy will generate the required <code>calc()</code> to make it<span class="widont"> </span>work.</p>
</div>
</div>
<div class="param-list">
<h4 class="param-title">
<span class="item-name">spread:</span>
<span class="item-value">narrow</span>
<span class="value-type">(string)</span>
</h4>
<div class="param-details text-block">
<p>Spread of an element across adjacent gutters:
either <code>narrow</code> (none), <code>wide</code> (one), or <code>wider</code> (two)</p>
<ul>
<li>Both spread settings default to <code>narrow</code>,
the most common use-case.
A <code>narrow</code> spread only has gutters <em>between</em> columns
(one less gutter than columns).
This is how all css-native grids work,
and most margin-based grid<span class="widont"> </span>systems.</li>
<li>A <code>wide</code> spread includes the same number of gutters as columns,
spanning across a single side-gutter.
This is how most padding-based grid systems often work,
and is also useful for pushing and pulling elements into<span class="widont"> </span>place.</li>
<li>The rare <code>wider</code> spread includes gutters
on both sides of the column-span
(one more gutters than<span class="widont"> </span>columns).</li>
</ul>
</div>
</div>
<div class="param-list">
<h4 class="param-title">
<span class="item-name">container-spread:</span>
<span class="item-value">narrow</span>
<span class="value-type">(string)</span>
</h4>
<div class="param-details text-block">
<p>Spread of a container around adjacent gutters:
either <code>narrow</code> (none), <code>wide</code> (one), or <code>wider</code> (two).
See <code>spread</code> property for<span class="widont"> </span>details.</p>
</div>
</div>
</div>
<div data-item-section="examples">
<h3 class="item-subtitle">
<span class="item-subtitle-main">Examples</span>
</h3>
<div class="example">
<div class="example-code">
<div class="code-block">
<div class="code-header">
<span class="code-language">
scss
</span>
<span class='code-description'>
default values
</span>
</div>
<pre class="hljs-pre"><code class="lang-scss">// 4 symmetrical, fluid columns
// gutters are 1/4 the size of a column
// elements span 1 less gutter than columns
// containers span 1 less gutter as well
$susy: (
'columns': susy-repeat(4),
'gutters': 0.25,
'spread': 'narrow',
'container-spread': 'narrow',
);</code></pre>
</div>
</div>
</div>
<div class="example">
<div class="example-code">
<div class="code-block">
<div class="code-header">
<span class="code-language">
scss
</span>
<span class='code-description'>
inside-static gutters
</span>
</div>
<pre class="hljs-pre"><code class="lang-scss">// 6 symmetrical, fluid columns…
// gutters are static, triggering calc()…
// elements span equal columns & gutters…
// containers span equal columns & gutters…
$susy: (
'columns': susy-repeat(6),
'gutters': 0.5em,
'spread': 'wide',
'container-spread': 'wide',
);</code></pre>
</div>
</div>
</div>
</div>
<div data-item-section="related">
<h3 class="item-subtitle">
<span class="item-subtitle-main">Related</span>
</h3>
<div class="param-list">
<h4 class="param-title">
<a href="https://codepen.io/mirisuzanne/pen/EgmJJp?editors=1100" class="item-name">Spread examples on CodePen</a>
<span class="item-note">[external]</span>
</h4>
</div>
<div class="param-list">
<h4 class="param-title">
<span class="item-name">$_susy-defaults</span>
<span class="item-note">[private]</span>
</h4>
</div>
<div class="param-list">
<h4 class="param-title">
<span class="item-type">@function</span>
<a href="
config.html#function--susy-repeat" class="item-name">susy-repeat()</a>
</h4>
</div>
</div>
<div data-item-section="used-by">
<h3 class="item-subtitle">
<span class="item-subtitle-main">Used By</span>
</h3>
<div class="param-list">
<h4 class="param-title">