compass-susy-plugin 0.6.3 → 0.7.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest CHANGED
@@ -5,6 +5,7 @@ Manifest
5
5
  Rakefile
6
6
  README.mkdn
7
7
  sass/susy/_grid.sass
8
+ sass/susy/_reset.sass
8
9
  sass/susy/_utils.sass
9
10
  sass/susy/_text.sass
10
11
  sass/susy/_susy.sass
@@ -12,6 +13,7 @@ templates/project/print.sass
12
13
  templates/project/screen.sass
13
14
  templates/project/ie.sass
14
15
  templates/project/_base.sass
16
+ templates/project/_defaults.sass
15
17
  templates/project/manifest.rb
16
18
  VERSION
17
19
  LICENSE.txt
data/README.mkdn CHANGED
@@ -26,8 +26,9 @@ Create a Susy-based Compass Project
26
26
 
27
27
  compass -r susy -f susy <project name>
28
28
 
29
- Then edit your `_base.sass`, `screen.sass` and `print.sass` files accordingly.
30
- A reset is added automatically.
29
+ Then edit your `_base.sass`, `_defaults.sass`, `screen.sass` and `print.sass`
30
+ files accordingly. A reset is added automatically, and includes help for some
31
+ HTML5 elements.
31
32
 
32
33
  Philosophy and Goals
33
34
  --------------------
@@ -48,12 +49,12 @@ It is important for accessibility and usability that we are:
48
49
  side-scroll bar. No one likes that. On the large end our design integrity
49
50
  and line lengths are more important than taking up all the possible space.
50
51
 
51
- In order to achieve both we need to combine the best of the elastic (em-based)
52
- and fluid (%-based) models. The solution is simple: First we build a fluid
53
- grid, then place it inside an elastic shell, and apply a maximum width to that
54
- shell so that it never exceeds the size of the viewport. It's simple in
55
- theory, but daunting in practice, as you constantly have to adjust your math
56
- based on the context.
52
+ In order to achieve both goals we need to combine the best of the elastic
53
+ (em-based) and fluid (%-based) models. The solution is simple: First we build
54
+ a fluid grid, then place it inside an elastic shell, and apply a maximum width
55
+ to that shell so that it never exceeds the size of the viewport. It's simple
56
+ in theory, but daunting in practice, as you constantly have to adjust your
57
+ math based on the context.
57
58
 
58
59
  But Susy harnesses the power of Compass and Sass to do all the math for you.
59
60
 
@@ -61,9 +62,12 @@ Grid Basics
61
62
  ===========
62
63
 
63
64
  * Set up your default grid values (total columns, column width, gutter
64
- width, side gutter width), your base font size, and other style defaults
65
+ width, side gutter width), your base font size, and important mixins
65
66
  in `_base.sass`.
66
67
 
68
+ * Set defaults for all the important HTML tags in `_defaults.sass`. It's
69
+ better than using the browser defaults. And better than using ours.
70
+
67
71
  * Create your grid in `screen.sass`: apply the `+susy` mixin to the `body`
68
72
  element and the `+container` mixin to the element that contains the page
69
73
  grid.
@@ -123,36 +127,35 @@ Extra Utility Mixins
123
127
  Extra utilities are included in Susy's `utils.sass` file, with additional list
124
128
  options, experimental (CSS3/proprietary) CSS, and more.
125
129
 
126
- * `+show-grid(!src)` will remove all your backgrounds and repeat the specified
127
- grid image on an element. Good for testing your baseline grid.
130
+ * `+show-grid(!src)` - Repeat the specified grid image on an element. Good for
131
+ testing your baseline grid.
128
132
 
129
- * `+inline-block-list([!horizontalpadding])` for making lists inline-block
130
- when floating just won't do the trick.
133
+ * `+inline-block-list([!horizontalpadding])` - Make list items inline-block
134
+ when floating just won't do the trick (if you need them centered or right).
131
135
 
132
- * `+hide` for hiding content from visual browsers while keeping accessability
136
+ * `+hide` - Hide content from visual browsers while keeping accessability
133
137
  intact.
134
138
 
135
- * `+skip-link([!top = 0, !right, !bottom, !left])` hide a link, and then show
139
+ * `+skip-link([!top = 0, !right, !bottom, !left])` - Hide a link, and then show
136
140
  it again on focus. the TRBL settings allow you to place it absolutely on
137
141
  display. Default will be top left of the positioning context.
