susy 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb5b89b744ac20007a3a1d91a36a970bbffe1e99
4
- data.tar.gz: 9a46e0d21945bf5a645f2b7b7c8e1c127d198d2b
3
+ metadata.gz: 6564f6c6ebae00408fb763ffdb3bda6ef669b9d6
4
+ data.tar.gz: 50860d92812e7883ebde50f1fd8ddb0a0634ce2c
5
5
  SHA512:
6
- metadata.gz: db91d54a75ed724235d0e8938add1e32abfb9fe5b603806584fbe4b5998d209f1065af0ab2e3b05494b48e5efa31177429ed8c106e38c2647f9f32e96d525b5d
7
- data.tar.gz: 304373902790d7558f5105948646e6cf0b14ec9ff652948ea4f56741235ad72f2b422d444fcf9518519c6e22b8acf26cb4444a12927a70ba4dab088b34f6a5c9
6
+ metadata.gz: ca85a0d51eff08a9b02d7453cd916933eae56b5b6e98d160b5556765aae972be68e5c615dcee7497407c0e4f421eabbe3f0f95ab92d4103e90f96cfa5e1afec5
7
+ data.tar.gz: 8995cf7863a664cdf6f54a3fa14db746993d51b0ff83a61915d7870e95163eb9a1e86eca0136705fe74d4eb49143f3ffe4f886ce7e0983740375d765ddd9a2ce
data/README.md CHANGED
@@ -24,17 +24,3 @@ Resources
24
24
  - [Documentation](http://susydocs.oddbird.net/)
25
25
  - [Sites using Susy](http://susy.oddbird.net/sites-using-susy/)
26
26
  - [Twitter @SassSusy](http://twitter.com/Sasssusy/)
27
-
28
- Contributing
29
- ------------
30
-
31
- We love contributions,
32
- both as ideas and pull requests.
33
- Susy is written in pure Sass,
34
- all contained in the `/sass/` directory.
35
- Everything else is just packaging.
36
- If you know Sass,
37
- or are willing to learn,
38
- you can contribute to Susy.
39
-
40
- More documentation on contributing to come...
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.1.1
data/docs/changelog.rst CHANGED
@@ -1,8 +1,20 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 2.1.2 - Apr 28 2014
5
+ -------------------
6
+
7
+ - ``first`` and ``last`` keywords output ``0`` margins instead of ``null``
8
+ so they can be used to override previous span settings.
9
+ - Output ``:before`` / ``:after`` rather than ``::before`` / ``::after``
10
+ to support IE8.
11
+ - Load Susy paths in Compass if required, otherwise add it to SASS_PATH.
12
+ [`Adrien Antoine <https://github.com/Alshten>`_]
13
+ - Compass 1.0 config no longer needs to ``require 'susy'``.
14
+ Susy is registered with Compass automatically.
15
+
4
16
 
5
- 2.1.0 - Mar 13 2014
17
+ 2.1.1 - Mar 13 2014
6
18
  -------------------
7
19
 
8
20
  - Rename core math functions, and prepare for decomposition.
data/lib/susy.rb CHANGED
@@ -1,10 +1,10 @@
1
1
  base_directory = File.expand_path(File.join(File.dirname(__FILE__), '..'))
2
2
  susy_stylesheets_path = File.join(base_directory, 'sass')
3
3
  susy_templates_path = File.join(base_directory, 'templates')
4
- begin
5
- require 'compass'
4
+
5
+ if (defined? Compass)
6
6
  Compass::Frameworks.register('susy', :stylesheets_directory => susy_stylesheets_path, :templates_directory => susy_templates_path)
7
- rescue LoadError
7
+ else
8
8
  # compass not found, register on the Sass path via the environment.
9
9
  if ENV.has_key?("SASS_PATH")
10
10
  ENV["SASS_PATH"] = ENV["SASS_PATH"] + File::PATH_SEPARATOR + susy_stylesheets_path
@@ -7,6 +7,7 @@ $susy-version: 2.0;
7
7
  @import "../output/float";
8
8
 
9
9
  @import "susy/settings";
10
+ @import "susy/validation";
10
11
  @import "susy/grids";
11
12
  @import "susy/box-sizing";
12
13
  @import "susy/context";
@@ -59,7 +59,7 @@ $susy-overlay-grid-head-exists: false;
59
59
  ) {
60
60
  @if not $susy-overlay-grid-head-exists {
61
61
  @at-root head { @include overlay-head; }
62
- @at-root head::before { @include overlay-trigger; }
62
+ @at-root head:before { @include overlay-trigger; }
63
63
  @at-root head:hover { @include overlay-trigger-hover; }
64
64
  $susy-overlay-grid-head-exists: true !global;
65
65
  }
@@ -67,7 +67,7 @@ $susy-overlay-grid-head-exists: false;
67
67
  head:hover ~ &,
68
68
  head:hover ~ body & {
69
69
  position: relative;
70
- &::before {
70
+ &:before {
71
71
  @include grid-overlay-base;
72
72
  @include background-grid($grid);
73
73
  }
@@ -152,6 +152,7 @@ $susy-overlay-grid-head-exists: false;
152
152
  $_end : 1 + $_gutters;
153
153
  $_after : percentage(1/$_end);
154
154
  $_stops : ();
155
+ $_size : span(1 $grid wide);
155
156
 
156
157
  @if is-inside($grid) {
157
158
  $_stops: $_color, $_light;
@@ -164,9 +165,13 @@ $susy-overlay-grid-head-exists: false;
164
165
  $_stops: $_color, $_light $_after, $_trans $_after;
165
166
  }
166
167
 
168
+ @if $_math == static {
169
+ $_size: valid-column-math($_math, $_column-width) * $_end;
170
+ }
171
+
167
172
  $_output: (
168
173
  image: (columns: $_stops),
169
- size: if($_math == static, $_column-width * $_end, span(1 $grid wide)),
174
+ size: $_size,
170
175
  );
171
176
 
172
177
  @return $_output;
@@ -8,7 +8,7 @@
8
8
  @mixin global-box-sizing(
9
9
  $box: susy-get(global-box-sizing)
10
10
  ) {
11
- *, *::before, *::after { @include output((box-sizing: $box)); }
11
+ *, *:before, *:after { @include output((box-sizing: $box)); }
12
12
  @include update-box-model($box);
13
13
  }
14
14
 
@@ -45,15 +45,15 @@
45
45
  $layout : parse-grid($layout);
46
46
  $_width : susy-get(container, $layout);
47
47
  $_column-width : susy-get(column-width, $layout);
48
+ $_math : susy-get(math, $layout);
48
49
 
49
50
  @if not $_width or $_width == auto {
50
- @if $_column-width {
51
+ @if valid-column-math($_math, $_column-width) {
51
52
  $_columns : susy-get(columns, $layout);
52
53
  $_gutters : susy-get(gutters, $layout);
53
54
  $_spread : if(is-split($layout), wide, narrow);
54
55
  $_width : susy-sum($_columns, $_gutters, $_spread) * $_column-width;
55
56
  } @else {
56
- // if we have nothing, default to 100%
57
57
  $_width: 100%;
58
58
  }
59
59
  }
@@ -1,31 +1,38 @@
1
1
  // Grid Syntax
2
2
  // ===========
3
3
 
4
+
4
5
  // Layout
5
6
  // ------
6
7
  // Set a new layout using a shorthand
7
8
  // - $layout: <settings>
9
+ // - $clean: boolean
8
10
  @mixin layout(
9
- $layout
11
+ $layout,
12
+ $clean: false
10
13
  ) {
11
- $susy: map-merge($susy, parse-grid($layout)) !global;
14
+ $susy: _get-layout($layout, $clean) !global;
12
15
  }
13
16
 
17
+
14
18
  // Use Grid
15
19
  // --------
16
20
  // Use an arbitrary layout for a section of code
17
21
  // - $layout: <settings>
22
+ // - $clean: boolean
18
23
  @mixin with-layout(
19
- $layout
24
+ $layout,
25
+ $clean: false
20
26
  ) {
21
27
  $old: $susy;
28
+ $susy: _get-layout($layout, $clean) !global;
22
29
 
23
- @include layout($layout);
24
30
  @content;
25
31
 
26
32
  $susy: $old !global;
27
33
  }
28
34
 
35
+
29
36
  // Layout
30
37
  // ------
31
38
  // Return a parsed layout map based on shorthand syntax
@@ -35,3 +42,17 @@
35
42
  ) {
36
43
  @return parse-grid($layout);
37
44
  }
45
+
46
+
47
+ // Get Layout
48
+ // ----------
49
+ // Return a new layout based on current and given settings
50
+ // - $layout: <settings>
51
+ // - $clean: boolean
52
+ @function _get-layout(
53
+ $layout,
54
+ $clean: false
55
+ ) {
56
+ $layout: layout($layout);
57
+ @return if($clean, $layout, _susy-deep-merge($susy, $layout));
58
+ }
@@ -68,8 +68,9 @@
68
68
 
69
69
  @if $_gutters and ($_gutters > 0) and not $_gutter {
70
70
  $_column-width: susy-get(column-width, $context);
71
- @if $_column-width and gutter-math($context) == static {
72
- $_gutter: $_gutters * $_column-width;
71
+ $_math: gutter-math($context);
72
+ @if $_math == static {
73
+ $_gutter: $_gutters * valid-column-math($_math, $_column-width);
73
74
  } @else {
74
75
  $_columns : susy-get(columns, $context);
75
76
  $_spread : if(is-split($context), wide, susy-get(spread, $context));
@@ -86,14 +86,21 @@
86
86
  $margin-after: -100%;
87
87
  } @else if $edge {
88
88
  $is-split: is-split($span);
89
- @if $edge == last or $edge == full {
90
- $margin-after: if($is-split, $margin-after, null);
91
- }
92
- @if $edge == first or $edge == full {
93
- $margin-before: if($is-split, $margin-before, null);
94
- } @else if $edge == last {
89
+ $pos: susy-get(gutter-position, $span);
90
+
91
+ @if $edge == last {
95
92
  $float: susy-get(last-flow, $span);
96
93
  }
94
+
95
+ @if not $is-split {
96
+ @if $edge == full or ($edge == first and $pos == before) {
97
+ $margin-before: 0;
98
+ }
99
+ @if $edge == full or ($edge == last and $pos == after) {
100
+ $margin-after: 0;
101
+ }
102
+ }
103
+
97
104
  }
98
105
 
99
106
  @return (
@@ -139,8 +146,10 @@
139
146
  $spread: if(is-inside($span), $spread or wide, $spread);
140
147
  $span-sum: susy($n, $location, $columns, $gutters, $spread);
141
148
 
142
- @if susy-get(math, $span) == static {
143
- $width: $span-sum * susy-get(column-width, $span);
149
+ $_math: susy-get(math, $span);
150
+ $_column-width: susy-get(column-width, $span);
151
+ @if $_math == static {
152
+ $width: $span-sum * valid-column-math($_math, $_column-width);
144
153
  } @else {
145
154
  $width: percentage($span-sum / $context);
146
155
  }
@@ -0,0 +1,16 @@
1
+ // Validation
2
+ // ==========
3
+
4
+
5
+ // Validate Column Math
6
+ // --------------------
7
+ @function valid-column-math(
8
+ $math,
9
+ $column-width
10
+ ) {
11
+ @if $math == static and not $column-width {
12
+ @warn 'Static math requires a valid column-width setting.';
13
+ } @else {
14
+ @return $column-width;
15
+ }
16
+ }
@@ -63,6 +63,27 @@
63
63
  }
64
64
 
65
65
 
66
+ // Deep Merge
67
+ // ----------
68
+ // Return 2 objects of any depth, merged
69
+ @function _susy-deep-merge(
70
+ $map1,
71
+ $map2
72
+ ) {
73
+
74
+ @if type-of($map1) != map or type-of($map2) != map {
75
+ $map1: $map2;
76
+ } @else {
77
+ @each $key, $value in $map2 {
78
+ $_new: ($key: _susy_deep-merge(map-get($map1, $key), $value));
79
+ $map1: map-merge($map1, $_new);
80
+ }
81
+ }
82
+
83
+ @return $map1;
84
+ }
85
+
86
+
66
87
  // Deep Has-Key
67
88
  // ------------
68
89
  // - Return true if a deep key exists
@@ -9,7 +9,7 @@
9
9
  @if susy-support(clearfix, (mixin: clearfix)) {
10
10
  @include clearfix;
11
11
  } @else {
12
- &::after {
12
+ &:after {
13
13
  content: " ";
14
14
  display: block;
15
15
  clear: both;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: susy
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Suzanne
@@ -68,6 +68,7 @@ files:
68
68
  - sass/susy/language/susy/_rows.scss
69
69
  - sass/susy/language/susy/_settings.scss
70
70
  - sass/susy/language/susy/_span.scss
71
+ - sass/susy/language/susy/_validation.scss
71
72
  - sass/susy/language/susyone/_background.scss
72
73
  - sass/susy/language/susyone/_functions.scss
73
74
  - sass/susy/language/susyone/_grid.scss