susy 2.0.0.alpha.2 → 2.0.0.alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +7 -0
  2. data/lib/susy.rb +0 -10
  3. data/sass/_susy.scss +2 -2
  4. data/sass/susy/_core.scss +3 -3
  5. data/sass/susy/_helpers.scss +2 -3
  6. data/sass/susy/_math.scss +2 -2
  7. data/sass/susy/_settings.scss +4 -39
  8. data/sass/susy/api/_float.scss +2 -2
  9. data/sass/susy/api/_shared.scss +2 -2
  10. data/sass/susy/api/float/_container.scss +9 -5
  11. data/sass/susy/api/float/_end.scss +8 -4
  12. data/sass/susy/api/float/_isolate.scss +7 -3
  13. data/sass/susy/api/float/_span.scss +18 -4
  14. data/sass/susy/api/shared/_container.scss +10 -6
  15. data/sass/susy/api/shared/_grid-background.scss +30 -7
  16. data/sass/susy/api/shared/_margins.scss +9 -5
  17. data/sass/susy/api/shared/_padding.scss +9 -5
  18. data/sass/susy/helpers/_direction.scss +11 -1
  19. data/sass/susy/helpers/_nth.scss +4 -0
  20. data/sass/susy/language/_shared.scss +2 -3
  21. data/sass/susy/language/_susy.scss +5 -4
  22. data/sass/susy/language/shared/_context.scss +10 -9
  23. data/sass/susy/language/shared/_settings.scss +181 -101
  24. data/sass/susy/language/susy/_background.scss +84 -75
  25. data/sass/susy/language/susy/_container.scss +57 -77
  26. data/sass/susy/language/susy/_gallery.scss +46 -67
  27. data/sass/susy/language/susy/_gutters.scss +117 -0
  28. data/sass/susy/language/susy/_isolate.scss +21 -14
  29. data/sass/susy/language/susy/_margins.scss +92 -0
  30. data/sass/susy/language/susy/_padding.scss +68 -0
  31. data/sass/susy/language/susy/_rows.scss +43 -15
  32. data/sass/susy/language/susy/_span.scss +198 -61
  33. data/sass/susy/language/susy1/_settings.scss +13 -23
  34. data/sass/susy/math/_columns.scss +26 -3
  35. data/sass/susy/math/_container.scss +17 -12
  36. data/sass/susy/math/_location.scss +13 -0
  37. metadata +8 -35
  38. data/sass/susy/helpers/_sass-lists.scss +0 -90
  39. data/sass/susy/language/susy/_functions.scss +0 -58
  40. data/sass/susy/language/susy/_math.scss +0 -153
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA512:
3
+ data.tar.gz: 7bc217525b1ca257b1d45a1bdd688ddc09417358c26228cc53083ba64f914ec1057154f51feefb76c0cf463a8ab52f368227219b69c978d73951cafdea5f1e9a
4
+ metadata.gz: 0c0f837b5286717bf4dfdcd78bddafd15b19ee4d5aa9441a63774f160490133e27a5bf09f77d617c959ae883da55b93b979d959c75286fb1e09ff96700d1be92
5
+ SHA1:
6
+ data.tar.gz: db4197b6108f2e34188ca74fa198bf0677ced5d3
7
+ metadata.gz: d7a5ba312e875a4172e9e391ee7cc22d9c46b21d
@@ -2,13 +2,3 @@ require 'compass'
2
2
  Compass::Frameworks.register('susy',
3
3
  :stylesheets_directory => File.join(File.dirname(__FILE__), '..', 'sass'),
4
4
  :templates_directory => File.join(File.dirname(__FILE__), '..', 'templates'))
5
-
6
- module Sass::Script::Functions
7
-
8
- # Convert a grid piece from strings to numbers
9
- def grid_to_numbers(piece)
10
- items = piece.to_s.split(' ')
11
- Sass::Script::List.new(items.map{|i| Sass::Script::Number.new(i.to_f)}, :comma)
12
- end
13
-
14
- end
@@ -1,4 +1,4 @@
1
- // Susy partials
2
- // =============
1
+ // Susy
2
+ // ====
3
3
 
4
4
  @import "susy/language/susy";
@@ -1,6 +1,6 @@
1
- // The Susy Core
2
- // =============
1
+ // Susy Core
2
+ // =========
3
3
 
