compass-aura 0.1.4.1 → 0.1.5

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.
@@ -3,6 +3,7 @@
3
3
  //////////////////////////////
4
4
  @import 'susy';
5
5
  @import 'modular-scale';
6
+ @import 'math';
6
7
 
7
8
  //////////////////////////////
8
9
  // Aurora Variables, Functions, Mixins
@@ -119,4 +119,132 @@
119
119
  // Returns Width of One Gutter
120
120
  @function gutter-width($gutter-col-grid) {
121
121
  @return $gutter-col-grid * nth($gutter-to-col, 1);
122
+ }
123
+
124
+ //////////////////////////////
125
+ // Sidebar Functions
126
+ //////////////////////////////
127
+ @function sidebar-width($overflow: true) {
128
+ // Grab number of sidebars
129
+ $num: nth($sidebars, 1);
130
+
131
+ @if $num > 2 or $num < 0 {
132
+ @warn 'Invalid number of sidebars! You can have 0, 1, or 2 sidebars!';
133
+ @return -1;
134
+ }
135
+
136
+ // Grab length of sidebar variable to determine how to act
137
+ $length: length($sidebars);
138
+
139
+ @if $length < 2 {
140
+ @warn "Not enough arguments! You need to provide at least the number of sidebars and the side of the sidebar! If you do not want sidebars, set $sidebars: 0, 'none';";
141
+ @return -1;
142
+ }
143
+ @else if $length > 4 {
144
+ @warn "Too many arguments!";
145
+ @return -1;
146
+ }
147
+
148
+ @if $length == 2 {
149
+ @if $num == 0 {
150
+ $total-cols: $main-content-cols;
151
+ @return 0;
152
+ }
153
+ @else if $num == 1 {
154
+ @return $total-cols - $main-content-cols;
155
+ }
156
+ @else if $num == 2 {
157
+ $remainder: $total-cols - $main-content-cols;
158
+ $floor: floor($remainder / 2);
159
+ $extra: $remainder - $floor;
160
+ $big: '';
161
+ $small: '';
162
+ @if $floor > $extra {
163
+ $big: $floor;
164
+ $small: $extra;
165
+ }
166
+ @else if $extra > $floor {
167
+ $big: $extra;
168
+ $small: $floor;
169
+ }
170
+ @else {
171
+ $big: $floor;
172
+ $small: $extra;
173
+ }
174
+
175
+ @if $overflow == true {
176
+ @return $big;
177
+ }
178
+ @else {
179
+ @return $small;
180
+ }
181
+ }
182
+ @else {
183
+ @warn 'Invalid number of sidebars! You can have 0, 1, or 2 sidebars!';
184
+ @return -1;
185
+ }
186
+ }
187
+ @else if $length == 3 {
188
+ $sidebar-width: nth($sidebars, 3);
189
+ @if is-int($sidebar-width) == false {
190
+ @warn 'Sidebar width must be an integer!';
191
+ @return -1;
192
+ }
193
+
194
+ @if $num == 0 {
195
+ $total-cols: $main-content-cols;
196
+ @return 0;
197
+ }
198
+ @else if $num == 1 {
199
+ $total-cols: $main-content-cols + $sidebar-width;
200
+ @return $sidebar-width;
201
+ }
202
+ @else if $num == 2 {
203
+ $total-cols: $main-content-cols + 2 * $sidebar-width;
204
+ @return $sidebar-width;
205
+ }
206
+ }
207
+ @else if $length == 4 {
208
+ $sidebar-1-width: nth($sidebars, 3);
209
+ @if is-int($sidebar-1-width) == false {
210
+ @warn 'First sidebar width must be an integer!';
211
+ @return -1;
212
+ }
213
+
214
+ $sidebar-2-width: nth($sidebars, 4);
215
+ @if is-int($sidebar-2-width) == false {
216
+ @warn 'Second sidebar width must be an integer!';
217
+ @return -1;
218
+ }
219
+
220
+ @if $num == 0 {
221
+ $total-cols: $main-content-cols;
222
+ @return 0;
223
+ }
224
+ @else if $num > 1 {
225
+ $total-cols: $main-content-cols + $sidebar-1-width + $sidebar-2-width;
226
+
227
+ $big: '';
228
+ $small: '';
229
+
230
+ @if $sidebar-1-width > $sidebar-2-width {
231
+ $big: $sidebar-1-width;
232
+ $small: $sidebar-2-width;
233
+ }
234
+ @else if $sidebar-1-width < $sidebar-2-width {
235
+ $big: $sidebar-2-width;
236
+ $small: $sidebar-1-width;
237
+ }
238
+ @else {
239
+ $big: $sidebar-1-width;
240
+ $small: $sidebar-2-width;
241
+ }
242
+ @if $overflow == true {
243
+ @return $big;
244
+ }
245
+ @else {
246
+ @return $small;
247
+ }
248
+ }
249
+ }
122
250
  }
