susy 2.0.0.beta.2 → 2.0.0.beta.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9db5246394497a4752238d5b432ce4e2e173995a
4
- data.tar.gz: 06daf5683a28b569dcbca57308e3c07f5ed918ed
3
+ metadata.gz: 3a8a770621f5c94d8e367a8019a22f9cbf70d4ad
4
+ data.tar.gz: 9a1c8cd9a1b701054eac039ac46036db8bb29a32
5
5
  SHA512:
6
- metadata.gz: 21cf7cb67d634c0ed2a87819416148bbf9708b3b12b0ecf17e44b4675289a812522cb465f25f29101fe72b7d706ca7435a229ad14cffa80294f36bdd8e2562da
7
- data.tar.gz: 39670449c17c8edbb172a4fc284627d0e3657c2efef048258c18f6a5f08260c31b92f4d7122369f9d45df89440e2facd831e82f72630b78eacdbb14f3ab05b4b
6
+ metadata.gz: 0547e1ab69123432985801feacc22c1a7c7e0386874c71940131a0a774d5a60c941c4b0911276ba8878dcc37ad5b814b0a8e7763c816fecafc9c07bf357eb3e3
7
+ data.tar.gz: 3bb35def7bf985cf7aba9f78e80dac528bedcb69788a3f0b78ced2d18155ab6e61802d7fd64b7fba69e33ca0af134a349a7ac5862820087be227facf7a18d6ff
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.beta.1
1
+ 2.0.0.beta.2
data/docs/changelog.rst CHANGED
@@ -2,6 +2,15 @@ Changelog
2
2
  =========
3
3
 
4
4
 
5
+ 2.0.0.beta.3 — Jan 10 2014
6
+ --------------------------
7
+
8
+ - Fix a bug making ``show-grid`` unaware of local ``debug/output`` keywords.
9
+ - Added Susyone syntax for those that need to use the old Susy syntax,
10
+ with updated Sass and Compass.
11
+
12
+ + ``@import 'susyone';``
13
+
5
14
  2.0.0.beta.2 — Jan 6 2014
6
15
  -------------------------
7
16
 
@@ -0,0 +1,4 @@
1
+ // Susy
2
+ // ====
3
+
4
+ @import "susy/language/susyone";
@@ -0,0 +1,15 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Partials
3
+
4
+ // temporary
5
+ @import "susyone/units";
6
+
7
+ // permanent
8
+ @import "susyone/settings";
9
+ @import "susyone/functions";
10
+ @import "susyone/grid";
11
+ @import "susyone/isolation";
12
+ @import "susyone/padding";
13
+ @import "susyone/margin";
14
+ @import "susyone/media";
15
+ @import "susyone/background";
@@ -365,5 +365,5 @@ $susy-overlay-grid-head-exists: false;
365
365
  $grid: $susy
366
366
  ) {
367
367
  $key: join(debug, $key, space);
368
- @return susy-get($key);
368
+ @return susy-get($key, $grid);
369
369
  }
