gintonic-rails 0.0.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +56 -6
- data/app/assets/stylesheets/_gintonic.scss +5 -5
- data/app/assets/stylesheets/mixins/_buttons.scss +50 -0
- data/app/assets/stylesheets/mixins/{_tipography.scss → _utils.scss} +7 -8
- data/app/assets/stylesheets/normalize/_normalize.scss +427 -0
- data/lib/generators/gintonic/js/USAGE +11 -0
- data/lib/generators/gintonic/js/js_generator.rb +26 -0
- data/lib/generators/gintonic/js/templates/application.js +11 -0
- data/lib/generators/gintonic/js/templates/ready.js +4 -0
- data/lib/generators/gintonic/styles/USAGE +12 -0
- data/lib/generators/gintonic/styles/styles_generator.rb +25 -0
- data/lib/generators/gintonic/styles/templates/application.scss +5 -0
- data/lib/gintonic-rails/engine.rb +15 -0
- data/lib/gintonic-rails/version.rb +1 -1
- data/lib/gintonic-rails.rb +1 -7
- metadata +90 -67
- data/.gitignore +0 -17
- data/LICENSE.txt +0 -22
- data/app/assets/stylesheets/mixins/_blocks.scss +0 -19
- data/app/assets/stylesheets/mixins/_css3.scss +0 -24
- data/app/assets/stylesheets/utils/_functions.scss +0 -22
- data/app/assets/stylesheets/utils/_normalize.scss +0 -220
- data/gintonic-rails.gemspec +0 -24
data/README.md
CHANGED
@@ -1,24 +1,73 @@
|
|
1
1
|
# Gintonic::Rails
|
2
2
|
|
3
|
-
|
3
|
+
A lightweight sass mixins library to make easy front-end rails developers.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
7
|
+
Just add this line to the assets group in your application's Gemfile:
|
8
8
|
|
9
9
|
gem 'gintonic-rails'
|
10
10
|
|
11
11
|
And then execute:
|
12
12
|
|
13
|
-
$ bundle
|
13
|
+
$ bundle install
|
14
14
|
|
15
|
-
|
15
|
+
You are ready to import gintonic at the beginnign of application.css.scss (all is written with scss syntax):
|
16
16
|
|
17
|
-
|
17
|
+
@import "gintonic";
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
21
|
-
|
21
|
+
**Reset:**
|
22
|
+
The importation includes by default normalize.css v2.1.2 http://git.io/normalize.
|
23
|
+
You can also import in any other file:
|
24
|
+
|
25
|
+
@include normalize;
|
26
|
+
|
27
|
+
**CSS3 mixins:**
|
28
|
+
There is a global funtion to add vendor prefixes
|
29
|
+
Example:
|
30
|
+
|
31
|
+
element {
|
32
|
+
@include prefixer(border-radius, $values, moz o webkit w3c);
|
33
|
+
}
|
34
|
+
|
35
|
+
Default prefixes:
|
36
|
+
- border-radius
|
37
|
+
- box-shadow
|
38
|
+
- transform
|
39
|
+
- transition
|
40
|
+
- transition
|
41
|
+
- transition-delay
|
42
|
+
- transition-duration
|
43
|
+
|
44
|
+
Example:
|
45
|
+
|
46
|
+
element {
|
47
|
+
@include box-shadow(inset 0 0 3px black, 1px 1px 0 white);
|
48
|
+
}
|
49
|
+
|
50
|
+
**Structure mixins:**
|
51
|
+
Cross browser block styles with support >IE8, FF, Chrome, Opera
|
52
|
+
- clearfix
|
53
|
+
- inline-block
|
54
|
+
|
55
|
+
**Tipography mixins:**
|
56
|
+
- font-face: FontFace declaration mixin
|
57
|
+
- hover-link: Disable link underline and activate it on hover
|
58
|
+
- hide-text: Hide text and show a image instead
|
59
|
+
|
60
|
+
Examples:
|
61
|
+
|
62
|
+
@include font-face("family-name", "file-name");
|
63
|
+
@include font-face("family-name", "variation-file-name", bold);
|
64
|
+
|
65
|
+
element {
|
66
|
+
@include hover-link();
|
67
|
+
}
|
68
|
+
element {
|
69
|
+
@include hide-text(image-url('bg.png') no-repeat 0 0, 20px, 20px);
|
70
|
+
}
|
22
71
|
|
23
72
|
## Contributing
|
24
73
|
|
@@ -27,3 +76,4 @@ TODO: Write usage instructions here
|
|
27
76
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
77
|
4. Push to the branch (`git push origin my-new-feature`)
|
29
78
|
5. Create new Pull Request
|
79
|
+
|
@@ -1,5 +1,5 @@
|
|
1
|
-
@
|
2
|
-
|
3
|
-
@
|
4
|
-
|
5
|
-
@
|
1
|
+
@import 'normalize/normalize';
|
2
|
+
|
3
|
+
@import "bourbon";
|
4
|
+
|
5
|
+
@import "mixins/utils";
|
@@ -0,0 +1,50 @@
|
|
1
|
+
// Buttons generator
|
2
|
+
// * style: default / inverse
|
3
|
+
// * size: default / medium/ slim
|
4
|
+
|
5
|
+
@mixin btn($color: $blue, $style: "default", $size: "default" ) {
|
6
|
+
display: inline-block;
|
7
|
+
text-align: center;
|
8
|
+
border: 1px solid transparent;
|
9
|
+
border-radius: 25px;
|
10
|
+
@include transition(all 0.3s ease);
|
11
|
+
&:hover {
|
12
|
+
text-decoration: none;
|
13
|
+
}
|
14
|
+
@if $style == "inverse" {
|
15
|
+
color: $color;
|
16
|
+
background: #FFF;
|
17
|
+
border-color: $color;
|
18
|
+
&:hover {
|
19
|
+
color: #FFF;
|
20
|
+
background: $color;
|
21
|
+
border-color: #FFF;
|
22
|
+
}
|
23
|
+
} @else if $style == "hollow" {
|
24
|
+
color: $color;
|
25
|
+
background: transparent;
|
26
|
+
border-color: $color;
|
27
|
+
&:hover {
|
28
|
+
color: #fff;
|
29
|
+
background: $color;
|
30
|
+
border-color: transparent;
|
31
|
+
}
|
32
|
+
} @else {
|
33
|
+
color: #FFF;
|
34
|
+
background: $color;
|
35
|
+
border-color: #FFF;
|
36
|
+
&:hover {
|
37
|
+
color: $color;
|
38
|
+
background: #FFF;
|
39
|
+
border-color: $color;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
@if $size == "slim" {
|
43
|
+
border-radius: 18px;
|
44
|
+
padding: 7px 20px;
|
45
|
+
} @else if $size == "medium" {
|
46
|
+
padding: 10px 28px;
|
47
|
+
} @else {
|
48
|
+
padding: 12px 35px;
|
49
|
+
}
|
50
|
+
}
|
@@ -1,10 +1,3 @@
|
|
1
|
-
@mixin hover-link {
|
2
|
-
text-decoration: none;
|
3
|
-
&:hover {
|
4
|
-
text-decoration: underline;
|
5
|
-
}
|
6
|
-
}
|
7
|
-
|
8
1
|
@mixin font-face($font-family, $file-path, $weight: normal, $style: normal) {
|
9
2
|
@font-face {
|
10
3
|
font-family: $font-family;
|
@@ -16,4 +9,10 @@
|
|
16
9
|
font-url('#{$file-path}.ttf') format('truetype'),
|
17
10
|
font-url('#{$file-path}.svg##{$font-family}') format('svg');
|
18
11
|
}
|
19
|
-
}
|
12
|
+
}
|
13
|
+
|
14
|
+
@mixin media($breakpoint) {
|
15
|
+
@media only screen and (max-width: $breakpoint) {
|
16
|
+
@content;
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,427 @@
|
|
1
|
+
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
|
2
|
+
|
3
|
+
/**
|
4
|
+
* 1. Set default font family to sans-serif.
|
5
|
+
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
6
|
+
* user zoom.
|
7
|
+
*/
|
8
|
+
|
9
|
+
html {
|
10
|
+
font-family: sans-serif; /* 1 */
|
11
|
+
-ms-text-size-adjust: 100%; /* 2 */
|
12
|
+
-webkit-text-size-adjust: 100%; /* 2 */
|
13
|
+
}
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Remove default margin.
|
17
|
+
*/
|
18
|
+
|
19
|
+
body {
|
20
|
+
margin: 0;
|
21
|
+
}
|
22
|
+
|
23
|
+
/* HTML5 display definitions
|
24
|
+
========================================================================== */
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Correct `block` display not defined for any HTML5 element in IE 8/9.
|
28
|
+
* Correct `block` display not defined for `details` or `summary` in IE 10/11
|
29
|
+
* and Firefox.
|
30
|
+
* Correct `block` display not defined for `main` in IE 11.
|
31
|
+
*/
|
32
|
+
|
33
|
+
article,
|
34
|
+
aside,
|
35
|
+
details,
|
36
|
+
figcaption,
|
37
|
+
figure,
|
38
|
+
footer,
|
39
|
+
header,
|
40
|
+
hgroup,
|
41
|
+
main,
|
42
|
+
menu,
|
43
|
+
nav,
|
44
|
+
section,
|
45
|
+
summary {
|
46
|
+
display: block;
|
47
|
+
}
|
48
|
+
|
49
|
+
/**
|
50
|
+
* 1. Correct `inline-block` display not defined in IE 8/9.
|
51
|
+
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
|
52
|
+
*/
|
53
|
+
|
54
|
+
audio,
|
55
|
+
canvas,
|
56
|
+
progress,
|
57
|
+
video {
|
58
|
+
display: inline-block; /* 1 */
|
59
|
+
vertical-align: baseline; /* 2 */
|
60
|
+
}
|
61
|
+
|
62
|
+
/**
|
63
|
+
* Prevent modern browsers from displaying `audio` without controls.
|
64
|
+
* Remove excess height in iOS 5 devices.
|
65
|
+
*/
|
66
|
+
|
67
|
+
audio:not([controls]) {
|
68
|
+
display: none;
|
69
|
+
height: 0;
|
70
|
+
}
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Address `[hidden]` styling not present in IE 8/9/10.
|
74
|
+
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
|
75
|
+
*/
|
76
|
+
|
77
|
+
[hidden],
|
78
|
+
template {
|
79
|
+
display: none;
|
80
|
+
}
|
81
|
+
|
82
|
+
/* Links
|
83
|
+
========================================================================== */
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Remove the gray background color from active links in IE 10.
|
87
|
+
*/
|
88
|
+
|
89
|
+
a {
|
90
|
+
background-color: transparent;
|
91
|
+
}
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Improve readability when focused and also mouse hovered in all browsers.
|
95
|
+
*/
|
96
|
+
|
97
|
+
a:active,
|
98
|
+
a:hover {
|
99
|
+
outline: 0;
|
100
|
+
}
|
101
|
+
|
102
|
+
/* Text-level semantics
|
103
|
+
========================================================================== */
|
104
|
+
|
105
|
+
/**
|
106
|
+
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
|
107
|
+
*/
|
108
|
+
|
109
|
+
abbr[title] {
|
110
|
+
border-bottom: 1px dotted;
|
111
|
+
}
|
112
|
+
|
113
|
+
/**
|
114
|
+
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
|
115
|
+
*/
|
116
|
+
|
117
|
+
b,
|
118
|
+
strong {
|
119
|
+
font-weight: bold;
|
120
|
+
}
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Address styling not present in Safari and Chrome.
|
124
|
+
*/
|
125
|
+
|
126
|
+
dfn {
|
127
|
+
font-style: italic;
|
128
|
+
}
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Address variable `h1` font-size and margin within `section` and `article`
|
132
|
+
* contexts in Firefox 4+, Safari, and Chrome.
|
133
|
+
*/
|
134
|
+
|
135
|
+
h1 {
|
136
|
+
font-size: 2em;
|
137
|
+
margin: 0.67em 0;
|
138
|
+
}
|
139
|
+
|
140
|
+
/**
|
141
|
+
* Address styling not present in IE 8/9.
|
142
|
+
*/
|
143
|
+
|
144
|
+
mark {
|
145
|
+
background: #ff0;
|
146
|
+
color: #000;
|
147
|
+
}
|
148
|
+
|
149
|
+
/**
|
150
|
+
* Address inconsistent and variable font size in all browsers.
|
151
|
+
*/
|
152
|
+
|
153
|
+
small {
|
154
|
+
font-size: 80%;
|
155
|
+
}
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
159
|
+
*/
|
160
|
+
|
161
|
+
sub,
|
162
|
+
sup {
|
163
|
+
font-size: 75%;
|
164
|
+
line-height: 0;
|
165
|
+
position: relative;
|
166
|
+
vertical-align: baseline;
|
167
|
+
}
|
168
|
+
|
169
|
+
sup {
|
170
|
+
top: -0.5em;
|
171
|
+
}
|
172
|
+
|
173
|
+
sub {
|
174
|
+
bottom: -0.25em;
|
175
|
+
}
|
176
|
+
|
177
|
+
/* Embedded content
|
178
|
+
========================================================================== */
|
179
|
+
|
180
|
+
/**
|
181
|
+
* Remove border when inside `a` element in IE 8/9/10.
|
182
|
+
*/
|
183
|
+
|
184
|
+
img {
|
185
|
+
border: 0;
|
186
|
+
}
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Correct overflow not hidden in IE 9/10/11.
|
190
|
+
*/
|
191
|
+
|
192
|
+
svg:not(:root) {
|
193
|
+
overflow: hidden;
|
194
|
+
}
|
195
|
+
|
196
|
+
/* Grouping content
|
197
|
+
========================================================================== */
|
198
|
+
|
199
|
+
/**
|
200
|
+
* Address margin not present in IE 8/9 and Safari.
|
201
|
+
*/
|
202
|
+
|
203
|
+
figure {
|
204
|
+
margin: 1em 40px;
|
205
|
+
}
|
206
|
+
|
207
|
+
/**
|
208
|
+
* Address differences between Firefox and other browsers.
|
209
|
+
*/
|
210
|
+
|
211
|
+
hr {
|
212
|
+
-moz-box-sizing: content-box;
|
213
|
+
box-sizing: content-box;
|
214
|
+
height: 0;
|
215
|
+
}
|
216
|
+
|
217
|
+
/**
|
218
|
+
* Contain overflow in all browsers.
|
219
|
+
*/
|
220
|
+
|
221
|
+
pre {
|
222
|
+
overflow: auto;
|
223
|
+
}
|
224
|
+
|
225
|
+
/**
|
226
|
+
* Address odd `em`-unit font size rendering in all browsers.
|
227
|
+
*/
|
228
|
+
|
229
|
+
code,
|
230
|
+
kbd,
|
231
|
+
pre,
|
232
|
+
samp {
|
233
|
+
font-family: monospace, monospace;
|
234
|
+
font-size: 1em;
|
235
|
+
}
|
236
|
+
|
237
|
+
/* Forms
|
238
|
+
========================================================================== */
|
239
|
+
|
240
|
+
/**
|
241
|
+
* Known limitation: by default, Chrome and Safari on OS X allow very limited
|
242
|
+
* styling of `select`, unless a `border` property is set.
|
243
|
+
*/
|
244
|
+
|
245
|
+
/**
|
246
|
+
* 1. Correct color not being inherited.
|
247
|
+
* Known issue: affects color of disabled elements.
|
248
|
+
* 2. Correct font properties not being inherited.
|
249
|
+
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
|
250
|
+
*/
|
251
|
+
|
252
|
+
button,
|
253
|
+
input,
|
254
|
+
optgroup,
|
255
|
+
select,
|
256
|
+
textarea {
|
257
|
+
color: inherit; /* 1 */
|
258
|
+
font: inherit; /* 2 */
|
259
|
+
margin: 0; /* 3 */
|
260
|
+
}
|
261
|
+
|
262
|
+
/**
|
263
|
+
* Address `overflow` set to `hidden` in IE 8/9/10/11.
|
264
|
+
*/
|
265
|
+
|
266
|
+
button {
|
267
|
+
overflow: visible;
|
268
|
+
}
|
269
|
+
|
270
|
+
/**
|
271
|
+
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
272
|
+
* All other form control elements do not inherit `text-transform` values.
|
273
|
+
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
|
274
|
+
* Correct `select` style inheritance in Firefox.
|
275
|
+
*/
|
276
|
+
|
277
|
+
button,
|
278
|
+
select {
|
279
|
+
text-transform: none;
|
280
|
+
}
|
281
|
+
|
282
|
+
/**
|
283
|
+
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
284
|
+
* and `video` controls.
|
285
|
+
* 2. Correct inability to style clickable `input` types in iOS.
|
286
|
+
* 3. Improve usability and consistency of cursor style between image-type
|
287
|
+
* `input` and others.
|
288
|
+
*/
|
289
|
+
|
290
|
+
button,
|
291
|
+
html input[type="button"], /* 1 */
|
292
|
+
input[type="reset"],
|
293
|
+
input[type="submit"] {
|
294
|
+
-webkit-appearance: button; /* 2 */
|
295
|
+
cursor: pointer; /* 3 */
|
296
|
+
}
|
297
|
+
|
298
|
+
/**
|
299
|
+
* Re-set default cursor for disabled elements.
|
300
|
+
*/
|
301
|
+
|
302
|
+
button[disabled],
|
303
|
+
html input[disabled] {
|
304
|
+
cursor: default;
|
305
|
+
}
|
306
|
+
|
307
|
+
/**
|
308
|
+
* Remove inner padding and border in Firefox 4+.
|
309
|
+
*/
|
310
|
+
|
311
|
+
button::-moz-focus-inner,
|
312
|
+
input::-moz-focus-inner {
|
313
|
+
border: 0;
|
314
|
+
padding: 0;
|
315
|
+
}
|
316
|
+
|
317
|
+
/**
|
318
|
+
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
319
|
+
* the UA stylesheet.
|
320
|
+
*/
|
321
|
+
|
322
|
+
input {
|
323
|
+
line-height: normal;
|
324
|
+
}
|
325
|
+
|
326
|
+
/**
|
327
|
+
* It's recommended that you don't attempt to style these elements.
|
328
|
+
* Firefox's implementation doesn't respect box-sizing, padding, or width.
|
329
|
+
*
|
330
|
+
* 1. Address box sizing set to `content-box` in IE 8/9/10.
|
331
|
+
* 2. Remove excess padding in IE 8/9/10.
|
332
|
+
*/
|
333
|
+
|
334
|
+
input[type="checkbox"],
|
335
|
+
input[type="radio"] {
|
336
|
+
box-sizing: border-box; /* 1 */
|
337
|
+
padding: 0; /* 2 */
|
338
|
+
}
|
339
|
+
|
340
|
+
/**
|
341
|
+
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
|
342
|
+
* `font-size` values of the `input`, it causes the cursor style of the
|
343
|
+
* decrement button to change from `default` to `text`.
|
344
|
+
*/
|
345
|
+
|
346
|
+
input[type="number"]::-webkit-inner-spin-button,
|
347
|
+
input[type="number"]::-webkit-outer-spin-button {
|
348
|
+
height: auto;
|
349
|
+
}
|
350
|
+
|
351
|
+
/**
|
352
|
+
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
|
353
|
+
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
|
354
|
+
* (include `-moz` to future-proof).
|
355
|
+
*/
|
356
|
+
|
357
|
+
input[type="search"] {
|
358
|
+
-webkit-appearance: textfield; /* 1 */
|
359
|
+
-moz-box-sizing: content-box;
|
360
|
+
-webkit-box-sizing: content-box; /* 2 */
|
361
|
+
box-sizing: content-box;
|
362
|
+
}
|
363
|
+
|
364
|
+
/**
|
365
|
+
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
|
366
|
+
* Safari (but not Chrome) clips the cancel button when the search input has
|
367
|
+
* padding (and `textfield` appearance).
|
368
|
+
*/
|
369
|
+
|
370
|
+
input[type="search"]::-webkit-search-cancel-button,
|
371
|
+
input[type="search"]::-webkit-search-decoration {
|
372
|
+
-webkit-appearance: none;
|
373
|
+
}
|
374
|
+
|
375
|
+
/**
|
376
|
+
* Define consistent border, margin, and padding.
|
377
|
+
*/
|
378
|
+
|
379
|
+
fieldset {
|
380
|
+
border: 1px solid #c0c0c0;
|
381
|
+
margin: 0 2px;
|
382
|
+
padding: 0.35em 0.625em 0.75em;
|
383
|
+
}
|
384
|
+
|
385
|
+
/**
|
386
|
+
* 1. Correct `color` not being inherited in IE 8/9/10/11.
|
387
|
+
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
388
|
+
*/
|
389
|
+
|
390
|
+
legend {
|
391
|
+
border: 0; /* 1 */
|
392
|
+
padding: 0; /* 2 */
|
393
|
+
}
|
394
|
+
|
395
|
+
/**
|
396
|
+
* Remove default vertical scrollbar in IE 8/9/10/11.
|
397
|
+
*/
|
398
|
+
|
399
|
+
textarea {
|
400
|
+
overflow: auto;
|
401
|
+
}
|
402
|
+
|
403
|
+
/**
|
404
|
+
* Don't inherit the `font-weight` (applied by a rule above).
|
405
|
+
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
|
406
|
+
*/
|
407
|
+
|
408
|
+
optgroup {
|
409
|
+
font-weight: bold;
|
410
|
+
}
|
411
|
+
|
412
|
+
/* Tables
|
413
|
+
========================================================================== */
|
414
|
+
|
415
|
+
/**
|
416
|
+
* Remove most spacing between table cells.
|
417
|
+
*/
|
418
|
+
|
419
|
+
table {
|
420
|
+
border-collapse: collapse;
|
421
|
+
border-spacing: 0;
|
422
|
+
}
|
423
|
+
|
424
|
+
td,
|
425
|
+
th {
|
426
|
+
padding: 0;
|
427
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
class Gintonic::JsGenerator < Rails::Generators::Base
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
3
|
+
|
4
|
+
def create_structure
|
5
|
+
create_file "app/assets/javascripts/libs/.keep", ""
|
6
|
+
create_file "app/assets/javascripts/modules/.keep", ""
|
7
|
+
end
|
8
|
+
|
9
|
+
def copy_ready_js
|
10
|
+
template 'ready.js',
|
11
|
+
File.join(destination_root, 'app/assets/javascripts/ready.js')
|
12
|
+
end
|
13
|
+
|
14
|
+
def copy_application_js
|
15
|
+
template 'application.js',
|
16
|
+
File.join(destination_root, 'app/assets/javascripts/application.js')
|
17
|
+
end
|
18
|
+
|
19
|
+
def install_jquery_turbolinks
|
20
|
+
begin
|
21
|
+
gem 'jquery-turbolinks'
|
22
|
+
rescue Errno::ENOENT
|
23
|
+
say_status("warning", "It seems you don't have any Gemfile. I hope you are in the dummy app.", :yellow)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// ALERT: Be carefoul, turbolinks must be allways the last one
|
5
|
+
//
|
6
|
+
//= require jquery
|
7
|
+
//= require jquery.turbolinks
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require libs/*
|
10
|
+
//= require ready
|
11
|
+
//= require turbolinks
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Description:
|
2
|
+
Creates a default stylesheets dir structure
|
3
|
+
|
4
|
+
Example:
|
5
|
+
rails generate gintonic:styles
|
6
|
+
|
7
|
+
This will create:
|
8
|
+
app/assets/stylesheets/base/.keep
|
9
|
+
app/assets/stylesheets/libs/.keep
|
10
|
+
app/assets/stylesheets/pages/.keep
|
11
|
+
app/assets/stylesheets/partials/.keep
|
12
|
+
app/assets/stylesheets/application.scss
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Gintonic::StylesGenerator < Rails::Generators::Base
|
2
|
+
source_root File.expand_path('../templates', __FILE__)
|
3
|
+
|
4
|
+
def create_structure
|
5
|
+
create_file "app/assets/stylesheets/base/_layout.scss", ""
|
6
|
+
create_file "app/assets/stylesheets/base/_typography.scss", ""
|
7
|
+
create_file "app/assets/stylesheets/base/_variables.scss", ""
|
8
|
+
create_file "app/assets/stylesheets/libs/.keep", ""
|
9
|
+
create_file "app/assets/stylesheets/pages/.keep", ""
|
10
|
+
create_file "app/assets/stylesheets/partials/.keep", ""
|
11
|
+
end
|
12
|
+
|
13
|
+
def copy_application_css
|
14
|
+
template 'application.css',
|
15
|
+
File.join(destination_root, 'app/assets/stylesheets/application.scss')
|
16
|
+
end
|
17
|
+
|
18
|
+
def install_quite_assets
|
19
|
+
begin
|
20
|
+
gem 'shut_up_assets', group: :development
|
21
|
+
rescue Errno::ENOENT
|
22
|
+
say_status("warning", "It seems you don't have any Gemfile. I hope you are in the dummy app.", :yellow)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'bourbon'
|
2
|
+
|
3
|
+
module Gintonic
|
4
|
+
module Rails
|
5
|
+
class Engine < ::Rails::Engine
|
6
|
+
isolate_namespace Gintonic
|
7
|
+
|
8
|
+
initializer 'gintonic.assets.precompile' do |app|
|
9
|
+
%w(stylesheets javascripts fonts images).each do |dir|
|
10
|
+
app.config.assets.paths << root.join('assets', dir).to_s
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/gintonic-rails.rb
CHANGED
metadata
CHANGED
@@ -1,94 +1,117 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: gintonic-rails
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
12
|
+
- Simplelogica
|
8
13
|
- Victor Ortiz
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2015-10-01 00:00:00 +02:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
15
22
|
name: railties
|
16
|
-
|
17
|
-
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 4
|
30
|
+
- 2
|
31
|
+
version: "4.2"
|
22
32
|
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: sass-rails
|
23
36
|
prerelease: false
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
-
|
31
|
-
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ! '>='
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: 3.2.0
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 4
|
43
|
+
- 0
|
44
|
+
version: "4.0"
|
38
45
|
type: :runtime
|
46
|
+
version_requirements: *id002
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bourbon
|
39
49
|
prerelease: false
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
email:
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
segments:
|
55
|
+
- 4
|
56
|
+
- 2
|
57
|
+
version: "4.2"
|
58
|
+
type: :runtime
|
59
|
+
version_requirements: *id003
|
60
|
+
description: Gintonic is a Sass mixins collection, include normalize 2.1 modified, clearfix, font-face helper and CSS3 properties with vendor prefixes Webkit, Firefox > 3.5, Opera and IE > 8.
|
61
|
+
email:
|
52
62
|
- kespers@gmail.com
|
53
63
|
executables: []
|
64
|
+
|
54
65
|
extensions: []
|
66
|
+
|
55
67
|
extra_rdoc_files: []
|
56
|
-
|
57
|
-
|
58
|
-
- LICENSE.txt
|
59
|
-
- README.md
|
60
|
-
- Rakefile
|
68
|
+
|
69
|
+
files:
|
61
70
|
- app/assets/stylesheets/_gintonic.scss
|
62
|
-
- app/assets/stylesheets/mixins/
|
63
|
-
- app/assets/stylesheets/mixins/
|
64
|
-
- app/assets/stylesheets/
|
65
|
-
-
|
66
|
-
-
|
67
|
-
- gintonic
|
68
|
-
- lib/gintonic
|
71
|
+
- app/assets/stylesheets/mixins/_buttons.scss
|
72
|
+
- app/assets/stylesheets/mixins/_utils.scss
|
73
|
+
- app/assets/stylesheets/normalize/_normalize.scss
|
74
|
+
- lib/generators/gintonic/js/js_generator.rb
|
75
|
+
- lib/generators/gintonic/js/templates/application.js
|
76
|
+
- lib/generators/gintonic/js/templates/ready.js
|
77
|
+
- lib/generators/gintonic/js/USAGE
|
78
|
+
- lib/generators/gintonic/styles/styles_generator.rb
|
79
|
+
- lib/generators/gintonic/styles/templates/application.scss
|
80
|
+
- lib/generators/gintonic/styles/USAGE
|
81
|
+
- lib/gintonic-rails/engine.rb
|
69
82
|
- lib/gintonic-rails/version.rb
|
70
|
-
|
83
|
+
- lib/gintonic-rails.rb
|
84
|
+
- Rakefile
|
85
|
+
- README.md
|
86
|
+
has_rdoc: true
|
87
|
+
homepage: https://github.com/simplelogica/gintonic-rails
|
71
88
|
licenses: []
|
89
|
+
|
72
90
|
post_install_message:
|
73
91
|
rdoc_options: []
|
74
|
-
|
92
|
+
|
93
|
+
require_paths:
|
75
94
|
- lib
|
76
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
requirements:
|
85
|
-
- -
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
95
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
segments:
|
100
|
+
- 0
|
101
|
+
version: "0"
|
102
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
|
+
requirements:
|
104
|
+
- - ">="
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
88
109
|
requirements: []
|
110
|
+
|
89
111
|
rubyforge_project:
|
90
|
-
rubygems_version: 1.
|
112
|
+
rubygems_version: 1.3.6
|
91
113
|
signing_key:
|
92
114
|
specification_version: 3
|
93
115
|
summary: Gintonic Front-End toolbox
|
94
116
|
test_files: []
|
117
|
+
|
data/.gitignore
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2013 Victor Ortiz
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,19 +0,0 @@
|
|
1
|
-
@mixin clearfix {
|
2
|
-
*zoom: 1;
|
3
|
-
&:before,
|
4
|
-
&:after {
|
5
|
-
content: " ";
|
6
|
-
display: table;
|
7
|
-
}
|
8
|
-
&:after {
|
9
|
-
clear: both;
|
10
|
-
}
|
11
|
-
}
|
12
|
-
|
13
|
-
@mixin inline-block {
|
14
|
-
display: inline-block;
|
15
|
-
vertical-align: baseline;
|
16
|
-
zoom: 1;
|
17
|
-
*display: inline;
|
18
|
-
*vertical-align: auto;
|
19
|
-
}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
@mixin border-radius ($values) {
|
2
|
-
@include prefixer(border-radius, $values, moz o webkit w3c);
|
3
|
-
}
|
4
|
-
|
5
|
-
@mixin box-shadow ($values...) {
|
6
|
-
@include prefixer(box-shadow, $values, webkit w3c);
|
7
|
-
-webkit-appearance: none;
|
8
|
-
}
|
9
|
-
|
10
|
-
@mixin transform ($values) {
|
11
|
-
@include prefixer(transform, $values, moz o webkit ms w3c);
|
12
|
-
}
|
13
|
-
|
14
|
-
@mixin transition ($values...) {
|
15
|
-
@include prefixer(transition, $values, moz o webkit ms w3c)
|
16
|
-
}
|
17
|
-
|
18
|
-
@mixin transition-delay ($values...) {
|
19
|
-
@include prefixer(transition-delay, $values, moz webkit w3c);
|
20
|
-
}
|
21
|
-
|
22
|
-
@mixin transition-duration ($values...) {
|
23
|
-
@include prefixer(transition-duration, $values, moz webkit w3c);
|
24
|
-
}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
@mixin prefixer ($property, $value, $prefixes) {
|
2
|
-
@each $prefix in $prefixes {
|
3
|
-
@if $prefix == webkit {
|
4
|
-
-webkit-#{$property}: $value;
|
5
|
-
}
|
6
|
-
@else if $prefix == moz {
|
7
|
-
-moz-#{$property}: $value;
|
8
|
-
}
|
9
|
-
@else if $prefix == ms {
|
10
|
-
-ms-#{$property}: $value;
|
11
|
-
}
|
12
|
-
@else if $prefix == o {
|
13
|
-
-o-#{$property}: $value;
|
14
|
-
}
|
15
|
-
@else if $prefix == w3c {
|
16
|
-
#{$property}: $value;
|
17
|
-
}
|
18
|
-
@else {
|
19
|
-
@warn "Unrecognized prefix: #{$prefix}";
|
20
|
-
}
|
21
|
-
}
|
22
|
-
}
|
@@ -1,220 +0,0 @@
|
|
1
|
-
@mixin normalize {
|
2
|
-
|
3
|
-
article,
|
4
|
-
aside,
|
5
|
-
details,
|
6
|
-
figcaption,
|
7
|
-
figure,
|
8
|
-
footer,
|
9
|
-
header,
|
10
|
-
hgroup,
|
11
|
-
main,
|
12
|
-
nav,
|
13
|
-
section,
|
14
|
-
summary {
|
15
|
-
display: block;
|
16
|
-
}
|
17
|
-
|
18
|
-
audio,
|
19
|
-
canvas,
|
20
|
-
video {
|
21
|
-
display: inline-block;
|
22
|
-
}
|
23
|
-
|
24
|
-
audio:not([controls]) {
|
25
|
-
display: none;
|
26
|
-
height: 0;
|
27
|
-
}
|
28
|
-
|
29
|
-
[hidden] {
|
30
|
-
display: none;
|
31
|
-
}
|
32
|
-
|
33
|
-
html {
|
34
|
-
background: #fff;
|
35
|
-
color: #000;
|
36
|
-
font-family: sans-serif;
|
37
|
-
-ms-text-size-adjust: 100%;
|
38
|
-
-webkit-text-size-adjust: 100%;
|
39
|
-
}
|
40
|
-
|
41
|
-
body {
|
42
|
-
margin: 0;
|
43
|
-
}
|
44
|
-
|
45
|
-
/* ==========================================================================
|
46
|
-
Links
|
47
|
-
========================================================================== */
|
48
|
-
|
49
|
-
a:focus {
|
50
|
-
outline: 0;
|
51
|
-
-webkit-shadow: inset 0 0 0 transparent;
|
52
|
-
-webkit-shadow: 0 0 0 transparent;
|
53
|
-
}
|
54
|
-
|
55
|
-
a:active,
|
56
|
-
a:hover {
|
57
|
-
outline: 0;
|
58
|
-
}
|
59
|
-
|
60
|
-
h1 {
|
61
|
-
font-size: 2em;
|
62
|
-
margin: 0.67em 0;
|
63
|
-
}
|
64
|
-
|
65
|
-
abbr[title] {
|
66
|
-
border-bottom: 1px dotted;
|
67
|
-
}
|
68
|
-
|
69
|
-
b,
|
70
|
-
strong {
|
71
|
-
font-weight: bold;
|
72
|
-
}
|
73
|
-
|
74
|
-
dfn {
|
75
|
-
font-style: italic;
|
76
|
-
}
|
77
|
-
|
78
|
-
hr {
|
79
|
-
-moz-box-sizing: content-box;
|
80
|
-
box-sizing: content-box;
|
81
|
-
height: 0;
|
82
|
-
}
|
83
|
-
|
84
|
-
mark {
|
85
|
-
background: #ff0;
|
86
|
-
color: #000;
|
87
|
-
}
|
88
|
-
|
89
|
-
code,
|
90
|
-
kbd,
|
91
|
-
pre,
|
92
|
-
samp {
|
93
|
-
font-family: monospace, serif;
|
94
|
-
font-size: 1em;
|
95
|
-
}
|
96
|
-
|
97
|
-
pre {
|
98
|
-
white-space: pre-wrap;
|
99
|
-
}
|
100
|
-
|
101
|
-
q {
|
102
|
-
quotes: "\201C" "\201D" "\2018" "\2019";
|
103
|
-
}
|
104
|
-
|
105
|
-
small {
|
106
|
-
font-size: 80%;
|
107
|
-
}
|
108
|
-
|
109
|
-
sub,
|
110
|
-
sup {
|
111
|
-
font-size: 75%;
|
112
|
-
line-height: 0;
|
113
|
-
position: relative;
|
114
|
-
vertical-align: baseline;
|
115
|
-
}
|
116
|
-
|
117
|
-
sup {
|
118
|
-
top: -0.5em;
|
119
|
-
}
|
120
|
-
|
121
|
-
sub {
|
122
|
-
bottom: -0.25em;
|
123
|
-
}
|
124
|
-
|
125
|
-
img {
|
126
|
-
border: 0;
|
127
|
-
}
|
128
|
-
|
129
|
-
svg:not(:root) {
|
130
|
-
overflow: hidden;
|
131
|
-
}
|
132
|
-
|
133
|
-
figure {
|
134
|
-
margin: 0;
|
135
|
-
}
|
136
|
-
|
137
|
-
fieldset {
|
138
|
-
border: 1px solid #c0c0c0;
|
139
|
-
margin: 0 2px;
|
140
|
-
padding: 0.35em 0.625em 0.75em;
|
141
|
-
}
|
142
|
-
|
143
|
-
legend {
|
144
|
-
border: 0;
|
145
|
-
padding: 0;
|
146
|
-
}
|
147
|
-
|
148
|
-
button,
|
149
|
-
input,
|
150
|
-
select,
|
151
|
-
textarea {
|
152
|
-
font-family: inherit;
|
153
|
-
font-size: 100%;
|
154
|
-
margin: 0;
|
155
|
-
}
|
156
|
-
|
157
|
-
button,
|
158
|
-
input {
|
159
|
-
line-height: normal;
|
160
|
-
}
|
161
|
-
|
162
|
-
button,
|
163
|
-
select {
|
164
|
-
text-transform: none;
|
165
|
-
}
|
166
|
-
|
167
|
-
button,
|
168
|
-
html input[type="button"],
|
169
|
-
input[type="reset"],
|
170
|
-
input[type="submit"] {
|
171
|
-
-webkit-appearance: button;
|
172
|
-
cursor: pointer;
|
173
|
-
}
|
174
|
-
|
175
|
-
button[disabled],
|
176
|
-
html input[disabled] {
|
177
|
-
cursor: default;
|
178
|
-
}
|
179
|
-
|
180
|
-
input[type="checkbox"],
|
181
|
-
input[type="radio"] {
|
182
|
-
box-sizing: border-box;
|
183
|
-
padding: 0;
|
184
|
-
}
|
185
|
-
|
186
|
-
input[type="search"] {
|
187
|
-
-webkit-appearance: textfield;
|
188
|
-
-moz-box-sizing: content-box;
|
189
|
-
-webkit-box-sizing: content-box;
|
190
|
-
box-sizing: content-box;
|
191
|
-
}
|
192
|
-
|
193
|
-
input[type="search"]::-webkit-search-cancel-button,
|
194
|
-
input[type="search"]::-webkit-search-decoration {
|
195
|
-
-webkit-appearance: none;
|
196
|
-
}
|
197
|
-
|
198
|
-
button::-moz-focus-inner,
|
199
|
-
input::-moz-focus-inner {
|
200
|
-
border: 0;
|
201
|
-
padding: 0;
|
202
|
-
}
|
203
|
-
|
204
|
-
textarea {
|
205
|
-
overflow: auto;
|
206
|
-
vertical-align: top;
|
207
|
-
}
|
208
|
-
|
209
|
-
table {
|
210
|
-
border-collapse: collapse;
|
211
|
-
border-spacing: 0;
|
212
|
-
}
|
213
|
-
|
214
|
-
ul {
|
215
|
-
padding-left: 0;
|
216
|
-
}
|
217
|
-
|
218
|
-
}
|
219
|
-
|
220
|
-
@include normalize;
|
data/gintonic-rails.gemspec
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'gintonic-rails/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |gem|
|
7
|
-
gem.name = "gintonic-rails"
|
8
|
-
gem.version = Gintonic::Rails::VERSION
|
9
|
-
gem.authors = ["Victor Ortiz"]
|
10
|
-
gem.email = ["kespers@gmail.com"]
|
11
|
-
gem.homepage = ""
|
12
|
-
gem.summary = "Gintonic Front-End toolbox"
|
13
|
-
gem.description = <<-DESC
|
14
|
-
Gintonic is a Sass mixins collection, include normalize 2.1 modified, clearfix, font-face helper and CSS3 properties with vendor prefixes Webkit, Firefox > 3.5, Opera and IE > 8.
|
15
|
-
DESC
|
16
|
-
|
17
|
-
gem.files = `git ls-files`.split($/)
|
18
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
19
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
20
|
-
gem.require_paths = ["lib"]
|
21
|
-
|
22
|
-
gem.add_dependency "railties", "~> 3.1"
|
23
|
-
gem.add_dependency 'sass', '>= 3.2.0'
|
24
|
-
end
|