4
4
  @import "settings";
5
5
  @import "helpers";
6
- @import "math";
6
+ @import "math";
@@ -1,6 +1,5 @@
1
- // Helper partials
2
- // ===============
1
+ // Helpers
2
+ // =======
3
3
 
4
- @import "helpers/sass-lists";
5
4
  @import "helpers/direction";
6
5
  @import "helpers/nth";
@@ -1,5 +1,5 @@
1
- // Math partials
2
- // =============
1
+ // Math
2
+ // ====
3
3
 
4
4
  @import "math/container";
5
5
  @import "math/columns";
@@ -1,52 +1,17 @@
1
1
  // Settings
2
2
  // ========
3
3
 
4
- // Grid basics
4
+ // Grid Basics
5
5
  // -----------
6
6
 
7
7
  $columns : 4 !default;
8
8
  $gutters : .25 !default;
9
9
 
10
-
11
- // Grid widths [optional]
10
+ // Grid Widths [optional]
12
11
  // ----------------------
13
- //
14
12
  // - Set EITHER $column-width OR $container
13
+ // - Use $column-width for static layouts
15
14
  // - We can determine one from the other, but we can't resolve conflicts
16
15
 
17
16
  $column-width : false !default;
18
- $container : false !default;
19
-
20
-
21
- // Output
22
- // ------
23
-
24
- // global toggle for static/fluid output
25
- $static : false !default;
26
-
27
- // global toggle for isolate/float output
28
- $isolate : false !default;
29
-
30
- // global toggle for ltr/rtl output
31
- $flow : ltr !default;
32
-
33
- // global toggle for box-sizing
34
- $box-sizing : false !default;
35
-
36
- // Defaults
37
- // --------
38
-
39
- // Default container justification
40
- // - left | center | right
41
- $container-position : center !default;
42
-
43
- // Default gutter handling
44
- // - before | after | split
45
- $gutter-placement : after;
46
-
47
-
48
- // Debug
49
- // -----
50
-
51
- // global toggle to show/hide grids
52
- $show-grids : show !default;
17
+ $container : auto !default;
@@ -1,5 +1,5 @@
1
- // Float api partials
2
- // ==================
1
+ // Float API
2
+ // =========
3
3
 
4
4
  @import "float/container";
5
5
  @import "float/span";
@@ -1,5 +1,5 @@
1
- // Shared partials
2
- // ===============
1
+ // Shared API
2
+ // ==========
3
3
 
4
4
  @import "shared/grid-background";
5
5
  @import "shared/container";
@@ -1,12 +1,16 @@
1
- // Float container
2
- // ===============
1
+ // Float Container API
2
+ // ===================
3
3
 
4
- // Output a know float container
4
+ // Float Container
5
+ // ---------------
6
+ // - [$width] : <length>
7
+ // - [$justify] : left | center | right
8
+ // - [$layout-math] : fluid | static
5
9
  @mixin float-container(
6
10
  $width : $container,
7
11
  $justify : $container-position,
8
- $show-grids : $show-grids
12
+ $layout-math : $layout-math
9
13
  ) {
10
14
  @include pie-clearfix;
11
- @include container-output($width, $justify, $show-grids);
15
+ @include container-output($width, $justify, $layout-math);
12
16
  }
@@ -1,7 +1,9 @@
1
- // Float ends
2
- // ==========
1
+ // Float Ends API
2
+ // ==============
3
3
 
4
- // Last Unit
4
+ // Float Last
5
+ // ----------
6
+ // - [$flow] : ltr | rtl
5
7
  @mixin float-last(
6
8
  $flow: $flow
7
9
  ) {
@@ -11,7 +13,9 @@
11
13
  margin-#{$to}: 0;
12
14
  }
13
15
 
