compass-susy-plugin 0.9.alpha.1 → 0.9.alpha.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.
- data/VERSION +1 -1
- data/compass-susy-plugin.gemspec +2 -2
- data/sass/susy/_grid.scss +90 -63
- metadata +4 -4
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.9.alpha.
|
|
1
|
+
0.9.alpha.2
|
data/compass-susy-plugin.gemspec
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = %q{compass-susy-plugin}
|
|
5
|
-
s.version = "0.9.alpha.
|
|
5
|
+
s.version = "0.9.alpha.2"
|
|
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{2011-02-
|
|
9
|
+
s.date = %q{2011-02-16}
|
|
10
10
|
s.description = %q{Responsive web design with grids the quick and reliable way.}
|
|
11
11
|
s.email = %q{eric@oddbird.net}
|
|
12
12
|
s.extra_rdoc_files = ["LICENSE.txt", "README.mkdn", "lib/susy.rb", "lib/susy/compass_plugin.rb"]
|
data/sass/susy/_grid.scss
CHANGED
|
@@ -4,10 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
// Your basic settings for the grid.
|
|
6
6
|
// Override these in base.sass to customize your site.
|
|
7
|
-
$total-cols: 12
|
|
8
|
-
$col-width: 4em
|
|
9
|
-
$gutter-width: 1em
|
|
10
|
-
$side-gutter-width: $gutter-width !default;
|
|
7
|
+
$total-cols : 12 !default;
|
|
8
|
+
$col-width : 4em !default;
|
|
9
|
+
$gutter-width : 1em !default;
|
|
10
|
+
$side-gutter-width : $gutter-width !default;
|
|
11
|
+
|
|
12
|
+
// Controls for right-to-left or bi-directional sites.
|
|
13
|
+
// You can override these case-by-case as needed for bi-directional sites.
|
|
14
|
+
$from-direction : left !default;
|
|
15
|
+
|
|
16
|
+
// Sets the direction that +omega elements are floated by deafult.
|
|
17
|
+
$omega-float : right !default;
|
|
11
18
|
|
|
12
19
|
// Functions -----------------------------------------------------------------
|
|
13
20
|
|
|
@@ -15,70 +22,66 @@ $side-gutter-width: $gutter-width !default;
|
|
|
15
22
|
// plus page padding in non-nested contexts
|
|
16
23
|
@function columns-width(
|
|
17
24
|
$n: false
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
) {
|
|
26
|
+
$sg: 0;
|
|
27
|
+
@if not $n {
|
|
28
|
+
$n: $total-cols;
|
|
29
|
+
$sg: $side-gutter-width;
|
|
30
|
+
}
|
|
31
|
+
$columns-width: ($n*$col-width) + (ceil($n - 1)*$gutter-width) + ($sg*2);
|
|
32
|
+
@return $columns-width;
|
|
26
33
|
}
|
|
27
34
|
|
|
28
35
|
// Return the percentage for the target in a given context
|
|
29
36
|
@function percent-width(
|
|
30
37
|
$t,
|
|
31
38
|
$c
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
) {
|
|
40
|
+
$perc: ($t / $c) * 100%;
|
|
41
|
+
@return $perc;
|
|
35
42
|
}
|
|
36
43
|
|
|
37
44
|
// Return the percentage width of 'n' columns in a context of 'c'
|
|
38
45
|
@function columns(
|
|
39
46
|
$n,
|
|
40
47
|
$c: false
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
) {
|
|
49
|
+
$columns: percent-width(columns-width($n), columns-width($c));
|
|
50
|
+
@return $columns;
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
// Return the percentage width of a single gutter in a context of 'c'
|
|
47
54
|
@function gutter(
|
|
48
55
|
$c: false
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
) {
|
|
57
|
+
$gutter: percent-width($gutter-width, columns-width($c));
|
|
58
|
+
@return $gutter;
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
// Return the percentage width of a single side gutter in a context of 'c'
|
|
55
62
|
@function side-gutter(
|
|
56
63
|
$c: false
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
) {
|
|
65
|
+
$side-gutter: percent-width($side-gutter-width, columns-width($c));
|
|
66
|
+
@return $side-gutter;
|
|
60
67
|
}
|
|
61
68
|
|
|
62
69
|
// Return the percentage width of a single column in a context of 'c'
|
|
63
70
|
@function column(
|
|
64
71
|
$c: false
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
) {
|
|
73
|
+
$column: percent-width($col-width, columns-width($c));
|
|
74
|
+
@return $column;
|
|
68
75
|
}
|
|
69
76
|
|
|
70
77
|
// Base Mixin ----------------------------------------------------------------
|
|
71
78
|
|
|
72
79
|
// Set +container() on the outer grid-containing element(s).
|
|
73
80
|
@mixin container() {
|
|
74
|
-
// clear all floated columns
|
|
75
81
|
@include pie-clearfix;
|
|
76
|
-
// use auto horizontal margins to center your page in the body
|
|
77
82
|
margin: auto;
|
|
78
|
-
// set the page width based on grid settings
|
|
79
83
|
width: columns-width();
|
|
80
|
-
|
|
81
|
-
max-width: 100%;
|
|
84
|
+
max-width: 100%;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
// Column Mixins -------------------------------------------------------------
|
|
@@ -90,9 +93,13 @@ $side-gutter-width: $gutter-width !default;
|
|
|
90
93
|
// - Context MUST NOT be declared on a top-level element.
|
|
91
94
|
// By default a grid-column is floated left with a right gutter.
|
|
92
95
|
// - Override those with +float("right"), +alpha or +omega
|
|
93
|
-
@mixin columns(
|
|
96
|
+
@mixin columns(
|
|
97
|
+
$n,
|
|
98
|
+
$context : false,
|
|
99
|
+
$from : $from-direction
|
|
100
|
+
) {
|
|
94
101
|
// the column is floated left
|
|
95
|
-
@include float(
|
|
102
|
+
@include float($from);
|
|
96
103
|
// the width of the column is set as a percentage of the context
|
|
97
104
|
width: columns($n, $context);
|
|
98
105
|
// the right gutter is added as a percentage of the context
|
|
@@ -100,20 +107,26 @@ $side-gutter-width: $gutter-width !default;
|
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
// Set +un-column to reset a column element to default block behavior
|
|
103
|
-
@mixin un-column
|
|
110
|
+
@mixin un-column(
|
|
111
|
+
$from : $from-direction
|
|
112
|
+
) {
|
|
113
|
+
$to : opposite-position($from);
|
|
104
114
|
float: none;
|
|
105
115
|
display: block;
|
|
106
116
|
width: auto;
|
|
107
|
-
margin
|
|
117
|
+
margin-#{$to}: auto;
|
|
108
118
|
}
|
|
109
119
|
|
|
110
120
|
// Set +full on an element that will span it's entire context.
|
|
111
121
|
// There is no need for +columns, +alpha or +omega on a +full element.
|
|
112
|
-
@mixin full(
|
|
122
|
+
@mixin full(
|
|
123
|
+
$nested: false
|
|
124
|
+
) {
|
|
113
125
|
clear: both;
|
|
114
126
|
@if not $nested {
|
|
115
|
-
margin
|
|
116
|
-
|
|
127
|
+
margin:;
|
|
128
|
+
left: side-gutter();
|
|
129
|
+
right: side-gutter();
|
|
117
130
|
}
|
|
118
131
|
}
|
|
119
132
|
|
|
@@ -121,21 +134,35 @@ $side-gutter-width: $gutter-width !default;
|
|
|
121
134
|
|
|
122
135
|
// Set +prefix() on any element to add empty colums as padding
|
|
123
136
|
// before or after.
|
|
124
|
-
@mixin prefix(
|
|
125
|
-
|
|
137
|
+
@mixin prefix(
|
|
138
|
+
$n,
|
|
139
|
+
$context : false,
|
|
140
|
+
$from : $from-direction
|
|
141
|
+
) {
|
|
142
|
+
padding-#{$from}: columns($n, $context) + gutter($context);
|
|
126
143
|
}
|
|
127
144
|
|
|
128
|
-
@mixin suffix(
|
|
129
|
-
|
|
145
|
+
@mixin suffix(
|
|
146
|
+
$n,
|
|
147
|
+
$context : false,
|
|
148
|
+
$from : $from-direction
|
|
149
|
+
) {
|
|
150
|
+
$to : opposite-position($from);
|
|
151
|
+
padding-#{$to-dir}: columns($n, $context) + gutter($context);
|
|
130
152
|
}
|
|
131
153
|
|
|
132
154
|
// Set as a shortcut for both prefix and suffix.
|
|
133
|
-
@mixin pad(
|
|
155
|
+
@mixin pad(
|
|
156
|
+
$p : false,
|
|
157
|
+
$s : false,
|
|
158
|
+
$c : false,
|
|
159
|
+
$from : $from-direction
|
|
160
|
+
) {
|
|
134
161
|
@if $p {
|
|
135
|
-
@include prefix($p, $c);
|
|
162
|
+
@include prefix($p, $c, $from);
|
|
136
163
|
}
|
|
137
164
|
@if $s {
|
|
138
|
-
@include suffix($s, $c);
|
|
165
|
+
@include suffix($s, $c, $from);
|
|
139
166
|
}
|
|
140
167
|
}
|
|
141
168
|
|
|
@@ -145,33 +172,33 @@ $side-gutter-width: $gutter-width !default;
|
|
|
145
172
|
// context to take side-gutters into account. Recommended that you pass
|
|
146
173
|
// the actual nested contexts (when nested) rather than a true/false
|
|
147
174
|
// argument for the sake of consistency. Effect is the same.
|
|
148
|
-
@mixin alpha(
|
|
175
|
+
@mixin alpha(
|
|
176
|
+
$nested : false,
|
|
177
|
+
$from : $from-direction
|
|
178
|
+
) {
|
|
149
179
|
@if not $nested {
|
|
150
|
-
margin-
|
|
180
|
+
margin-#{$from-dir}: side-gutter();
|
|
151
181
|
} @else {
|
|
152
182
|
@warn "The alpha mixin is not needed in a nested context";
|
|
153
183
|
}
|
|
154
184
|
}
|
|
155
185
|
|
|
156
|
-
// Sets the direction that +omega elements are floated
|
|
157
|
-
// - Override $omega_float globally or set +float locally to change
|
|
158
|
-
$omega-float: right !default;
|
|
159
|
-
|
|
160
186
|
// Set +omega() on the last element of a row, in order to take side-gutters
|
|
161
187
|
// and the page edge into account. Set the $nested argument for nested
|
|
162
188
|
// columns. It is recommended that you pass the actual nested context when
|
|
163
189
|
// nested, rather than a true/false argument, for the sake of consistency.
|
|
164
190
|
// Effect is the same.
|
|
165
|
-
@mixin omega(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
@if $
|
|
173
|
-
|
|
174
|
-
} @else {
|
|
175
|
-
#margin-right: - $gutter-width;
|
|
191
|
+
@mixin omega(
|
|
192
|
+
$nested : false,
|
|
193
|
+
$from : $from-direction
|
|
194
|
+
) {
|
|
195
|
+
$to : opposite-position($from);
|
|
196
|
+
$hack : opposite-position($omega-float);
|
|
197
|
+
$sg : 0;
|
|
198
|
+
@if not $nested {
|
|
199
|
+
$sg: side-gutter();
|
|
176
200
|
}
|
|
201
|
+
@include float($omega-float);
|
|
202
|
+
margin-#{$to-dir}: side-gutter();
|
|
203
|
+
#margin-#{$hack-dir}: - $gutter-width;
|
|
177
204
|
}
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: compass-susy-plugin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash: -
|
|
4
|
+
hash: -3702664224
|
|
5
5
|
prerelease: 4
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 9
|
|
9
9
|
- alpha
|
|
10
|
-
-
|
|
11
|
-
version: 0.9.alpha.
|
|
10
|
+
- 2
|
|
11
|
+
version: 0.9.alpha.2
|
|
12
12
|
platform: ruby
|
|
13
13
|
authors:
|
|
14
14
|
- Eric Meyer
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2011-02-
|
|
19
|
+
date: 2011-02-16 00:00:00 -07:00
|
|
20
20
|
default_executable:
|
|
21
21
|
dependencies:
|
|
22
22
|
- !ruby/object:Gem::Dependency
|