avalanche-rails 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a258aeb08cff7b0d22d067db4a09aec9a83637aa
4
+ data.tar.gz: 5265fd5ca017a8745ab5d8b46c8f80f7286647c7
5
+ SHA512:
6
+ metadata.gz: 4036c7e04c3aee81dbdf9f1f73e3aa675c86638d91d4154d7e69ab9d1bbde6be41a8656d0f9507bc5923cfc9462e75c2a92804ff8cac810ad97133b534f1c682
7
+ data.tar.gz: 4abe7fab2588e5af039a455d47679f074fed1a0aa731935c124e70d3a4a176a76e39e1414df297d8dc6089bb15f7a14eed3955b4c4f844a5632ec8096ee24a8d
data/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Tom Hare
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # avalanche-rails
2
+
3
+ [Avalanche](https://github.com/colourgarden/avalanche), written by [Tom Hare](https://github.com/colourgarden), packaged for the Rails asset pipeline.
4
+
5
+ ## Usage
6
+
7
+ Add the following to your `Gemfile`:
8
+
9
+ ```
10
+ gem 'avalanche-rails', '~> 1.1.2'
11
+ ```
12
+
13
+ All the following to your stylesheets manifest:
14
+
15
+ ```
16
+ @import 'avalanche';
17
+ ```
18
+
19
+ ## Disclaimer
20
+
21
+ This repo is a Rails gem package. All issues with the library should be reported on the library's [GitHub page](https://github.com/colourgarden/avalanche). This repo will be updated each time a new version of the library is released.
@@ -0,0 +1,8 @@
1
+ require 'avalanche-rails/version'
2
+
3
+ module AvalancheRails
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module AvalancheRails
2
+ module Rails
3
+ VERSION = '1.1.2'
4
+ end
5
+ end
@@ -0,0 +1,328 @@
1
+ /*! Avalanche | MIT License | @colourgarden */
2
+
3
+ /*------------------------------------*\
4
+ SETTINGS
5
+ \*------------------------------------*/
6
+
7
+ $av-namespace: 'grid' !default; // Prefix namespace for grid layout and cells
8
+ $av-gutter: 20px !default; // Gutter between grid cells
9
+
10
+ $av-width-class-namespace: '' !default; // Prefix namespace for width classes. For example; 'col-'
11
+ $av-width-class-style: 'fraction' !default; // Width class naming style. Can be 'fraction', 'percentage' or 'fragment'
12
+ $av-widths: (
13
+ 2,
14
+ 3,
15
+ 4
16
+ ) !default; // Width denominator values. 2 = 1/2, 3 = 1/3 etc. Add/remove as appropriate
17
+
18
+ $av-enable-responsive: true !default;
19
+ $av-breakpoints: (
20
+ "thumb": "screen and (max-width: 499px)",
21
+ "handheld": "screen and (min-width: 500px) and (max-width: 800px)",
22
+ "handheld-and-up": "screen and (min-width: 500px)",
23
+ "pocket": "screen and (max-width: 800px)",
24
+ "lap": "screen and (min-width: 801px) and (max-width: 1024px)",
25
+ "lap-and-up": "screen and (min-width: 801px)",
26
+ "portable": "screen and (max-width: 1024px)",
27
+ "desk": "screen and (min-width: 1025px)",
28
+ "widescreen": "screen and (min-width: 1160px)",
29
+ "retina": "screen and (-webkit-min-device-pixel-ratio: 2), screen and (min-resolution: 192dpi), screen and (min-resolution: 2dppx)"
30
+ ) !default; // Responsive breakpoints. Add/remove as appropriate
31
+
32
+ // Enable/disable grid layouts
33
+ $av-enable-grid-center: false !default;
34
+ $av-enable-grid-cell-center: false !default;
35
+ $av-enable-grid-right: false !default;
36
+ $av-enable-grid-middle: false !default;
37
+ $av-enable-grid-bottom: false !default;
38
+ $av-enable-grid-flush: false !default;
39
+ $av-enable-grid-tiny: false !default;
40
+ $av-enable-grid-small: false !default;
41
+ $av-enable-grid-large: false !default;
42
+ $av-enable-grid-huge: false !default;
43
+ $av-enable-grid-auto: false !default;
44
+ $av-enable-grid-rev: false !default;
45
+
46
+
47
+
48
+
49
+
50
+ /*------------------------------------*\
51
+ LOGIC aka THE MAGIC
52
+ \*------------------------------------*/
53
+
54
+ @function escapeNumerator($numerator, $namespace: ''){
55
+ @if($namespace == ''){
56
+ $numerator-as-string: inspect($numerator);
57
+ $escaped-numerator: '';
58
+
59
+ // Loop through all digits in the numerator and escape individually
60
+ @for $i from 1 through str-length($numerator-as-string){
61
+ $digit: str-slice($numerator-as-string, $i, $i);
62
+ $escaped-numerator: $escaped-numerator+\3+$digit;
63
+ }
64
+
65
+ @return $escaped-numerator;
66
+ } @else {
67
+ @return $numerator;
68
+ }
69
+ }
70
+
71
+ @function avCreateClassName($style, $numerator, $denominator, $breakpoint-alias){
72
+
73
+ $class-name: null;
74
+
75
+ @if $style == 'fraction' or $style == 'fragment'{
76
+ // Set delimiter as slash or text
77
+ $delimiter: if($style == 'fraction', \/, -of-);
78
+ $class-name: #{$av-width-class-namespace}#{escapeNumerator($numerator, $av-width-class-namespace)}#{$delimiter}#{$denominator}#{$breakpoint-alias};
79
+ } @else{
80
+ @if $av-width-class-namespace == ''{
81
+ @error "Percentage value class names require a namespace to be set (see $av-width-class-namespace). Selective escaping (e.g. the 5 of 50) cannot be done.";
82
+ }
83
+ $class-width: floor(($numerator / $denominator) * 100);
84
+ $class-name: #{$av-width-class-namespace}#{$class-width}#{$breakpoint-alias};
85
+ }
86
+
87
+ @return $class-name;
88
+ }
89
+
90
+ @mixin av-create-widths($widths, $breakpoint-alias: null){
91
+
92
+ // Initialise an empty utility map that will eventually contain all our classes
93
+ $pseudo-class-map: ();
94
+
95
+ // Loop widths
96
+ @each $denominator in $widths{
97
+
98
+ // If 1=1, 2=2, 3=3; @for will skip over so create 1/1 class manually
99
+ @if ($denominator == 1) {
100
+
101
+ // Create 1/1 class
102
+ $class-name: avCreateClassName($av-width-class-style, 1, 1, $breakpoint-alias);
103
+ .#{$class-name}{
104
+ width: 100%;
105
+ }
106
+
107
+ } @else {
108
+
109
+ // Loop widths as fractions
110
+ @for $numerator from 1 to $denominator{
111
+
112
+ // Create class name and set width value
113
+ $class-name: avCreateClassName($av-width-class-style, $numerator,$denominator, $breakpoint-alias);
114
+ $width-value: percentage($numerator / $denominator);
115
+
116
+ // Is this width already in our utility map?
117
+ $duplicate: map-get($pseudo-class-map, $width-value);
118
+
119
+ // Create width class
120
+ .#{$class-name}{
121
+
122
+ // If this width is in utility map, @extend the duplicate, else create a new one
123
+ @if $duplicate{
124
+ @extend .#{$duplicate};
125
+ } @else{
126
+ width: $width-value;
127
+ }
128
+ }
129
+
130
+ // Add this class to utility map
131
+ $add-class: ($width-value: $class-name);
132
+ $pseudo-class-map: map-merge($pseudo-class-map, $add-class);
133
+ }
134
+ }
135
+ }
136
+ }
137
+
138
+ @mixin av-mq($alias){
139
+
140
+ // Search breakpoint map for alias
141
+ $query: map-get($av-breakpoints, $alias);
142
+
143
+ // If alias exists, print out media query
144
+ @if $query{
145
+ @media #{$query}{
146
+ @content;
147
+ }
148
+ } @else{
149
+ @error "No breakpoint found for #{$alias}";
150
+ }
151
+ }
152
+
153
+
154
+
155
+
156
+
157
+ /*------------------------------------*\
158
+ GRID LAYOUT
159
+ \*------------------------------------*/
160
+
161
+ .#{$av-namespace}{
162
+ display: block;
163
+ list-style: none;
164
+ padding: 0;
165
+ margin: 0;
166
+ margin-left: -($av-gutter);
167
+ font-size: 0rem;
168
+ }
169
+
170
+ .#{$av-namespace}__cell{
171
+ box-sizing: border-box;
172
+ display: inline-block;
173
+ width: 100%;
174
+ padding: 0;
175
+ padding-left: $av-gutter;
176
+ margin: 0;
177
+ vertical-align: top;
178
+ font-size: 1rem;
179
+ }
180
+
181
+ @if $av-enable-grid-center{
182
+
183
+ .#{$av-namespace}--center{
184
+ text-align: center;
185
+
186
+ > .#{$av-namespace}__cell{
187
+ text-align: left;
188
+ }
189
+ }
190
+ }
191
+
192
+ @if $av-enable-grid-cell-center{
193
+
194
+ .#{$av-namespace}__cell--center{
195
+ display: block;
196
+ margin: 0 auto;
197
+ }
198
+ }
199
+
200
+ @if $av-enable-grid-right{
201
+
202
+ .#{$av-namespace}--right{
203
+ text-align: right;
204
+
205
+ > .#{$av-namespace}__cell{
206
+ text-align: left;
207
+ }
208
+ }
209
+ }
210
+
211
+ @if $av-enable-grid-middle{
212
+
213
+ .#{$av-namespace}--middle{
214
+
215
+ > .#{$av-namespace}__cell{
216
+ vertical-align: middle;
217
+ }
218
+ }
219
+ }
220
+
221
+ @if $av-enable-grid-bottom{
222
+
223
+ .#{$av-namespace}--bottom{
224
+
225
+ > .#{$av-namespace}__cell{
226
+ vertical-align: bottom;
227
+ }
228
+ }
229
+ }
230
+
231
+ @if $av-enable-grid-flush{
232
+
233
+ .#{$av-namespace}--flush{
234
+ margin-left: 0;
235
+
236
+ > .#{$av-namespace}__cell{
237
+ padding-left: 0;
238
+ }
239
+ }
240
+ }
241
+
242
+ @if $av-enable-grid-tiny{
243
+
244
+ .#{$av-namespace}--tiny{
245
+ margin-left: -($av-gutter / 4);
246
+
247
+ > .#{$av-namespace}__cell{
248
+ padding-left: ($av-gutter / 4);
249
+ }
250
+ }
251
+ }
252
+
253
+ @if $av-enable-grid-small{
254
+
255
+ .#{$av-namespace}--small{
256
+ margin-left: -($av-gutter / 2);
257
+
258
+ > .#{$av-namespace}__cell{
259
+ padding-left: ($av-gutter / 2);
260
+ }
261
+ }
262
+ }
263
+
264
+ @if $av-enable-grid-large{
265
+
266
+ .#{$av-namespace}--large{
267
+ margin-left: -($av-gutter * 2);
268
+
269
+ > .#{$av-namespace}__cell{
270
+ padding-left: ($av-gutter * 2);
271
+ }
272
+ }
273
+ }
274
+
275
+ @if $av-enable-grid-huge{
276
+
277
+ .#{$av-namespace}--huge{
278
+ margin-left: -($av-gutter * 4);
279
+
280
+ > .#{$av-namespace}__cell{
281
+ padding-left: ($av-gutter * 4);
282
+ }
283
+ }
284
+ }
285
+
286
+ @if $av-enable-grid-auto{
287
+
288
+ .#{$av-namespace}--auto{
289
+
290
+ > .#{$av-namespace}__cell{
291
+ width: auto;
292
+ }
293
+ }
294
+ }
295
+
296
+ @if $av-enable-grid-rev{
297
+
298
+ .#{$av-namespace}--rev{
299
+ direction: rtl;
300
+
301
+ > .#{$av-namespace}__cell{
302
+ direction: ltr;
303
+ }
304
+ }
305
+ }
306
+
307
+
308
+
309
+
310
+
311
+ /*------------------------------------*\
312
+ GRID WIDTHS
313
+ \*------------------------------------*/
314
+
315
+ // Loop default widths
316
+ @include av-create-widths($av-widths);
317
+
318
+ // If responsive flag enabled, loop breakpoint widths
319
+ @if $av-enable-responsive{
320
+
321
+ @each $alias, $query in $av-breakpoints{
322
+
323
+ // Create each media query
324
+ @media #{$query}{
325
+ @include av-create-widths($av-widths, --#{$alias});
326
+ }
327
+ }
328
+ }
metadata ADDED
@@ -0,0 +1,51 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: avalanche-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Curt Howard
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-07-22 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: A build of the jQuery LiveType Plugin, written by written by Tobal San,
14
+ packaged for the Rails asset pipeline.
15
+ email:
16
+ - choward@weblinc.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - LICENSE
22
+ - README.md
23
+ - lib/avalanche-rails.rb
24
+ - lib/avalanche-rails/version.rb
25
+ - vendor/assets/stylesheets/_avalanche.scss
26
+ homepage: https://github.com/meowsus/avalanche-rails
27
+ licenses:
28
+ - MIT
29
+ metadata: {}
30
+ post_install_message:
31
+ rdoc_options: []
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubyforge_project:
46
+ rubygems_version: 2.5.1
47
+ signing_key:
48
+ specification_version: 4
49
+ summary: A build of the jQuery LiveType Plugin, written by written by Tobal San, packaged
50
+ for the Rails asset pipeline.
51
+ test_files: []