@@ -29,6 +29,67 @@
29
29
  @else {
30
30
  $measure: $measure-width;
31
31
  }
32
+
33
+ // Set up sidebars now as sidebars can affect $total-cols
34
+ %primary-sidebar {
35
+ @include columns(sidebar-width());
36
+
37
+ @if nth($sidebars, 2) == 'left' or nth($sidebars, 2) == 'both'{
38
+ float: none;
39
+ @include respond-to('small') {
40
+ @include alpha();
41
+ float: left;
42
+ }
43
+ }
44
+ @else if nth($sidebars, 2) == 'right' {
45
+ float: none;
46
+ @include respond-to('small') {
47
+ float: right;
48
+ @if nth($sidebars, 1) == 1 {
49
+ margin-left: 0;
50
+ margin-right: gutter();
51
+ }
52
+ }
53
+ }
54
+ @else if nth($sidebars, 2) == 'none' {
55
+ float: none;
56
+ @include respond-to('small') {
57
+ float: right;
58
+ }
59
+ }
60
+ @else {
61
+ @warn 'Sidebar side can only have a value of left, right, both, or none';
62
+ }
63
+ }
64
+
65
+ %secondary-sidebar {
66
+ @include columns(sidebar-width($overflow: false));
67
+
68
+ @if nth($sidebars, 2) == 'left' {
69
+ float: none;
70
+ @include respond-to('small') {
71
+ float: left;
72
+ }
73
+ }
74
+ @else if nth($sidebars, 2) == 'right' or nth($sidebars, 2) == 'both' {
75
+ float: none;
76
+ @include respond-to('small') {
77
+ float: right;
78
+ margin-left: 0;
79
+ margin-right: gutter();
80
+ }
81
+ }
82
+ @else if nth($sidebars, 2) == 'none' {
83
+ float: none;
84
+ @include respond-to('small') {
85
+ float: right;
86
+ }
87
+ }
88
+ @else {
89
+ @warn 'Sidebar side can only have a value of left, right, both, or none';
90
+ }
91
+ }
92
+
32
93
  // Set UP Grid
33
94
  // If there's a width, figure out body-font-size for width
34
95
  @if $width {
@@ -88,6 +149,36 @@
88
149
  @include respond-to('small') {
89
150
  @include columns($main-content-cols);
90
151
  }
152
+ @if nth($sidebars, 2) == 'left' or nth($sidebars, 2) == 'both'{
153
+ float: none;
154
+ @include respond-to('small') {
155
+ float: right;
156
+ }
157
+ }
158
+ @else if nth($sidebars, 2) == 'right' {
159
+ float: none;
160
+ @include respond-to('small') {
161
+ @include alpha();
162
+ float: left;
163
+ }
164
+ }
165
+ @else if nth($sidebars, 2) == 'none' {
166
+ float: none;
167
+ @include respond-to('small') {
168
+ @include alpha();
169
+ float: left;
170
+ }
171
+ }
172
+ // Add in "Omega"
173
+ @if nth($sidebars, 2) == 'left' {
174
+ @include respond-to('small') {
175
+ margin-left: 0;
176
+ margin-right: gutter();
177
+ }
178
+ }
179
+ @else {
180
+ @warn 'Sidebar side can only have a value of left, right, both, or none';
181
+ }
91
182
  }
92
183
 
93
184
  %aura-container {
@@ -7,6 +7,7 @@ $total-cols: 12 !default;
7
7
  $main-content-cols: 9 !default;
8
8
  $font-scale: true !default;
9
9
  $obj-scale: true !default;
10
+ $sidebars: 1, 'right' !default;
10
11
  // Advanced Options
11
12
  $gutter-to-col: 1, 4 !default;
12
13
  $alphabet-count: 26 !default;
metadata CHANGED
@@ -5,9 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- - 1
10
- version: 0.1.4.1
8
+ - 5
9
+ version: 0.1.5
11
10
  platform: ruby
12
11
  authors:
13
12
  - Sam Richard
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2011-02-15 00:00:00 -05:00
17
+ date: 2011-03-02 00:00:00 -05:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -45,6 +44,20 @@ dependencies:
45
44
  version: "0.9"
46
45
  type: :runtime
47
46
  version_requirements: *id002
47
+ - !ruby/object:Gem::Dependency
48
+ name: sassy-math
49
+ prerelease: false
50
+ requirement: &id003 !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ segments:
55
+ - 0
56
+ - 1
57
+ - 7
58
+ version: 0.1.7
59
+ type: :runtime
60
+ version_requirements: *id003
48
61
  description: Typography based Responsive Framework utilizing Susy and Modular Scale.
49
62
  email:
50
63
  - snugug@gmail.com