138
142
 
139
- And then the fun stuff:
143
+ And then the fun stuff in `_CSS3.sass`:
140
144
 
141
- * `+opacity(!opacity)` adds cross-browser opacity settings (takes a range of
142
- 0 to 1).
145
+ * `+opacity(!opacity)` - add cross-browser opacity settings (takes a range of
146
+ 0 to 1). `+transprent` and `+opaque` are available as shortcuts.
143
147
 
144
- * `+border-radius(!radius)` (`+border-bottom-left-radius` etc. all work) for
145
- rounded corners in supporting browsers.
148
+ * `+border-radius(!radius)` - Rounded corners in supporting browsers.
149
+ `+border-bottom-left-radius` etc. all work.
146
150
 
147
- * `+box-sizing(!model)` for setting the box sizing model in supporting
148
- browsers.
151
+ * `+box-sizing(!model)` - Set the box sizing model in supporting browsers.
149
152
 
150
- * `+box-shadow(!verticaloffset, !horizontaloffset, !blur, !color)` for
151
- box-shadow in webkit, mozilla and CSS3.
153
+ * `+box-shadow(!verticaloffset, !horizontaloffset, !blur, !color)` -
154
+ Box-shadow in supporting browsers.
152
155
 
153
156
  * `+column-count(!number)`, `+column-gap(!length)`, `+column-width(!length)`,
154
- and `+column-rule(!width, !style, !color)` for CSS columns in webkit,
155
- mozilla and CSS3.
157
+ and `+column-rule(!width, !style, !color)` - CSS columns in supporting
158
+ browsers.
156
159
 
157
160
  Advanced Options
158
161
  ================
@@ -190,7 +193,7 @@ advanced options hidden inside. Here's a few:
190
193
  It requires more maintenance on your part, but the result is a
191
194
  hack-free output.
192
195
 
193
- The susy mixins that use either hacks or targeted mixins are
196
+ The Susy mixins that use either hacks or targeted mixins are
194
197
  `+omega` (`+ie-omega([!right-floated = false])`), `+inline-block`
195
198
  (`+ie-inline-block`), and `+inline-block-list` which sets
196
199
  `+inline-block` on the list items.
@@ -207,7 +210,7 @@ advanced options hidden inside. Here's a few:
207
210
  Example:
208
211
 
209
212
  #nav
210
- :padding-right= gutter(5) + "%"
213
+ padding-right= gutter(5) + "%"
211
214
 
212
215
  * `columns(!number, !context)` returns the span of `!number` columns in
213
216
  `!context` as a percentage (again without the units declared). This span
@@ -216,7 +219,7 @@ advanced options hidden inside. Here's a few:
216
219
  Example:
217
220
 
218
221
  #nav
219
- :padding-left= columns(3,5) + "%"
222
+ padding-left= columns(3,5) + "%"
220
223
 
221
224
  * `side_gutter()` is also available and takes no arguments since it is always
222
225
  used at the top nesting level.
@@ -229,4 +232,4 @@ advanced options hidden inside. Here's a few:
229
232
  Example:
230
233
 
231
234
  #nav
232
- :border-bottom= px2em(2) + "em"
235
+ border-bottom= px2em(2) + "em"
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ begin
12
12
  p.url = "http://github.com/ericam/compass-susy-plugin"
13
13
  p.author = ['Eric Meyer']
14
14
  p.email = "eric@oddbird.net"
15
- p.dependencies = ["compass"]
15
+ p.dependencies = ["compass >=0.10.0.pre1"]
16
16
  p.has_rdoc = false
17
17
  end
