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.
@@ -0,0 +1,147 @@
1
+ //** DEFAULT STYLES **//
2
+ // Don't forget to set your default styles.
3
+
4
+
5
+ // Get all the details and mixins from base.sass
6
+ @import base.sass
7
+ // Reset browser defaults, and prepare block-level HTML5 elements
8
+ @import susy/reset.sass
9
+
10
+
11
+ /* @group defaults */
12
+
13
+ body
14
+ +sans-family
15
+ color= !main
16
+
17
+ /* @group links */
18
+
19
+ \:focus
20
+ outline= 1px "dotted" !alt
21
+
22
+ a
23
+ &:link, &:visited
24
+ color= !alt
25
+ &:focus, &:hover, &:active
26
+ color= !alt - #222
27
+ text-decoration: none
28
+
29
+ /* @end */
30
+
31
+
32
+ /* @group headers */
33
+
34
+ h1, h2, h3, h4, h5, h6
35
+ font-weight: bold
36
+
37
+ /* @end */
38
+
39
+
40
+ /* @group forms */
41
+
42
+ form *:focus
43
+ outline: none
44
+
45
+ fieldset
46
+ margin= !base_line_height 0
47
+
48
+ legend
49
+ font-weight: bold
50
+ font-variant: small-caps
51
+
52
+ label
53
+ display: block
54
+ margin-top= !base_line_height
55
+
56
+ legend + label
57
+ margin-top: 0
58
+
59
+ textarea, input[type="text"]
60
+ +box-sizing("border-box")
61
+ width: 100%
62
+
63
+ /* @end */
64
+
65
+
66
+ /* @group tables */
67
+
68
+ /* tables still need 'cellspacing="0"' in the markup */
69
+
70
+ table
71
+ :width 100%
72
+ :border= 1/16 + "em solid" !main + #333
73
+ :left none
74
+ :right none
75
+ :padding= 7/16 + "em 0"
76
+ :margin= 8/16 + "em 0"
77
+
78
+ th
79
+ :font-weight bold
80
+
81
+ /* @end */
82
+
83
+
84
+ /* @group block tags */
85
+
86
+ p
87
+ :margin= !base_line_height 0
88
+
89
+ =list-default(!ol = false)
90
+ :margin= !base_line_height
91
+ @if !ol
92
+ :list-style decimal
93
+ @else
94
+ :list-style disc
95
+
96
+ =no-style-list
97
+ +no-bullets
98
+ :margin 0
99
+ :padding 0
100
+
101
+ ol
102
+ +list-default("ol")
103
+
104
+ ul
105
+ +list-default
106
+
107
+ blockquote
108
+ :margin= !base_line_height
109
+ +serif-family
110
+
111
+ /* @end */
112
+
113
+
114
+ /* @group inline tags */
115
+
116
+ cite
117
+ :font-style italic
118
+
119
+ em
120
+ :font-style italic
121
+
122
+ strong
123
+ :font-weight bold
124
+
125
+ ins
126
+ :text-decoration underline
127
+
128
+ del
129
+ :text-decoration line-through
130
+
131
+ q
132
+ :font-style italic
133
+ em
134
+ :font-style normal
135
+
136
+ /* @end */
137
+
138
+
139
+ /* @group replaced tags */
140
+
141
+ img
142
+ :vertical-align bottom
143
+
144
+ /* @end */
145
+
146
+
147
+ /* @end */
@@ -5,6 +5,5 @@
5
5
  <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
6
6
  <![endif]-->
7
7
 
8
- /* @group defaults */
9
- @import base.sass
10
- /* @end */
8
+
9
+ @import base.sass
@@ -2,3 +2,4 @@ stylesheet 'screen.sass', :media => "screen, projection"
2
2
  stylesheet 'print.sass', :media => "print"
3
3
  stylesheet 'ie.sass', :media => "screen, projection"
4
4
  stylesheet '_base.sass'
5
+ stylesheet '_defaults.sass'
@@ -3,10 +3,5 @@
3
3
  Import this file using the following HTML or equivalent:
4
4
  <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" />
5
5
 
6
- /* @group reset */
7
- @import compass/reset.sass
8
- /* @end */
9
6
 
10
- /* @group defaults */
11
- @import base.sass
12
- /* @end */
7
+ @import defaults.sass
@@ -3,13 +3,8 @@
3
3
  Import this file using the following HTML or equivalent:
4
4
  <link href="/stylesheets/screen.css" media="screen" rel="stylesheet" type="text/css" />
5
5
 
6
- /* @group reset */
7
- @import compass/reset.sass
8
- /* @end */
9
6
 
10
- /* @group defaults */
11
- @import base.sass
12
- /* @end */
7
+ @import defaults.sass
13
8
 
14
9
 