@@ -0,0 +1,18 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ @import "compass/layout/grid-background";
5
+ @import "compass/css3/background-origin";
6
+ @import "compass/css3/background-clip";
7
+
8
+ // ---------------------------------------------------------------------------
9
+ // Susy Grid Background
10
+ //
11
+ // A wrapper for the compass "column-grid-background" mixin
12
+ // Uses all your settings to create a grid background for a container element.
13
+ // Note: Sub-pixel rounding can lead to several pixels of variation between browsers.
14
+ @mixin susy-grid-background(){
15
+ @include column-grid-background($total-columns, column(), gutter(), 0);
16
+ @include background-origin(content-box);
17
+ @include background-clip(content-box);
18
+ }
@@ -0,0 +1,372 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ // We need access to some basic font settings for handling media-queries.
5
+ @import "compass/typography/vertical_rhythm";
6
+
7
+ // For now, we also need this...
8
+ $browser-default-font-size-px : 16px;
9
+ $browser-default-font-size-percent : 100%;
10
+ $browser-default-font-size-pt : 12pt;
11
+
12
+ $rem-with-px-fallback : true !default;
13
+
14
+ // ---------------------------------------------------------------------------
15
+ // Sass list Functions
16
+
17
+ // Return a list with specific items removed
18
+ //
19
+ // filter($list, $target)
20
+ // - $list : The list to filter.
21
+ // - $target : An item to be removed from the list.
22
+ @function filter($list, $target) {
23
+ $clean: compact();
24
+ @if index($list, $target) {
25
+ @each $item in $list {
26
+ $clean: if($item == $target, $clean, append($clean, $item));
27
+ }
28
+ } @else { $clean: $list; }
29
+ @return $clean;
30
+ }
31
+
32
+ // ---------------------------------------------------------------------------
33
+ // Don't use static output when it will break things
34
+
35
+ // Switch element-level output to fluid, when container-width is wrong for static
36
+ //
37
+ // fix-static-misalignment([$style, $width])
38
+ // - $style: $container-style.
39
+ // - $width: $container-width.
40
+ @function fix-static-misalignment(
41
+ $style: $container-style,
42
+ $width: $container-width
43
+ ) {
44
+ @if $container-width and $container-width != container-outer-width($width: false) {
45
+ $style: fluid;
46
+ }
47
+ @return $style;
48
+ }
49
+
50
+ // ---------------------------------------------------------------------------
51
+ // Grid Functions
52
+
53
+ // Returns the full width of a grid based on your grid settings.
54
+ //
55
+ // $columns : The number of columns to get width for.
56
+ @function columns-width(
57
+ $columns : $total-columns
58
+ ) {
59
+ @if round($columns) != $columns {
60
+ @warn "Susy works best with integer column-spans.
61
+ For partial-columns, you may need to finesse the math by hand using functions directly.";
62
+ }
63
+ @return ($columns * $column-width) + (if($columns >= 1, ceil($columns - 1), 0) * $gutter-width);
64
+ }
65
+
66
+ // Return the grid width after adding or subtracting grid padding
67
+ //
68
+ // $width : the width of the grid without padding;
69
+ // $operation : ( add | subtract ) if padding should be added or subtracted;
70
+ @function handle-grid-padding(
71
+ $width,
72
+ $operation : subtract
73
+ ) {
74
+ $pad: $grid-padding*2;
75
+
76
+ @if comparable($width, $grid-padding) {
77
+ $width: if($operation == subtract, $width - $pad, $width + $pad);
78
+ } @else {
79
+ @warn "$grid-padding must be set in units comparable to the container width.";
80
+ }
81
+
82
+ @return $width;
83
+ }
84
+
85
+ // Return the full outer width of a Container element.
86
+ //
87
+ // $columns : The number of columns in the Grid Layout.
88
+ @function container-outer-width(
89
+ $columns : $total-columns,
90
+ $width : $container-width
91
+ ) {
92
+ $outerwidth: if($width, $width, columns-width($columns));
93
+
94
+ @if $width {
95
+ @if not $border-box-sizing { $outerwidth: handle-grid-padding($outerwidth, subtract); }
96
+ } @else {
97
+ @if $border-box-sizing { $outerwidth: handle-grid-padding($outerwidth, add); }
98
+ }
99
+
100
+ @return $outerwidth;
101
+ }
102
+
103
+ // Return the percentage width of a single column in a given 'context'.
104
+ //
105
+ // $context : The grid context in columns, if nested.
106
+ // $style : The container style to use.
107
+ @function column(
108
+ $context : $total-columns,
109
+ $style : fix-static-misalignment()
110
+ ) {
111
+ @return if($style == static, $column-width, relative-width($column-width, $context));
112
+ }
113
+
114
+ // Return the percentage width of multiple 'columns' in a given 'context'.
115
+ //
116
+ // $columns : The number of columns to get relative width for.
117
+ // $context : The grid context in columns, if nested.
118
+ // $style : The container style to use.
119
+ @function columns(
120
+ $columns,
121
+ $context : $total-columns,
122
+ $style : fix-static-misalignment()
123
+ ) {
124
+ @return if($style == static, columns-width($columns), relative-width(columns-width($columns), $context));
125
+ }
126
+
127
+ // Return the percentage width of a single gutter in a given 'context'.
128
+ //
129
+ // $context : The grid context in columns, if nested.
130
+ // $style : The container style to use.
131
+ @function gutter(
132
+ $context : $total-columns,
133
+ $style : fix-static-misalignment()
134
+ ) {
135
+ @return if($style == static, $gutter-width, relative-width($gutter-width, $context));
136
+ }
137
+
138
+ // Return the percentage width of a given value in a given 'context'.
139
+ //
140
+ // $width : Any given width value.
141
+ // $context : The grid context in columns, if nested.
142
+ @function relative-width(
143
+ $width,
144
+ $context : $total-columns
145
+ ) {
146
+ @return percentage($width / columns-width($context));
147
+ }
148
+
149
+ // Return the total space occupied by multiple columns and associated gutters.
150
+ // Useful for adding padding or margins (prefix, suffix, push, pull, etc.)
151
+ //
152
+ // $columns : The number of columns to get relative space for.
153
+ // $context : The grid context in columns, if nested.
154
+ // $style : The container style to use.
155
+ @function space(
156
+ $columns,
157
+ $context : $total-columns,
158
+ $style : fix-static-misalignment()
159
+ ) {
160
+ @return columns($columns, $context, $style) + if($columns >= 1, gutter($context, $style), 0);
161
+ }
162
+
163
+ // Accept a list including column-count and (optional) position.
164
+ // Return either the column count or the position alone.
165
+ //
166
+ // $columns : the list to split and interprate.
167
+ // $request : The value to return, either 'columns' or 'position'.
168
+ @function split-columns-value(
169
+ $columns,
170
+ $request : columns
171
+ ) {
172
+ $pos : false;
173
+ $cols : false;
174
+
175
+ @each $var in $columns {
176
+ @if (type-of($var) == 'string') {
177
+ $pos: $var;
178
+ } @else {
179
+ @if (type-of($var) == 'number') and (unitless($var)) {
180
+ $cols: $var;
181
+ } @else {
182
+ @warn '"#{$var}" is not a valid part of "$columns: #{$columns}" in the columns() mixin.';
183
+ }
184
+ }
185
+ }
186
+
187
+ @if $request == 'columns' {
188
+ @return $cols;
189
+ } @else {
190
+ @if $request == 'position' {
191
+ @return $pos;
192
+ } @else {
193
+ @warn '"#{$request}"" is not a valid value for $request';
194
+ }
195
+ }
196
+ }
197
+
198
+ // Accept nth-selector variables, and format them as a valid CSS3 selector.
199
+ //
200
+ // $n : [first | only | last | <equation>]
201
+ // $selector : [child | last-child | of-type | last-of-type ]
202
+ @function format-nth(
203
+ $n : last,
204
+ $selector : child
205
+ ) {
206
+ @if ($n == 'last') or ($n =='first') or ($n =='only') {
207
+ $selector: '#{$n}-#{$selector}';
208
+ } @else {
209
+ $selector: 'nth-#{$selector}(#{$n})';
210
+ }
211
+ @return $selector;
212
+ }
213
+
214
+ // ---------------------------------------------------------------------------
215
+ // Media Functions
216
+
217
+ // Return an em value adjusted to match the browser default font size.
218
+ // Note: This only works if actual sizes are set relative to browser defaults.
219
+ //
220
+ // $ems : The initial value to be converted.
221
+ // $font-size : The current font-size in.
222
+ @function base-ems(
223
+ $ems,
224
+ $font-size: $base-font-size
225
+ ){
226
+ $font-size : if(unit($ems) == 'rem', $base-font-size, $font-size);
227
+ $unit : unit($font-size);
228
+ $mult : $ems / ($ems * 0 + 1);
229
+
230
+ @if $unit == 'px' {
231
+ @return $font-size / $browser-default-font-size-px * $mult * 1em;
232
+ }
233
+ @else if $unit == '%' {
234
+ @return $font-size / $browser-default-font-size-percent * $mult * 1em;
235
+ }
236
+ @else if $unit == 'em' {
237
+ @return $font-size / 1em * $mult * 1em;
238
+ }
239
+ @else if $unit == 'pt' {
240
+ @return $font-size / $browser-default-font-size-pt * $mult * 1em;
241
+ }
242
+ @else {
243
+ @warn 'Variable $base-font-size does not have a valid font unit. Valid units for fonts in CSS are px, pt, em, and %.';
244
+ }
245
+ }
246
+
247
+ // This name will be deprecated...
248
+ @function absolute-ems($ems, $font-size: $base-font-size){ @return base-ems($ems, $font-size); }
249
+
250
+ // Return a length, after any em-values have been sent through absolute-ems().
251
+ //
252
+ // $length : The length value to be checked and adjusted if necessary.
253
+ // $font-size : The current font-size in px.
254
+ @function fix-ems(
255
+ $length,
256
+ $font-size: $base-font-size
257
+ ){
258
+ @if $length {
259
+ @if (unit($length) == 'em') or (unit($length) == 'rem') {
260
+ $length: absolute-ems($length,$font-size);
261
+ }
262
+ }
263
+ @return $length;
264
+ }
265
+
266
+ // Sort a list of arguments into "$min $layout $max $ie" order, and return the list.
267
+ //
268
+ // $media-layout : a list of values [$min $layout $max $ie] including...
269
+ // : - one unitless number (columns in a layout)
270
+ // : - two optional lengths (min and max-width media-query breakpoints).
271
+ // : - one optional boolean or string to trigger fallback support for IE.
272
+ // $font-size : [optional] The base font-size of your layout, if you are using ems.
273
+ // : - defaults to $base-font-size
274
+ @function medialayout(
275
+ $media-layout,
276
+ $font-size: $base-font-size
277
+ ) {
278
+ $media : false;
279
+ $min : false;
280
+ $layout : false;
281
+ $max : false;
282
+ $ie : false;
283
+ $has-layout : false;
284
+
285
+ @each $val in $media-layout {
286
+ @if (type-of($val) == "number") {
287
+ @if unitless($val) {
288
+ $layout : $val;
289
+ $has-layout : true;
290
+ } @else {
291
+ @if ($has-layout) and (not $media) {
292
+ $max: $val;
293
+ } @else {
294
+ @if $media {
295
+ $media: join($media,$val);
296
+ } @else {
297
+ $media: $val;
298
+ }
299
+ }
300
+ }
301
+ } @else {
302
+ $ie: $val;
303
+ }
304
+ }
305
+ @if (length($media) > 0) {
306
+ @if (length($media) == 1) {
307
+ $min: nth($media,1);
308
+ } @else {
309
+ $min: nth($media,1);
310
+ $max: nth($media,2);
311
+ @if comparable($min, $max) {
312
+ @if ($min > $max) {
313
+ $max: nth($media,1);
314
+ $min: nth($media,2);
315
+ }
316
+ } @else {
317
+ @warn "Can't compare incompatible units.
318
+ Using #{$min} for min-width, and #{$max} for max-width";
319
+ }
320
+ @if (length($media) > 2) {
321
+ @warn "You can only send two lengths: a min-width and an (optional) max-width.
322
+ You sent #{length($media)}: #{$media}";
323
+ }
324
+ }
325
+ }
326
+
327
+ // media-queries must be set in ems relative to the browser default
328
+ // rather than the font-size set in CSS.
329
+ $min: fix-ems($min,$font-size);
330
+ $max: fix-ems($max,$font-size);
331
+
332
+ @return $min $layout $max $ie;
333
+ }
334
+
335
+ // Return the nearest layout (column-count) above a given breakpoint.
336
+ //
337
+ // $min : The min-width media-query breakpoint above which to establish a new layout.
338
+ @function get-layout (
339
+ $min
340
+ ) {
341
+ $min : fix-ems($min);
342
+ $return : false;
343
+
344
+ @if comparable($min, $column-width) {
345
+ $return : ceil(($min + $gutter-width) / ($column-width + $gutter-width));
346
+ } @else {
347
+ @warn "Can't determine a layout, becuse #{$min} and #{$column-width} are not comparable.";
348
+ }
349
+
350
+ @return $return;
351
+ }
352
+
353
+ // Check to see if a given $media-layout list is simply the default.
354
+ //
355
+ // $media-layout : a list of values including -
356
+ // : One unitless number (columns in a layout)
357
+ // : Two optional lengths (min and max-width media-query breakpoints).
358
+ // : One optional boolean or string to trigger fallback support for IE.
359
+ @function is-default-layout(
360
+ $media-layout
361
+ ) {
362
+ $media-layout : medialayout($media-layout);
363
+ $min : nth($media-layout,1);
364
+ $layout-cols : nth($media-layout,2);
365
+ $max : nth($media-layout,3);
366
+
367
+ @if $min or $max {
368
+ @return false;
369
+ } @else {
370
+ @return if($layout-cols == $total-columns,true,false);
371
+ }
372
+ }