susy 1.0.rc.4 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,74 +1,84 @@
1
1
  Susy Changelog
2
2
  ==============
3
3
 
4
- v1.0 [UNRELEASED]
5
- -----------------
4
+ v1.0 [Aug 14, 2012]
5
+ -------------------
6
6
 
7
7
  This release is loaded with new features, but don't let that fool you. Susy
8
8
  just became shockingly simple to use. See the [website][site] for details.
9
9
 
10
- Note that the gem name has changed from `compass-susy-plugin` to `susy`.
10
+ The gem name has changed from `compass-susy-plugin` to `susy`.
11
+ First uninstall the old gem, then install the new one.
12
+ If you have both gems installed, you will get errors.
11
13
 
12
14
  [site]: http://susy.oddbird.net/
13
15
 
14
- New Features:
16
+ Semantics:
15
17
 
16
- * `omega` can now be set directly through the `columns` mixin for much
17
- more compact output.
18
- * Create responsive grid break-points using `at-breakpoint` and `layout`.
19
- * `container` mixin now accepts one or more grids/breakpoints as a shortcut.
20
- * All mixins respect your `$legacy-support-for-ie` settings.
21
- * The `space` function can be used anywhere you need column+gutter math.
22
- * `push`, `pull`, `pre`, `post`, and `squish` add margin left/right shortcuts.
23
- * The `nth-omega` mixin can be used to set omega on any nth-child, nth-of-type,
24
- first, last, or only element - using pseudo-class selectors.
25
- * `remove-omega` and `remove-nth-omega` will remove the omega-specific styles
26
- from an element, returning it to the regular grid flow.
27
- * `$container-width` and `$container-style` settings will override the width
28
- and type (magic, fluid, fixed, static, etc) of your grid container.
29
- * `$breakpoint-media-output` and `$breakpoint-media-output` allow you to turn
30
- on and off the different outputs from `at-breakpoint`.
31
- This is useful when you have IE-overrides living in a file of their own.
32
- * Unit tests live in the `/test/` directory.
33
-
34
- Changed API:
35
-
36
- * `$total-cols` => `$total-columns`
37
- * `$col-width` => `$column-width`
38
- * `$side-gutter-width` => `$grid-padding`
39
- * `@include un-column` & `@include reset-column` => `@include reset-columns`
40
- * `@include columns` => `@include span-columns`
18
+ We re-arranged the code
19
+ in order to make the syntax simpler and more consistent:
41
20
 
42
- Removed:
21
+ * `$total-cols` is now `$total-columns`.
22
+ * `$col-width` is now `$column-width`.
23
+ * `$side-gutter-width` is now `$grid-padding`
24
+ and gets applied directly to the grid container.
25
+ * `un-column` & `reset-column` mixins have merged into `reset-columns`.
26
+ * `columns` has been renamed `span-columns` to resolve the conflict with CSS3 columns.
27
+ See other improvements to span-columns below.
43
28
 
44
- * `@include alpha` is no longer needed.
45
- * `@include omega` no longer accepts the `$context` argument.
46
- * `@include full` can be replaced by a simple `clear: both;` when needed.
47
- * `side-gutter()` is no longer needed. Use `$grid-padding` instead.
29
+ We also removed several bothersome requirements:
48
30
 
49
- Other:
31
+ * The `alpha` mixin is no longer needed. Ever.
32
+ * The `omega` no longer takes a `$context` argument.
33
+ * `full` has been removed entirely.
34
+ Elements will be full-width by default.
35
+ You can add `clear: both;` back in as needed.
36
+ * `side-gutter()` is no longer needed.
37
+ You can use the `$grid-padding` setting directly.
50
38
 
51
- * Fix bug in susy-background-grid for fluid sites.
52
- * Fix minor bug with repeated 'display' properties.
53
- * Lower Compass dependency to 0.12.2
54
- * Add Sass dependency at 3.2.0.alpha.247
39
+ Upgrade:
55
40
 
56
- ### Upgrade:
41
+ That's all you need in order to upgrade from Susy 0.9.
57
42
 
58
- 1. Uninstall `compass-susy-plugin` and install `susy` in it's place.
59
- 2. Find and replace the 5 simple "Changed API's" listed above.
60
- 3. Remove the `$context` argument from all `omega` mixins.
61
- 4. Remove any mention of `alpha` and `full` in your code.
62
- * Replace `full` with `clear: both;` where necessary.
63
- 5. Remove any mention of `side-gutter()`.
64
- * This may require some refactoring, depending on your uses.
65
- 6. [Optional] Any time 'columns' and 'omega' are declared in the same block,
66
- they can now be joined together. `@include columns(3); @include omega();`
67
- can become `@include columns(3 omega)`.
43
+ 1. Uninstall and re-install the gem.
44
+ 2. Find and replace the semantic changes listed above.
68
45
 