15
10
  /* @group STRUCTURE */
@@ -42,10 +37,8 @@
42
37
 
43
38
  /* @group DEBUG */
44
39
 
45
- /* uncomment, adjust and use for debugging */
46
-
47
- /*
48
- #page
49
- +show-grid("grid.png")
40
+ // Uncomment, adjust and use for debugging
41
+ // #page
42
+ // +show-grid("your-grid-image.png")
50
43
 
51
44
  /* @end */
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compass-susy-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.7.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Meyer
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-12 00:00:00 -06:00
12
+ date: 2009-11-30 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,17 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
25
- - !ruby/object:Gem::Dependency
26
- name: echoe
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
23
+ version: 0.10.0.pre1
34
24
  version:
35
25
  description: 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.
36
26
  email: eric@oddbird.net
@@ -43,6 +33,7 @@ extra_rdoc_files:
43
33
  - lib/susy/sass_extensions.rb
44
34
  - lib/susy.rb
45
35
  - README.mkdn
36
+ - LICENSE.txt
46
37
  files:
47
38
  - lib/susy/compass_plugin.rb
48
39
  - lib/susy/sass_extensions.rb
@@ -51,19 +42,18 @@ files:
51
42
  - Rakefile
52
43
  - README.mkdn
53
44
  - sass/susy/_grid.sass
45
+ - sass/susy/_reset.sass
54
46
  - sass/susy/_utils.sass
55
47
  - sass/susy/_text.sass
56
48
  - sass/susy/_susy.sass
57
- - templates/project/_base.sass
58
- - templates/project/screen.sass
59
49
  - templates/project/print.sass
50
+ - templates/project/screen.sass
60
51
  - templates/project/ie.sass
52
+ - templates/project/_base.sass
53
+ - templates/project/_defaults.sass
61
54
  - templates/project/manifest.rb
62
55
  - VERSION
63
56
  - LICENSE.txt
64
- - docs/tutorial/index.mkdn
65
- - docs/tutorial/figures/susy_element.png
66
- - docs/tutorial/figures/susy_grid.png
67
57
  - compass-susy-plugin.gemspec
68
58
  has_rdoc: true
69
59
  homepage: http://github.com/ericam/compass-susy-plugin
@@ -74,7 +64,7 @@ rdoc_options:
74
64
  - --line-numbers
75
65
  - --inline-source
76
66
  - --title
77
- - Compass-Susy-plugin
67
+ - Compass-susy-plugin
78
68
  - --main
79
69
  - README.mkdn
80
70
  require_paths:
@@ -93,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
83
  version:
94
84
  requirements: []
95
85
 
96
- rubyforge_project:
86
+ rubyforge_project: compass-susy-plugin
97
87
  rubygems_version: 1.3.5
98
88
  signing_key:
99
89
  specification_version: 3