18
18
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.3
1
+ 0.7.0.pre1
@@ -2,19 +2,20 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{compass-susy-plugin}
5
- s.version = "0.6.3"
5
+ s.version = "0.7.0.pre1"
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{2009-07-12}
9
+ s.date = %q{2009-11-30}
10
10
  s.description = %q{Susy is a ground-up native Compass plugin grid system that takes full advantage of Sass' capabilities to remove the tedium from grid-based web design.}
11
11
  s.email = %q{eric@oddbird.net}
12
- s.extra_rdoc_files = ["lib/susy/compass_plugin.rb", "lib/susy/sass_extensions.rb", "lib/susy.rb", "README.mkdn"]
13
- s.files = ["lib/susy/compass_plugin.rb", "lib/susy/sass_extensions.rb", "lib/susy.rb", "Manifest", "Rakefile", "README.mkdn", "sass/susy/_grid.sass", "sass/susy/_utils.sass", "sass/susy/_text.sass", "sass/susy/_susy.sass", "templates/project/_base.sass", "templates/project/screen.sass", "templates/project/print.sass", "templates/project/ie.sass", "templates/project/manifest.rb", "VERSION", "LICENSE.txt", "docs/tutorial/index.mkdn", "docs/tutorial/figures/susy_element.png", "docs/tutorial/figures/susy_grid.png", "compass-susy-plugin.gemspec"]
12
+ s.extra_rdoc_files = ["lib/susy/compass_plugin.rb", "lib/susy/sass_extensions.rb", "lib/susy.rb", "README.mkdn", "LICENSE.txt"]
13
+ s.files = ["lib/susy/compass_plugin.rb", "lib/susy/sass_extensions.rb", "lib/susy.rb", "Manifest", "Rakefile", "README.mkdn", "sass/susy/_grid.sass", "sass/susy/_reset.sass", "sass/susy/_utils.sass", "sass/susy/_text.sass", "sass/susy/_susy.sass", "templates/project/print.sass", "templates/project/screen.sass", "templates/project/ie.sass", "templates/project/_base.sass", "templates/project/_defaults.sass", "templates/project/manifest.rb", "VERSION", "LICENSE.txt", "compass-susy-plugin.gemspec"]
14
14
  s.homepage = %q{http://github.com/ericam/compass-susy-plugin}
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Compass-Susy-plugin", "--main", "README.mkdn"]
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Compass-susy-plugin", "--main", "README.mkdn"]
16
16
  s.require_paths = ["lib"]
17
- s.rubygems_version = %q{1.3.3}
17
+ s.rubyforge_project = %q{compass-susy-plugin}
18
+ s.rubygems_version = %q{1.3.5}
18
19
  s.summary = %q{A Compass grid system plugin.}
19
20
 
20
21
  if s.respond_to? :specification_version then
@@ -22,14 +23,11 @@ Gem::Specification.new do |s|
22
23
  s.specification_version = 3
23
24
 
24
25
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
25
- s.add_runtime_dependency(%q<compass>, [">= 0"])
26
- s.add_development_dependency(%q<echoe>, [">= 0"])
26
+ s.add_runtime_dependency(%q<compass>, [">= 0.10.0.pre1"])
27
27
  else
28
- s.add_dependency(%q<compass>, [">= 0"])
29
- s.add_dependency(%q<echoe>, [">= 0"])
28
+ s.add_dependency(%q<compass>, [">= 0.10.0.pre1"])
30
29
  end
31
30
  else
32
- s.add_dependency(%q<compass>, [">= 0"])
33
- s.add_dependency(%q<echoe>, [">= 0"])
31
+ s.add_dependency(%q<compass>, [">= 0.10.0.pre1"])
34
32
  end
35
33
  end
data/sass/susy/_grid.sass CHANGED
@@ -1,117 +1,127 @@
1
- //** Grid Settings **//
1
+ //** The Susy Grid **//
2
+ // Updated 11.20.2009 by Eric A. Meyer
2
3
 
3
- //**
4
- Your basic units for the grid
4
+
5
+ // Your basic settings for the grid.
6
+ // Override these in base.sass to customize your site.
7
+ // The grid_unit will be used for col_width, gutter_width and side_gutter_width
5
8
  !grid_unit ||= "em"
6
9
  !total_cols ||= 12
7
10
  !col_width ||= 4
8
11
  !gutter_width ||= 1
9
12
  !side_gutter_width ||= !gutter_width
13
+
14
+
15
+ // Susy will set your outer shell based on the variables above.
10
16
  !container_width = container(!total_cols, !col_width, !gutter_width, !side_gutter_width)
11
17
 
12
18
 
13
- //**
14
- set on the outer grid containing element.
19
+ // Set on the outer grid-containing element(s).
15
20
  =container(!align = "left")
16
- // clear all floated columns
21
+ // clear all floated columns
17
22
  +clearfix
18
- // align the text back to the left (override for other alignments)
19
- :text-align= !align
20
- // use auto horizontal margins to center your page in the body
21
- :margin
22
- :left auto
23
- :right auto
24
- // set the page width based on column settings
25
- :width= !container_width + !grid_unit
26
- // never exceed 100% of the browser window (no side-scrolling)
27
- :max-width 100%
28
-
29
-
30
- //**
31
- set on any column element, even nested ones.
32
- the first agument [required] is the number of columns to span
33
- the second argument is the context (columns spanned by parent)
34
- this is required in any nested context
35
- by default a grid-col is floated left with a right gutter
36
- override that with +float("right"), +first or +last
23
+ // align the text back to the left (override for other alignments)
24
+ text-align= !align
25
+ // use auto horizontal margins to center your page in the body
26
+ margin:
27
+ left: auto
28
+ right: auto
29
+ // set the page width based on column settings
30
+ width= !container_width + !grid_unit
31
+ // never exceed 100% of the browser window (no side-scrolling)
32
+ max-width: 100%
33
+
34
+
35
+ // Set on any column element, even nested ones.
36
+ // The first agument [required] is the number of columns to span.
37
+ // The second argument is the context (columns spanned by parent).
38
+ // - Context is required on any nested elements.
39
+ // - Context MUST NOT be declared on a top-level element.
40
+ // By default a grid-column is floated left with a right gutter.
41
+ // - Override those with +float("right"), +alpha or +omega
37
42
  =columns(!n, !context = false)
38
- // the width of the column is set as a percentage of the context
39
- :width= columns(!n, !context) + "%"
40
- // the column is floated left
43
+ // the column is floated left
41
44
  +float("left")
42
- // the right gutter is added as a percentage of the context
43
- :margin-right= gutter(!context) + "%"
45
+ // the width of the column is set as a percentage of the context
46
+ width= columns(!n, !context) + "%"
47
+ // the right gutter is added as a percentage of the context
48
+ margin-right= gutter(!context) + "%"
49
+
44
50
 
45
- //**
46
- set on any column to add empty colums before or after
51
+ // Set on any element to add empty colums as padding before or after.
47
52
  =prefix(!n, !context = false)
48
- :padding-left= columns(!n, !context) + gutter(!context) + "%"
53
+ padding-left= columns(!n, !context) + gutter(!context) + "%"
49
54
 
50
55
  =suffix(!n, !context = false)
51
- :padding-right= columns(!n, !context) + gutter(!context) + "%"
56
+ padding-right= columns(!n, !context) + gutter(!context) + "%"
57
+
52
58
 
53
- //**
54
- set as shortcut for prefix and suffix
59
+ // Set as a shortcut for both prefix and suffix.
55
60
  =pad(!p = 0, !s = 0, !c = false)
56
61
  @if !p != 0
57
62
  +prefix(!p,!c)
58
63
  @if !s != 0
59
64
  +suffix(!s,!c)
60
65
 
61
- //**
62
- set on any element spanning the first column in non-nested context
63
- to take side-gutters into account
66
+
67
+ // Set on any element spanning the first column in non-nested context
68
+ // to take side-gutters into account. Recommended that you pass the
69
+ // actual nested contexts (when nested) rather than a true/false argument
70
+ // for the sake of consistency. Effect is the same.
64
71
  =alpha(!nested = false)
65
72
  @if !nested == false
66
- :margin-left= side_gutter() + "%"
67
-
68
- //**
69
- when global constant !hacks == true:
70
- - this will be called automatically with hacks
71
- when global constant !hacks == false:
72
- - you can call it yourself in ie.sass without the hacks
73
- =ie-omega(!nested = false, !right = false, !hack = false)
73
+ margin-left= side_gutter() + "%"
74
+
75
+
76
+ // When global constant !hacks == true:
77
+ // - this will be called automatically with hacks
78
+ // When global constant !hacks == false:
79
+ // - you can call it yourself in ie.sass without the hacks
80
+ =ie-omega(!nested = false, !dir = "right", !hack = false)
74
81
  !s = side_gutter()
75
- @if !right
82
+ @if !dir == "right"
76
83
  @if !hack
77
- :#margin-left -1%
84
+ #margin-left: -1%
78
85
  @else
79
- :margin-left -1%
86
+ margin-left: -1%
80
87
  @else
81
88
  @if !nested
82
89
  @if !hack
83
- :#margin-right -1%
90
+ #margin-right: -1%
84
91
  @else
85
- :margin-right -1%
92
+ margin-right: -1%
86
93
  @else
87
94
  @if !hack
88
- :#margin-right= !s - 1 + "%"
95
+ #margin-right= !s - 1 + "%"
89
96
  @else
90
- :margin-right= !s - 1 + "%"
97
+ margin-right= !s - 1 + "%"
98
+
91
99
 
92
- //**
93
- set on the last element of a row to take side-gutters into account
94
- - set !nested for nested columns
95
- - over-ride !omega_float globally or set +float locally for left-floated omega elements
100
+ // Sets the direction that +omega elements are floated
101
+ // - Override !omega_float globally or set +float locally to change
96
102
  !omega_float ||= "right"
97
103
 
98
- =omega(!nested = false, !right = false)
99
- !s = side_gutter()
104
+
105
+ // Set omega on the last element of a row to take side-gutters
106
+ // and the page edge into account. Set the !nested argument for nested columns.
107
+ // It is recommended that you pass the actual nested context when nested,
108
+ // rather than a true/false argument, for the sake of consistency. Effect is the same.
109
+ =omega(!nested = false)
100
110
  +float(!omega_float)
101
111
  @if !nested
102
- :margin-right 0
112
+ margin-right: 0
103
113
  @else
104
- :margin-right= !s + "%"
114
+ margin-right= side_gutter() + "%"
105
115
  @if !hacks
106
116
  /* ugly hacks for IE6-7 */
107
- +ie-omega(!nested, !right,"*")
117
+ +ie-omega(!nested, !omega_float, true)
108
118
  /* end ugly hacks */
109
119
 
110
- //**
111
- set on an element that will span it's entire context
112
- - no need for +columns, +alpha or +omega on a +full element
120
+
121
+ // Set on an element that will span it's entire context.
122
+ // - no need for +columns, +alpha or +omega on a +full element.
113
123
  =full(!nested = false)
114
- :clear both
124
+ clear: both
115
125
  @if !nested == false
116
126
  !s = side_gutter() + "%"
117
127
  margin-right= !s
@@ -0,0 +1,6 @@
1
+ /* @group reset */
2
+ @import compass/reset.sass
3
+
4
+ // HTML5 reset
5
+ +reset-html5
6
+ /* @end */
data/sass/susy/_susy.sass CHANGED
@@ -1,18 +1,24 @@
1
- //**
2
- tell susy whether you are using hacks or conditional comments
1
+ //** Susy **//
2
+ // Updated 11.20.2009 by Eric A. Meyer
3
+
4
+
5
+ // Tell susy whether you are using hacks or conditional comments.
3
6
  !hacks ||= true
4
7
 
8
+
9
+ // Import all the Important Stuff.
10
+ @import compass/css3.sass
5
11
  @import utils.sass
6
12
  @import text.sass
7
13
  @import grid.sass
8
14
 
9
- //**
10
- body font size set to browser default (usually 16px)
15
+
16
+ // Set Susy on your BODY element to get things started.
11
17
  =susy(!align = "center")
12
- // text-align set to center by default for auto-centering layouts
13
- // (override !align for left/right-aligned designs)
14
- :text-align= !align
15
- // set your base font sizes
16
- :font-size= !base_font_size
17
- :line-height= !base_line_height
18
+ // text-align set to center by default for auto-centering layouts
19
+ // - override !align for left/right-aligned designs
20
+ text-align= !align
21
+ // font size is set against the browser default (usually 16px)
22
+ font-size= !base_font_size
23
+ line-height= !base_line_height
18
24
 
data/sass/susy/_text.sass CHANGED
@@ -1,14 +1,15 @@
1
- //** Text Settings **//
1
+ //** Susy Text Settings **//
2
+ // Updated 11.20.2009 by Eric A. Meyer
2
3
 
3
- //**
4
- You set the font and line heights in pixels
4
+
5
+ // The font size and line height are declared in pixels.
6
+ // You override these default settings in base.sass
5
7
  !base_font_size_px ||= 16
6
8
  !base_line_height_px ||= 24
7
9
 
8
10
 
9
- //**
10
- Susy can do the math to make that relative
11
- we call base_font_size function (even though we could do the math here)
12
- because Susy needs to "remember" our base_font_size_px for px2em()
11
+ // Susy will do the math to make those sizes relative.
12
+ // We call base_font_size function (even though we could do the math here)
13
+ // because Susy needs to "remember" our base_font_size_px for px2em()
13
14
  !base_font_size = base_font_size(!base_font_size_px) + "%"
14
15
  !base_line_height = (!base_line_height_px / !base_font_size_px) + "em"