14
- // Last Unit
16
+ // Float First
17
+ // -----------
18
+ // - [$flow] : ltr | rtl
15
19
  @mixin float-first(
16
20
  $flow: $flow
17
21
  ) {
@@ -1,7 +1,10 @@
1
- // Float Isolation
2
- // ===============
1
+ // Float Isolation API
2
+ // ===================
3
3
 
4
- // Isolation Override
4
+ // Isolate Output
5
+ // --------------
6
+ // - $push : <length>
7
+ // - [$flow] : ltr | rtl
5
8
  @mixin isolate-output(
6
9
  $push,
7
10
  $flow : $flow
@@ -9,6 +12,7 @@
9
12
  $to : to($flow);
10
13
  $from : from($flow);
11
14
 
15
+ float: $from;
12
16
  margin-#{$from}: $push;
13
17
  margin-#{$to}: -100%;
14
18
  }
@@ -1,10 +1,18 @@
1
- // Float span
2
- // ==========
1
+ // Float Span API
2
+ // ==============
3
3
 
4
- // Output span
4
+ // Float Span Output
5
+ // -----------------
6
+ // - $width : <length>
7
+ // - [$float] : from | to
8
+ // - [$margin-before] : <length>
9
+ // - [$margin-after] : <length>
10
+ // - [$padding-before] : <length>
11
+ // - [$padding-after] : <length>
12
+ // - [$flow] : ltr | rtl
5
13
  @mixin float-span-output(
6
14
  $width,
7
- $float : from($flow),
15
+ $float : from,
8
16
  $margin-before : null,
9
17
  $margin-after : null,
10
18
  $padding-before : null,
@@ -14,6 +22,12 @@
14
22
  $to : to($flow);
15
23
  $from : from($flow);
16
24
 
25
+ @if $float {
26
+ $float: if($float == to, $to, $from);
27
+ } @else {
28
+ $float: null;
29
+ }
30
+
17
31
  width: $width;
18
32
  float: $float;
19
33
  margin-#{$from}: $margin-before;
@@ -1,14 +1,18 @@
1
- // Shared container output
2
- // =======================
1
+ // Shared Container API
2
+ // ====================
3
3
 
4
- // Output container styles
4
+ // Container Output
5
+ // ----------------
6
+ // - [$width] : <length>
7
+ // - [$justify] : left | center | right
8
+ // - [$layout-math] : fluid | static
5
9
  @mixin container-output(
6
10
  $width : $container,
7
11
  $justify : $container-position,
8
- $show-grids : $show-grids
12
+ $layout-math : $layout-math
9
13
  ) {
10
14
  $position : parse-container-position($justify);
11
- $property : if($static, width, max-width);
15
+ $property : if($layout-math == static, width, max-width);
12
16
  $left : nth($position,1);
13
17
  $right : nth($position,2);
14
18
 
@@ -19,4 +23,4 @@
19
23
  #{$property}: $width;
20
24
  margin-left: $left;
21
25
  margin-right: $right;
22
- }
26
+ }
@@ -1,20 +1,43 @@
1
- // -------------------------
2
- // Grid Overlay & Background
3
- //
4
- // Note: Sub-pixel rounding can lead to several pixels of variation between browsers.
1
+ // Grid Background API
2
+ // ===================
3
+ // - Sub-pixel rounding can lead to several pixels variation between browsers.
5
4
 
6
5
  @import "compass/css3";
6
+ @import "compass/layout/grid-background";
7
7
 
8
8
  // Grid Background Output
9
9
  // ----------------------
10
-
10
+ // $stops : <list> (gradient color-stops)
11
+ // [$show] : show | show-columns | show-gutters | hide
12
+ // [$flow] : ltr | rtl
11
13
  @mixin grid-background-output (
12
14
  $stops,
15
+ $show : $show-grids,
13
16
  $flow : $flow
14
17
  ) {
15
18
  $to : to($flow);
16
19
  $from : from($flow);
17
20
 
18
- @include background(linear-gradient($from, $stops...));
19
- background: linear-gradient(to $to, $stops...);
21
+ // set the proper background gradient
22
+ $background: ();
23
+
24
+ @if $show and $show != hide {
25
+
26
+ @if $show != show-columns {
27
+ $background: append($background, get-baseline-gradient(), comma);
28
+ }
29
+
30
+ @if $show != show-baseline {
31
+ $background: append($background, linear-gradient($from, $stops...), comma);
32
+ }
33
+
34
+ // output styles
35
+ @include background($background);
36
+
37
+ @if $show != show-columns {
38
+ @include background-size(100% $base-line-height);
39
+ background-position: left top;
40
+ }
41
+
42
+ }
20
43
  }
@@ -1,11 +1,15 @@
1
- // Margins
2
- // =======
1
+ // Margins API
2
+ // ===========
3
3
 
4
- // Add margin before or after an element
4
+ // Margin Output
5
+ // -------------
6
+ // - $before : <length>
7
+ // - $after : <length>
8
+ // - [$flow] : ltr | rtl
5
9
  @mixin margin-output(
6
10
  $before,
7
- $after : $before,
8
- $flow : $flow
11
+ $after,
12
+ $flow: $flow
9
13
  ) {
10
14
  $to: to($flow);
11
15
  $from: from($flow);
@@ -1,11 +1,15 @@
1
- // Padding
2
- // =======
1
+ // Padding API
2
+ // ===========
3
3
 
4
- // Add padding before or after an element
4
+ // Padding Output
5
+ // --------------
6
+ // - $before : <length>
7
+ // - $after : <length>
8
+ // - [$flow] : ltr | rtl
5
9
  @mixin padding-output(
6
10
  $before,
7
- $after : $before,
8
- $flow : $flow
11
+ $after,
12
+ $flow: $flow
9
13
  ) {
10
14
  $to: to($flow);
11
15
  $from: from($flow);
@@ -1,7 +1,11 @@
1
- // Direction helpers
1
+ // Direction Helpers
2
2
  // =================
3
3
 
4
+ // Get Direction
5
+ // -------------
4
6
  // Return the 'from' or 'to' direction of a ltr or rtl flow.
7
+ // - [$flow] : ltr | rtl
8
+ // - [$key] : from | to
5
9
  @function get-direction(
6
10
  $flow: $flow,
7
11
  $key: from
@@ -13,14 +17,20 @@
13
17
  @else if $key == to { @return $to; }
14
18
  }
15
19
 
20
+ // To
21
+ // --
16
22
  // Return the 'to' direction of a flow
23
+ // - [$flow] : ltr | rtl
17
24
  @function to(
18
25
  $flow: $flow
19
26
  ) {
20
27
  @return get-direction($flow,to);
21
28
  }
22
29
 
30
+ // From
31
+ // ----
23
32
  // Return the 'from' direction of a flow
33
+ // - [$flow] : ltr | rtl
24
34
  @function from(
25
35
  $flow: $flow
26
36
  ) {
@@ -1,7 +1,11 @@
1
1
  // Nth- helpers
2
2
  // ============
3
3
 
4
+ // Format Nth
5
+ // ----------
4
6
  // Format various nth-selectors
7
+ // - [$n] : first | last | only | <math>
8
+ // - [$selector] : child | of-type | last-child | last-of-type
5
9
  @function format-nth(
6
10
  $n : last,
7
11
  $selector : child
@@ -1,6 +1,5 @@
1
- // Shared Language
2
- // ===============
1
+ // Shared Syntax
2
+ // =============
3
3
 
4
4
  @import "shared/settings";
5
5
  @import "shared/context";
6
-
@@ -1,16 +1,17 @@
1
- // Language partials
2
- // =================
1
+ // Susy Next Syntax
2
+ // ================
3
3
 
4
4
  @import "../core";
5
5
  @import "../api/shared";
6
6
  @import "../api/float";
7
7
 
8
8
  @import "shared";
9
- @import "susy/math";
10
- @import "susy/functions";
11
9
  @import "susy/background";
12
10
  @import "susy/container";
13
11
  @import "susy/span";
12
+ @import "susy/gutters";
14
13
  @import "susy/isolate";
15
14
  @import "susy/gallery";
16
15
  @import "susy/rows";
16
+ @import "susy/margins";
17
+ @import "susy/padding";
@@ -1,13 +1,10 @@
1
- // Context syntax
1
+ // Context Syntax
2
2
  // ==============
3
- //
4
- // Functions:
5
- // - nested()
6
- //
7
- // Mixins:
8
- // - nested()
9
3
 
10
- // return the subset grid for nested context
4
+ // Nested [function]
5
+ // -----------------
6
+ // Return a subset grid for nested context.
7
+ // - $context : <span>
11
8
  @function nested(
12
9
  $context
13
10
  ) {
@@ -22,7 +19,11 @@
22
19
  @return get-columns($this-span, $this-location, $this-columns);
23
20
  }
24
21
 
25
- // use the subset grid for a nested context
22
+ // Nested [mixin]
23
+ // --------------
24
+ // Use a subset grid for a nested context
25
+ // - $context : <span>
26
+ // - @content : <content>
26
27
  @mixin nested(
27
28
  $context
28
29
  ) {