Binary file
Binary file
@@ -1,303 +0,0 @@
1
- Susy Tutorial
2
- =============
3
-
4
- Once you've [installed
5
- everything](http://github.com/ericam/compass-susy-plugin/tree/master) we can
6
- start building our grid. I'll walk you through the steps. I'm starting with
7
- the assumption that you already know CSS and the Compass/Sass syntax. If you
8
- don't, check out [Chris Eppstein's great
9
- intro](http://wiki.github.com/chriseppstein/compass).
10
-
11
- For a brief overview of Susy's philosophy and goals, see [the
12
- README](http://github.com/ericam/compass-susy-plugin/tree/master#readme).
13
-
14
- On Susy's Terms
15
- ---------------
16
-
17
- Here are the terms to understand for following along and using Susy:
18
-
19
- * There is always a **container** element that wraps the page. This container
20
- will act as our elastic shell. The **container** also represents a grid
21
- structure made up of **columns**, **gutters** between the columns, and
22
- **side gutters** on the outside edges of the grid.
23
-
24
- [![The Susy Grid](figures/susy_grid.png)](figures/susy_grid.png)
25
-
26
- * The base **context** is the number of columns in your grid system, and any
27
- direct children of the **container** will use that base as their
28
- **context**. However, as you continue to nest elements within each other
29
- that context will change. Just remember that the **context** is always the
30
- number of columns spanned by the parent element.
31
-
32
- * There are any number of **grid elements** making up the structure of our
33
- site, nested within the **container**. Each grid element has a width that
34
- spans any number of **columns** along with the **gutters** between those
35
- columns (number of columns minus one), and a right-margin that represents
36
- the gutter to the right of it.
37
-
38
- [![The Susy Grid Element](figures/susy_element.png)](figures/susy_element.png)
39
-
40
- * A **grid element** might also include a **prefix** and/or **suffix** added
41
- as padding on either side. Any **prefix** or **suffix** will span the number
42
- of **columns** given as argument, as well as all associated **gutters** (in
43
- this case the same number of gutters as columns).
44
-
45
- * Any **grid elements** that span the first or last columns in any given
46
- context will sometimes need to handle gutters in special ways. These will be
47
- referred to as the **alpha** and **omega** elements. One element that spans
48
- an entire context (a header or footer perhaps) may be both **alpha** and
49
- **omega**.
50
-
51
- Customizing your Grid System
52
- ----------------------------
53
-
54
- So let's get started. We're going to build a website for Susy. [This
55
- website](http://www.oddbird.net/susy/). It's a simple site but it covers
56
- everything you need to get started on your own.
57
-
58
- Create yourself a Compass project using Susy:
59
-
60
- compass -r susy -f susy susy_tutorial
61
-
62
- Inside the susy_tutorial directory, create an `index.html` file. You can [grab
63
- my source](01_target/index.html).
64
-
65
- Start in your `_base.sass` file (in the `src` directory). That's where you set
66
- all your defaults.
67
-
68
- To create a grid, set the `!grid_unit` (units that your grid is based in),
69
- `!total_cols` (total number of columns in your grid), `!col_width` (width of
70
- columns), `!gutter_width` (width of gutters), and `!side_gutter_width` (width
71
- of side gutters) variables.
72
-
73
- The default values are 16 columns, 4em column widths, 1em gutters and side
74
- gutters that match the internal ones. But we want a 10 column grid, with 5em
75
- columns, 2em gutters and 1em side-gutters.
76
-
77
- Take a look at our target site again, this time [with a grid
78
- overlay](01_target/).
79
-
80
- So we'll set our grid like this:
81
-
82
- !grid_unit = "em"
83
- !total_cols = 10
84
- !col_width = 5
85
- !gutter_width = 2
86
- !side_gutter_width = 1
87
-
88
- Of course, designing in em's, we'll want to get your font sizes set to make
89
- this all meaningful. Do that by assigning a pixel value (without the units) to
90
- `!base_font_size_px` and `!base_line_height_px`. Susy will convert those to a
91
- percentage of the common browser default (16px) and apply them to your grid.
92
-
93
- The default values here are 12px fonts with an 18px line-height. For us:
94
-
95
- !base_font_size_px = 14
96
- !base_line_height_px = 21
97
-
98
- `_base.sass` also has everything you need for setting default font families,
99
- colors to reuse throughout, and default styles for all those elements that
100
- ought have a default (but don't because of the reset). we're going to skip
101
- that for now and play with the fun toys. You can look around at the other
102
- defaults and set what you like, or juse use [mine](../src/_base.sass).
103
-
104
-
105
- Making Semantic Grids
106
- ---------------------
107
-
108
- First the explanation:
109
-
110
- * Use the `+susy` mixin to get things ready, set your base font sizes and
111
- center your grid in the browser window. Change the alignment of your grid in
112
- the window with an optional `left | center | right` argument.
113
-
114
- * Use the `+container` mixin to declare your container element. Besides
115
- building the grid shell, this sets your horizontal margins to auto (for
116
- centered designs) and returns your text-alignment to "left". Change the
117
- internal text alignment with an optional `left | center | right` argument.
118
-
119
- * Use the `+columns` mixin to set the width (in columns) of a grid element.
120
- The first argument is the number of columns to span, the second (optional)
121
- argument is the width (in columns) of the containing element when nesting.
122
- If the element is not nested (its parent is the grid container), don't pass
123
- a second argument. For an element that will span the full width (including
124
- prefix and suffix), you can simply use `+full`, which takes one argument
125
- of the context (in columns) when nested.
126
-
127
- * Use the `+alpha` and `+omega` mixins to declare the first and last elements
128
- in a row. In a nested context `+omega` takes one argument repesenting its
129
- context. `+alpha` is only needed in the very top level, and does nothing in
130
- nested contexts. Neither one is needed on a `+full` element.
131
-
132
- * Use the `+prefix` and `+suffix` mixins with one argument to add that many
133
- grid columns as padding before or after a grid element. These mixins also
134
- take an optional second argument, the size in columns of the containing
135
- element when nested.
136
-
137
- Then we do it. In `screen.sass`, we'll start by declaring our intent to use
138
- Susy, and our container:
139
-
140
- body
141
- +susy
142
-
143
- #page
144
- +container
145
-
146
- That wasn't hard. You might ask why I didn't nest `#page` inside of `body`, as
147
- is so tempting and easy with Sass. It's part personal preference and part
148
- Natalie Downe's voice in my head. Don't nest when you don't need to. It keeps
149
- your output code much cleaner.
150
-
151
- While we're at it, why don't we get the fonts going right from the start?
152
-
153
- #page
154
- +container
155
- +sans-family
156
-
157
- Perfect. Take a look at [the results](02_container/). So far we have:
158
-
159
- * Reset everything. This happens by default in the background.
160
-
161
- * Created an elastic container for our grid at 70em that goes fluid for small
162
- windows (try it!).
163
-
164
-
165
- Laying Out The Components
166
- --------------------------
167
-
168
- It's time to lay out our grid components. We'll just work our way through the
169
- HTML, starting with our brand header (#brand). We can refer back to our [target
170
- site with a grid overlay](01_target/) to see what we need. Looks like our
171
- branding gets an entire row to itself, with the content starting one row
172
- in. For the sake of argument, let's say we want the header content contained
173
- within the middle 8 columns - one in from each end. That means it will be an 8
174
- column element, with 1 column prefixed and one suffixed, for a total of 10
175
- columns - the full width.
176
-
177
- #brand
178
- +columns(8)
179
- +prefix(1)
180
- +suffix(1)
181
-
182
- Since it spans both the first and last columns in the context we'll need to
183
- add:
184
-
185
- +alpha
186
- +omega
187
-
188
- Or we would have to, but there are several shortcuts available to us. To
189
- declare something as full width (both alpha and omega) we can just declare it
190
- as full:
191
-
192
- +full
193
-
194
- There is also a shorcut for prefix and suffix additions (+pad), so we can
195
- simplify down to:
196
-
197
- #brand
198
- +full
199
- +pad(1,1)
200
-
201
- Since we don't have an image in there yet, let's move the text over to line up
202
- with the future placement of our main content area. By turning the `h1` link
203
- into a grid element and prefixing a padding of one column, we can move the
204
- text without any effect on the image that will replace it (using the Compass
205
- utility `+replace-text`, though I'll leave the implementation of that as an
206
- exercise for you to figure out). To line it all up with the content below it,
207
- we'll assign it 5 columns in a context of 8, with the extra 3 split between a
208
- prefix of 1 and a suffix of 2 - giving it a full span again. This time we are
209
- nested and need to supply the context.
210
-
211
- h1 a
212
- +full(8)
213
- +pad(1,2,8)
214
-
215
- Note: when not nested, you *must not declare a context*. If you
216
- do, your side-gutters will be ignored. At every nested layer below that, even
217
- if the context hasn't changed, you *must declare a context* or it will try to
218
- add side-gutters again. That means even if you have one nested element
219
- wrapping the rest at full width and not changing the context, that wrapper
220
- does not get a context but its descendants do, even where that context is the
221
- same as the full page.
222
-
223
- For example, these *will not work*:
224
-
225
- /*because context is declared at the top level:*/
226
- #page
227
- +container
228
-
229
- .inner
230
- +columns(8,10)
231
-
232
- /*because context is not declared in a nested level:*/
233
- #page
234
- +container
235
-
236
- .inner
237
- +columns(10)
238
- #brand
239
- +columns(10)
240
-
241
- This *will work*:
242
-
243
- #page
244
- +container
245
-
246
- .inner
247
- +columns(10)
248
- #brand
249
- +columns(8,10)
250
-
251
- We're only worried about structure for now, so the header is done. Let's move
252
- on to the navigation (#nav). The nav spans 2 columns, including the first
253
- column in it's context.
254
-
255
- #nav
256
- +columns(2)
257
- +alpha
258
-
259
- Done. The #content (which includes both #description and #credit)
260
- spans the remaining 8 columns, including the last one.
261
-
262
- #content
263
- +columns(8)
264
- +omega
265
-
266
- Done. #description spans 5; #credit spans 3 including the last. Both are in a
267
- nested context of 8, which we now need to pass on:
268
-
269
- #description
270
- +columns(5,8)
271
-
272
- #credit
273
- +columns(3,8)
274
- +omega(8)
275
-
276
- Done and done. All we have left is the footer (#site-info) spanning the full
277
- width, but with two blank columns on the left:
278
-
279
- #site-info
280
- +full
281
- +prefix(2)
282
-
283
- Nested in the footer are `.license` and `.styles`, so let's put them in place.
284
- I'm going to say that each should match the width of the element visually
285
- above it on the page. So .license will span 5 columns in its context of 8, and
286
- .styles will span 3 including the last.
287
-
288
- p.license
289
- +columns(5,8)
290
- p.styles
291
- +columns(3,8)
292
- +omega(8)
293
-
294
- And we're done. That's it. That's what Susy does. The details of making it
295
- pretty are left as an exercise for the reader, and have more to do with
296
- Compass than Susy.
297
-
298
- * [The resulting files](03_structure/src/) with [the site structure all in
299
- place](03_structure/) (this should match what you have if you followed
300
- along).
301
-
302
- * [My final styles](../src/) for [the site](http://www.oddbird.net/susy/).
303
-