69
46
  You're done! Stop worrying about all that "nested vs. root" bullshit,
70
47
  and start playing with the new toys!
71
48
 
49
+ If you use the `$from` directional arguments
50
+ directly in the `span-columns` mixin,
51
+ there may be one more change to make.
52
+ See below:
53
+
54
+ New Features:
55
+
56
+ * `span-columns` supports new features:
57
+ - "omega" can be applied directly through the `$columns` argument.
58
+ - Internal padding can be added through the `$padding` argument.
59
+ - This pushes the `$from` argument from third position into fourth.
60
+ * `at-breakpoint` allows you to change layouts at media breakpoints.
61
+ * `container` accepts multiple media-layout combinations as a shortcut.
62
+ * `layout` allows you to use a different layout at any time.
63
+ * `with-grid-settings` allows you to change any or all grid settings.
64
+ * `set-container-width` does what it says, without the other container code.
65
+ * `$breakpoint-media-output`, `$breakpoint-ie-output`, and `$breakpoint-raw-output`
66
+ settings help manage the different outputs from `at-breakpoint`
67
+ when you have IE-overrides living in a file of their own.
68
+ * `border-box-sizing` will apply the popular `* { box-sizing: border-box }`
69
+ universal box-model fix, as well as changing the Susy `$border-box-model` setting for you,
70
+ so Susy knows to adjust some math.
71
+ * The `space()` function can be used anywhere you need column+gutter math.
72
+ * `push`, `pull`, `pre`, `post`, and `squish` mixins help manage margins.
73
+ * use the `nth-omega` mixin to set omega on any nth-child, nth-of-type,
74
+ first, last, or only element.
75
+ * `remove-omega` and `remove-nth-omega` will remove
76
+ the omega-specific styles from an element.
77
+ * `$container-width` will override the width of your container
78
+ with any arbitrary length.
79
+ * `$container-style` will override the type of grid container
80
+ (magic, fluid, fixed, static, etc) to use.
81
+
72
82
  v0.9 [Apr 25 2011]
73
83
  ------------------
74
84
 
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011, Eric Meyer
1
+ Copyright (c) 2012, Eric Meyer
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -27,15 +27,6 @@ we just do the math and get out of your way.
27
27
  - [Sites using Susy](http://susy.oddbird.net/sites-using-susy/)
28
28
  - [Twitter @CompassSusy](http://twitter.com/compasssusy/)
29
29
 
30
- ## Why is 1.0 a release candidate?
31
-
32
- Susy 1.0 is stable and tested, all the features are in,
33
- and we're ready to launch.
34
- But our 1.0 depends on unreleased Sass features.
35
- We think those features are stable as well,
36
- and we'll do what it takes to stay on top of any changes they make,
37
- but we can't officially land until they do.
38
-
39
30
  ## Contributing
40
31
 
41
32
  We love contributions,
data/Rakefile CHANGED
@@ -10,7 +10,7 @@ begin
10
10
  p.url = "http://susy.oddbird.net/"
11
11
  p.author = "Eric Meyer"
12
12
  p.email = "eric@oddbird.net"
13
- p.dependencies = ["compass >=0.12.2", "sass >=3.2.0.alpha.247"]
13
+ p.dependencies = ["compass >=0.12.2", "sass >=3.2.0"]
14
14
  end
15
15
 
16
16
  rescue LoadError => boom
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.rc.4
1
+ 1.0
@@ -18,7 +18,11 @@ $browser-default-font-size-pt : 12pt;
18
18
  @function columns-width(
19
19
  $columns : $total-columns
20
20
  ) {
21
- @return ($columns * $column-width) + (ceil($columns - 1) * $gutter-width);
21
+ @if round($columns) != $columns {
22
+ @warn "Susy works best with integer column-spans.
23
+ For partial-columns, you may need to finesse the math by hand using functions directly.";
24
+ }
25
+ @return ($columns * $column-width) + (if($columns >= 1, ceil($columns - 1), 0) * $gutter-width);
22
26
  }
23
27
 
24
28
  // Return the full outer width of a Container element.
@@ -36,7 +40,8 @@ $browser-default-font-size-pt : 12pt;
36
40
  @function column(
37
41
  $context : $total-columns
38
42
  ) {
39
- @return percentage($column-width / columns-width($context));
43
+ @return relative-width($column-width, $context);
44
+
40
45
  }
41
46
 
42
47
  // Return the percentage width of multiple 'columns' in a given 'context'.
@@ -47,7 +52,7 @@ $browser-default-font-size-pt : 12pt;
47
52
  $columns,
48
53
  $context : $total-columns
49
54
  ) {
50
- @return percentage(columns-width($columns) / columns-width($context));
55
+ @return relative-width(columns-width($columns), $context);
51
56
  }
52
57
 
53
58
  // Return the percentage width of a single gutter in a given 'context'.
@@ -56,7 +61,18 @@ $browser-default-font-size-pt : 12pt;
56
61
  @function gutter(
57
62
  $context : $total-columns
58
63
  ) {
59
- @return percentage($gutter-width / columns-width($context));
64
+ @return relative-width($gutter-width, $context);
65
+ }
66
+
67
+ // Return the percentage width of a given value in a given 'context'.
68
+ //
69
+ // $width : Any given width value.
70
+ // $context : The grid context in columns, if nested.
71
+ @function relative-width(
72
+ $width,
73
+ $context : $total-columns
74
+ ) {
75
+ @return percentage($width / columns-width($context));
60
76
  }
61
77
 
62
78
  // Return the total space occupied by multiple columns and associated gutters.
@@ -68,7 +84,7 @@ $browser-default-font-size-pt : 12pt;
68
84
  $columns,
69
85
  $context : $total-columns
70
86
  ) {
71
- @return columns($columns, $context) + gutter($context);
87
+ @return columns($columns, $context) + if($columns >= 1, gutter($context), 0);
72
88
  }
73
89
 
74
90
  // Accept a list including column-count and (optional) position.
@@ -2,6 +2,7 @@
2
2
  // Imports
3
3
 
4
4
  @import "compass/utilities/general/clearfix";
5
+ @import "compass/css3/box-sizing";
5
6
 
6
7
  // ---------------------------------------------------------------------------
7
8
  // Border-Box Sizing
@@ -94,17 +95,40 @@
94
95
  // $context : [optional] The context (columns spanned by parent).
95
96
  // : Context is required on any nested elements.
96
97
  // : Context MUST NOT be declared on a root element.
98
+ // $padding : [optional] Padding applied to the inside of individual grid columns.
99
+ // : Padding is only output if one or two values are specified (e.g. 1em or 10px 20px)
100
+ // : Padding values are applied only on the horizontal axis in from-to order
97
101
  // $from : The start direction of your layout (e.g. 'left' for ltr languages)
102
+
98
103
  @mixin span-columns(
99
104
  $columns,
100
- $context : $total-columns,
101
- $from : $from-direction
105
+ $context : $total-columns,
106
+ $padding : false,
107
+ $from : $from-direction
102
108
  ) {
103
109
  $to : opposite-position($from);
104
110
  $pos : split-columns-value($columns,position);
105
111
  $cols : split-columns-value($columns,columns);
112
+ $pad-from : relative-width(0 * $gutter-width, $context);
113
+ $pad-to : relative-width(0 * $gutter-width, $context);
114
+
115
+ @if $padding != false {
116
+ $pad-from : nth($padding, 1);
117
+
118
+ @if length($padding) > 1 {
119
+ $pad-to: nth($padding, 2);
120
+ } @else {
121
+ $pad-to: $pad-from;
122
+ }
123
+
124
+ $pad-from : relative-width($pad-from, $context);
125
+ $pad-to : relative-width($pad-to, $context);
126
+
127
+ padding-#{$from}: $pad-from;
128
+ padding-#{$to}: $pad-to;
129
+ }
106
130
 
107
- width: columns($cols, $context);
131
+ width: columns($cols, $context) - if($border-box-sizing, 0, $pad-to + $pad-from);
108
132
 
109
133
  @if ($pos == 'omega') {
110
134
  @include omega($from);
@@ -9,7 +9,7 @@ $total-columns : 12 !default;
9
9
  $column-width : 4em !default;
10
10
  $gutter-width : 1em !default;
11
11
 
12
- // Add padding to your grid.
12
+ // Padding on the left and right of a Grid Container.
13
13
  $grid-padding : $gutter-width !default;
14
14
 
15
15
  // ---------------------------------------------------------------------------
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{susy}
5
- s.version = "1.0.rc.4"
5
+ s.version = "1.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Eric Meyer"]
9
- s.date = %q{2012-08-02}
9
+ s.date = %q{2012-08-14}
10
10
  s.description = %q{Susy grids are fluid on the inside, ready to respond at any moment, but contained in the candy shell of your choice, so they respond how and when and where you want them to. We don't design your site or dictate your markup, we just do the math and get out of your way.}
11
11
  s.email = %q{eric@oddbird.net}
12
12
  s.extra_rdoc_files = ["CHANGELOG.mkdn", "LICENSE.txt", "README.md", "lib/susy.rb"]
@@ -24,13 +24,13 @@ Gem::Specification.new do |s|
24
24
 
25
25
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
26
  s.add_runtime_dependency(%q<compass>, [">= 0.12.2"])
27
- s.add_runtime_dependency(%q<sass>, [">= 3.2.0.alpha.247"])
27
+ s.add_runtime_dependency(%q<sass>, [">= 3.2.0"])
28
28
  else
29
29
  s.add_dependency(%q<compass>, [">= 0.12.2"])
30
- s.add_dependency(%q<sass>, [">= 3.2.0.alpha.247"])
30
+ s.add_dependency(%q<sass>, [">= 3.2.0"])
31
31
  end
32
32
  else
33
33
  s.add_dependency(%q<compass>, [">= 0.12.2"])
34
- s.add_dependency(%q<sass>, [">= 3.2.0.alpha.247"])
34
+ s.add_dependency(%q<sass>, [">= 3.2.0"])
35
35
  end
36
36
  end
@@ -41,6 +41,16 @@
41
41
  display: inline;
42
42
  }
43
43
 
44
+ .span-columns-with-padding {
45
+ padding-left: 1.69492%;
46
+ padding-right: 3.38983%;
47
+ width: 44.0678%;
48
+ float: right;
49
+ margin-right: 0;
50
+ #margin-left: -1em;
51
+ display: inline;
52
+ }
53
+
44
54
  .reset-columns {
45
55
  float: none;
46
56
  width: auto;
@@ -74,3 +84,36 @@
74
84
  margin-right: 1.69492%;
75
85
  #margin-left: 0;
76
86
  }
87
+
88
+ /* ---------------------------------------------------------------------------
89
+ /* Border-Box Sizing */
90
+ * {
91
+ -webkit-box-sizing: border-box;
92
+ -moz-box-sizing: border-box;
93
+ box-sizing: border-box;
94
+ }
95
+
96
+ .container {
97
+ *zoom: 1;
98
+ max-width: 61em;
99
+ _width: 61em;
100
+ margin-left: auto;
101
+ margin-right: auto;
102
+ padding-left: 1em;
103
+ padding-right: 1em;
104
+ }
105
+ .container:after {
106
+ content: "";
107
+ display: table;
108
+ clear: both;
109
+ }
110
+
111
+ .span-columns-with-padding {
112
+ padding-left: 1.69492%;
113
+ padding-right: 3.38983%;
114
+ width: 49.15254%;
115
+ float: right;
116
+ margin-right: 0;
117
+ #margin-left: -1em;
118
+ display: inline;
119
+ }
@@ -18,6 +18,10 @@
18
18
  @include span-columns(6 omega,12);
19
19
  }
20
20
 
21
+ .span-columns-with-padding {
22
+ @include span-columns(6 omega,12,1 * $gutter-width 2 * $gutter-width);
23
+ }
24
+
21
25
  .reset-columns {
22
26
  @include reset-columns;
23
27
  }
@@ -37,3 +41,19 @@
37
41
  .remove-nth-omega {
38
42
  @include remove-nth-omega;
39
43
  }
44
+
45
+ /* ---------------------------------------------------------------------------
46
+ /* Border-Box Sizing */
47
+
48
+ @include border-box-sizing;
49
+
50
+ .container {
51
+ @include container;
52
+ }
53
+
54
+ .span-columns-with-padding {
55
+ @include span-columns(6 omega,12,1 * $gutter-width 2 * $gutter-width);
56
+ }
57
+
58
+ // Reset $border-box-sizing so it doesn't have other effects
59
+ $border-box-sizing: false;
metadata CHANGED
@@ -1,13 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: susy
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: true
4
+ prerelease: false
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - rc
9
- - 4
10
- version: 1.0.rc.4
8
+ version: "1.0"
11
9
  platform: ruby
12
10
  authors:
13
11
  - Eric Meyer
@@ -15,7 +13,7 @@ autorequire:
15
13
  bindir: bin
16
14
  cert_chain: []
17
15
 
18
- date: 2012-08-02 00:00:00 -06:00
16
+ date: 2012-08-14 00:00:00 -06:00
19
17
  default_executable:
20
18
  dependencies:
21
19
  - !ruby/object:Gem::Dependency
@@ -43,9 +41,7 @@ dependencies:
43
41
  - 3
44
42
  - 2
45
43
  - 0
46
- - alpha
47
- - 247
48
- version: 3.2.0.alpha.247
44
+ version: 3.2.0
49
45
  type: :runtime
50
46
  version_requirements: *id002
51
47
  description: Susy grids are fluid on the inside, ready to respond at any moment, but contained in the candy shell of your choice, so they respond how and when and where you want them to. We don't design your site or dictate your markup, we just do the math and get out of your way.