griddyup 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,314 +1,358 @@
1
- // Place all the styles related to the grid controller here.
2
- // They will automatically be included in application.css.
3
- // You can use Sass (SCSS) here: http://sass-lang.com/
4
-
5
- @import "normalize/normalize";
6
-
7
- $DEBUG_MODE: "false"; //enables the use of "random-color-x"
8
-
9
-
10
- @function to-rem($px,$b: $font-base-size) {
11
- @return #{$px/$b}rem;
12
- }
13
- @function to-em($px,$b: $font-base-size) {
14
- @return #{$px/$b}em;
15
- }
16
-
17
-
18
- $max-columns: 8;
19
-
20
- $primary-color: #1976D2;
21
- $primary-color-light: #63a4ff;
22
- $primary-color-dark: #004ba0;
23
-
24
- $secondary-color: #37474F;
25
- $secondary-color-light: #62727b;
26
- $secondary-color-dark: #102027;
27
-
28
- $primary-color-text: #fff;
29
- $primary-color-light-text: #000;
30
- $primary-color-dark-text: #fff;
31
-
32
- $secondary-color-text: #fff;
33
- $secondary-color-light-text:#fff;
34
- $secondary-color-dark-text:#fff;
35
-
36
- .color-primary {
37
- background-color: $primary-color;
38
- color: $primary-color-text;
39
- &.light {
40
- background-color: $primary-color-light;
41
- color: $primary-color-light-text;
42
- }
43
- &.dark {
44
- background-color: $primary-color-dark;
45
- color: $primary-color-dark-text;
46
- }
47
- }
48
-
49
- .color-secondary {
50
- background-color: $secondary-color;
51
- color: $secondary-color-text;
52
- &.light {
53
- background-color: $secondary-color-light;
54
- color: $secondary-color-light-text;
55
- }
56
- &.dark {
57
- background-color: $secondary-color-dark;
58
- color: $secondary-color-dark-text;
59
- }
60
- }
61
-
62
- $font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
63
- $font-family-serif: Georgia, "Times New Roman", Times, serif;
64
- $font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace;
65
- $font-family-base: $font-family-sans-serif;
66
-
67
- $font-size-base: 14px;
68
- $font-size-large: ceil(($font-size-base * 1.25)); // ~18px
69
- $font-size-small: ceil(($font-size-base * 0.85)); // ~12px
70
-
71
- $font-size-h1: floor(($font-size-base * 2.6)); // ~36px
72
- $font-size-h2: floor(($font-size-base * 2.15)); // ~30px
73
- $font-size-h3: ceil(($font-size-base * 1.7)); // ~24px
74
- $font-size-h4: ceil(($font-size-base * 1.25)); // ~18px
75
- $font-size-h5: $font-size-base;
76
- $font-size-h6: ceil(($font-size-base * 0.85)); // ~12px
77
-
78
- $font-size-h-list: $font-size-h1 $font-size-h2 $font-size-h3 $font-size-h4 $font-size-h5 $font-size-h6;
79
-
80
- $line-height-base: 1.428571429; // 20/14
81
- $line-height-computed: floor(($font-size-base * $line-height-base)); // ~20px
82
-
83
- $headings-font-family: inherit;
84
- $headings-font-weight: 500;
85
- $headings-line-height: 1.1;
86
- $headings-color: inherit;
87
-
88
- //Breakpoints
89
- $bp-small: (0,40em);
90
- $bp-medium: (40.00001em,64em);
91
- $bp-large: (64.00001em,90em);
92
- $bp-xlarge: (90.00001, 500000em);
93
-
94
- $row-width-small: 64em;
95
- $row-width-medium: $row-width-small;
96
- $row-width-large: $row-width-medium;
97
- $row-width-xlarge: 80em;
98
-
99
- //Specific breakpoints
100
- $bp-small-up: "only screen";
101
- $bp-small-only: "only screen and (max-width: #{nth($bp-small,2)})";
102
- $bp-small-down: "only screen and (max-width:#{nth($bp-small,2)})";
103
-
104
- $bp-medium-up: "only screen and (min-width: #{nth($bp-medium,1)})";
105
- $bp-medium-only: "only screen and (min-width: #{nth($bp-medium,1)}) and (max-width:#{nth($bp-medium,2)})";
106
- $bp-medium-down: "only screen and (max-width:#{nth($bp-medium,2)})";
107
-
108
- $bp-large-up: "only screen and (min-width: #{nth($bp-large,1)})";
109
- $bp-large-only: "only screen and (min-width: #{nth($bp-large,1)}) and (max-width:#{nth($bp-large,2)})";
110
- $bp-large-down: "only screen and (max-width:#{nth($bp-large,2)})";
111
-
112
- $bp-xlarge-up: "only screen and (min-width: #{nth($bp-xlarge,1)})";
113
- $bp-xlarge-only: "only screen and (min-width: #{nth($bp-xlarge,1)}) and (max-width:#{nth($bp-xlarge,2)})";
114
- $bp-xlarge-down: "only screen";
115
-
116
- * {
117
- box-sizing: border-box;
118
- }
119
-
120
- html,body {
121
- height:100%;
122
- }
123
-
124
- body {
125
- font-size: $font-size-base;
126
- }
127
-
128
- .font-large {
129
- font-size: $font-size-large;
130
- }
131
- .font-small {
132
- font-size: $font-size-small;
133
- }
134
-
135
- @for $i from 1 through 6 {
136
- h#{$i} {
137
- font-family: $headings-font-family;
138
- font-weight: $headings-font-weight;
139
- line-height: $headings-line-height;
140
- color:$headings-color;
141
- font-size: nth($font-size-h-list,$i);
142
- }
143
- }
144
-
145
- .site-container {
146
- height:100%;
147
- display:grid;
148
- grid-template-areas:
149
- "h"
150
- "m"
151
- "f";
152
- grid-template-rows: 1fr 12fr 1fr;
153
- }
154
-
155
- .site-container-aside {
156
- height:100%;
157
- display:grid;
158
- grid-template-areas:
159
- "h h"
160
- "m a"
161
- "f f";
162
- grid-template-rows: 1fr 10fr 1fr;
163
- grid-template-columns: 8fr 4fr;
164
- &-reverse {
165
- @extend .site-container-aside;
166
- grid-template-areas:
167
- "h h"
168
- "a m"
169
- "f f";
170
- grid-template-columns: 4fr 8fr;
171
- }
172
- }
173
- random-color-3
174
- nav {
175
- display:grid;
176
- grid-template-columns: repeat($max-columns,1fr);
177
- grid-auto-flow:column;
178
- grid-area: h;
179
- }
180
-
181
- footer {
182
- display: grid;
183
- grid-area: f;
184
- &.fixed {
185
- grid-template-columns: 1fr 80em 1fr;
186
- grid-auto-flow: row;
187
- & .row {
188
- grid-column-start: 2;
189
- max-width: 80em;
190
- }
191
- }
192
- }
193
-
194
- main {
195
- grid-area: m;
196
- display:inline-grid;
197
- align-content: flex-start;
198
- grid-template-rows: fit-content(0px);
199
- grid-row-gap: 0.4rem;
200
- &.fixed {
201
- grid-template-columns: 1fr 80em 1fr;
202
- grid-auto-flow: row;
203
- & .row {
204
- grid-column-start: 2;
205
- max-width: 80em;
206
- }
207
- }
208
- }
209
-
210
- aside {
211
- grid-area: a;
212
- }
213
-
214
- .row {
215
- display:grid;
216
- grid-template-columns: repeat($max-columns,1fr);
217
- grid-gap: 0.4rem;
218
- }
219
-
220
- @for $i from 1 through $max-columns {
221
- .random-color-#{$i} {
222
- $alpha: random(100)/100;
223
- $red: random(256)-1;
224
- $green: random(256)-1;
225
- $blue: random(256)-1;
226
- $color: unquote("rgb(#{$red}, #{$green}, #{$blue})");
227
- @if $DEBUG_MODE == 'true' {
228
- background-color:$color;
229
- }
230
- }
231
- }
232
-
233
- @mixin columns($size) {
234
- @for $i from 1 through $max-columns {
235
- .#{$size}-col-#{$i} {
236
- grid-column: span $i;
237
- }
238
- }
239
- }
240
-
241
- @mixin hide($size) {
242
- @for $i from 1 through $max-columns {
243
- .#{$size}-hide {
244
- display:none;
245
- }
246
- }
247
- }
248
-
249
- @mixin show($size) {
250
- @for $i from 1 through $max-columns {
251
- $show-small: none;
252
- $show-medium: none;
253
- $show-large: none;
254
- $show-xlarge: none;
255
-
256
- @if $size=="s" {
257
- $show-small: inherit;
258
- }
259
- @if $size=="m" {
260
- $show-medium: inherit;
261
- }
262
- @if $size=="l" {
263
- $show-large: inherit;
264
- }
265
- @if $size=="l" {
266
- $show-xlarge: inherit;
267
- }
268
- .s-only {
269
- display:$show-small;
270
- }
271
- .m-only {
272
- display:$show-medium;
273
- }
274
- .l-only {
275
- display:$show-large;
276
- }
277
- .xl-only {
278
- display:$show-xlarge;
279
- }
280
- }
281
- }
282
-
283
- @for $i from 1 through $max-columns {
284
- .col-#{$i} {
285
- grid-column: span $i;
286
- }
287
- }
288
-
289
- @media #{$bp-small-only} {
290
- @include hide("s");
291
- }
292
-
293
- @media #{$bp-medium-only} {
294
- @include hide("m");
295
- }
296
-
297
- @media #{$bp-large-up} { //change to bp-large-only if xlarge should be used
298
- @include hide("l");
299
- }
300
-
301
- @media #{$bp-small-up} {
302
- @include columns("s");
303
- @include show("s");
304
- }
305
-
306
- @media #{$bp-medium-up} {
307
- @include columns("m");
308
- @include show("m");
309
- }
310
-
311
- @media #{$bp-large-up} {
312
- @include columns("l");
313
- @include show("l");
314
- }
1
+ // Place all the styles related to the grid controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
4
+
5
+ @import "normalize/normalize";
6
+
7
+ $DEBUG_MODE: "false"; //enables the use of "random-color-x"
8
+
9
+
10
+ @function to-rem($px,$b: $font-base-size) {
11
+ @return #{$px/$b}rem;
12
+ }
13
+ @function to-em($px,$b: $font-base-size) {
14
+ @return #{$px/$b}em;
15
+ }
16
+
17
+
18
+ $max-columns: 8;
19
+
20
+ $primary-color: #1976D2;
21
+ $primary-color-light: #63a4ff;
22
+ $primary-color-dark: #004ba0;
23
+
24
+ $secondary-color: #37474F;
25
+ $secondary-color-light: #62727b;
26
+ $secondary-color-dark: #102027;
27
+
28
+ $primary-color-text: #fff;
29
+ $primary-color-light-text: #000;
30
+ $primary-color-dark-text: #fff;
31
+
32
+ $secondary-color-text: #fff;
33
+ $secondary-color-light-text:#fff;
34
+ $secondary-color-dark-text:#fff;
35
+
36
+ .color-primary {
37
+ background-color: $primary-color;
38
+ color: $primary-color-text;
39
+ &.light {
40
+ background-color: $primary-color-light;
41
+ color: $primary-color-light-text;
42
+ }
43
+ &.dark {
44
+ background-color: $primary-color-dark;
45
+ color: $primary-color-dark-text;
46
+ }
47
+ }
48
+
49
+ .color-secondary {
50
+ background-color: $secondary-color;
51
+ color: $secondary-color-text;
52
+ &.light {
53
+ background-color: $secondary-color-light;
54
+ color: $secondary-color-light-text;
55
+ }
56
+ &.dark {
57
+ background-color: $secondary-color-dark;
58
+ color: $secondary-color-dark-text;
59
+ }
60
+ }
61
+
62
+ $font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
63
+ $font-family-serif: Georgia, "Times New Roman", Times, serif;
64
+ $font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace;
65
+ $font-family-base: $font-family-sans-serif;
66
+
67
+ $font-size-base: 14px;
68
+ $font-size-large: ceil(($font-size-base * 1.25)); // ~18px
69
+ $font-size-small: ceil(($font-size-base * 0.85)); // ~12px
70
+
71
+ $font-size-h1: floor(($font-size-base * 2.6)); // ~36px
72
+ $font-size-h2: floor(($font-size-base * 2.15)); // ~30px
73
+ $font-size-h3: ceil(($font-size-base * 1.7)); // ~24px
74
+ $font-size-h4: ceil(($font-size-base * 1.25)); // ~18px
75
+ $font-size-h5: $font-size-base;
76
+ $font-size-h6: ceil(($font-size-base * 0.85)); // ~12px
77
+
78
+ $font-size-h-list: $font-size-h1 $font-size-h2 $font-size-h3 $font-size-h4 $font-size-h5 $font-size-h6;
79
+
80
+ $line-height-base: 1.428571429; // 20/14
81
+ $line-height-computed: floor(($font-size-base * $line-height-base)); // ~20px
82
+
83
+ $headings-font-family: inherit;
84
+ $headings-font-weight: 500;
85
+ $headings-line-height: 1.1;
86
+ $headings-color: inherit;
87
+
88
+ //Breakpoints
89
+ $bp-small: (0,40em);
90
+ $bp-medium: (40.00001em,64em);
91
+ $bp-large: (64.00001em,90em);
92
+ $bp-xlarge: (90.00001, 500000em);
93
+
94
+ $row-width-small: 64em;
95
+ $row-width-medium: $row-width-small;
96
+ $row-width-large: $row-width-medium;
97
+ $row-width-xlarge: 80em;
98
+
99
+ //Specific breakpoints
100
+ $bp-small-up: "only screen";
101
+ $bp-small-only: "only screen and (max-width: #{nth($bp-small,2)})";
102
+ $bp-small-down: "only screen and (max-width:#{nth($bp-small,2)})";
103
+
104
+ $bp-medium-up: "only screen and (min-width: #{nth($bp-medium,1)})";
105
+ $bp-medium-only: "only screen and (min-width: #{nth($bp-medium,1)}) and (max-width:#{nth($bp-medium,2)})";
106
+ $bp-medium-down: "only screen and (max-width:#{nth($bp-medium,2)})";
107
+
108
+ $bp-large-up: "only screen and (min-width: #{nth($bp-large,1)})";
109
+ $bp-large-only: "only screen and (min-width: #{nth($bp-large,1)}) and (max-width:#{nth($bp-large,2)})";
110
+ $bp-large-down: "only screen and (max-width:#{nth($bp-large,2)})";
111
+
112
+ $bp-xlarge-up: "only screen and (min-width: #{nth($bp-xlarge,1)})";
113
+ $bp-xlarge-only: "only screen and (min-width: #{nth($bp-xlarge,1)}) and (max-width:#{nth($bp-xlarge,2)})";
114
+ $bp-xlarge-down: "only screen";
115
+
116
+ * {
117
+ box-sizing: border-box;
118
+ }
119
+
120
+ html,body {
121
+ height:100%;
122
+ }
123
+
124
+ body {
125
+ font-size: $font-size-base;
126
+ }
127
+
128
+ .font-large {
129
+ font-size: $font-size-large;
130
+ }
131
+ .font-small {
132
+ font-size: $font-size-small;
133
+ }
134
+
135
+ @for $i from 1 through 6 {
136
+ h#{$i} {
137
+ font-family: $headings-font-family;
138
+ font-weight: $headings-font-weight;
139
+ line-height: $headings-line-height;
140
+ color:$headings-color;
141
+ font-size: nth($font-size-h-list,$i);
142
+ }
143
+ }
144
+
145
+ .grid-container {
146
+ display: grid;
147
+ grid-row-gap: 0.4rem;
148
+ &.fixed {
149
+ max-width: 60em;
150
+ margin-left: auto;
151
+ margin-right: auto;
152
+ }
153
+ }
154
+
155
+ .row {
156
+ display:grid;
157
+ grid-template-columns: repeat($max-columns,1fr);
158
+ grid-gap: 0.4rem;
159
+ }
160
+
161
+ @for $i from 1 through $max-columns {
162
+ .random-color-#{$i} {
163
+ $alpha: random(100)/100;
164
+ $red: random(256)-1;
165
+ $green: random(256)-1;
166
+ $blue: random(256)-1;
167
+ $color: unquote("rgb(#{$red}, #{$green}, #{$blue})");
168
+ @if $DEBUG_MODE == 'true' {
169
+ background-color:$color;
170
+ }
171
+ }
172
+ }
173
+
174
+ @mixin columns($size) {
175
+ @for $i from 1 through $max-columns {
176
+ .#{$size}-col-#{$i} {
177
+ grid-column: span $i;
178
+ }
179
+ }
180
+ }
181
+
182
+ @mixin hide($size) {
183
+ @for $i from 1 through $max-columns {
184
+ .#{$size}-hide {
185
+ display:none;
186
+ }
187
+ }
188
+ }
189
+
190
+ @mixin show($size) {
191
+ @for $i from 1 through $max-columns {
192
+ $show-small: none;
193
+ $show-medium: none;
194
+ $show-large: none;
195
+ $show-xlarge: none;
196
+
197
+ @if $size=="s" {
198
+ $show-small: inherit;
199
+ }
200
+ @if $size=="m" {
201
+ $show-medium: inherit;
202
+ }
203
+ @if $size=="l" {
204
+ $show-large: inherit;
205
+ }
206
+ @if $size=="l" {
207
+ $show-xlarge: inherit;
208
+ }
209
+ .s-only {
210
+ display:$show-small;
211
+ }
212
+ .m-only {
213
+ display:$show-medium;
214
+ }
215
+ .l-only {
216
+ display:$show-large;
217
+ }
218
+ .xl-only {
219
+ display:$show-xlarge;
220
+ }
221
+ }
222
+ }
223
+
224
+ @for $i from 1 through $max-columns {
225
+ .col-#{$i} {
226
+ grid-column: span $i;
227
+ }
228
+ }
229
+
230
+ @media #{$bp-small-only} {
231
+ @include hide("s");
232
+ }
233
+
234
+ @media #{$bp-medium-only} {
235
+ @include hide("m");
236
+ }
237
+
238
+ @media #{$bp-large-up} { //change to bp-large-only if xlarge should be used
239
+ @include hide("l");
240
+ }
241
+
242
+ @media #{$bp-small-up} {
243
+ @include columns("s");
244
+ @include show("s");
245
+ }
246
+
247
+ @media #{$bp-medium-up} {
248
+ @include columns("m");
249
+ @include show("m");
250
+ }
251
+
252
+ @media #{$bp-large-up} {
253
+ @include columns("l");
254
+ @include show("l");
255
+ }
256
+
257
+ $btn-color-default:#FFF ;
258
+ $btn-color-default-text:#333333;
259
+ $btn-color-default-hover:darken($btn-color-default,10%);
260
+
261
+ $btn-color-primary:#BDE5F8 ;
262
+ $btn-color-primary-text:#00529B;
263
+ $btn-color-primary-hover:darken($btn-color-primary,10%);
264
+
265
+ $btn-color-success:#DFF2BF;
266
+ $btn-color-success-text:#4F8A10;
267
+ $btn-color-success-hover:darken($btn-color-success,10%);;
268
+
269
+ $btn-color-warning:#FEEFB3;
270
+ $btn-color-warning-text:#9F6000;
271
+ $btn-color-warning-hover:darken($btn-color-warning,10%);;
272
+
273
+ $btn-color-alert:#FFBABA;
274
+ $btn-color-alert-text:#D8000C;
275
+ $btn-color-alert-hover:darken($btn-color-alert,10%);;
276
+
277
+ form {
278
+ max-width: 100%;
279
+ display: grid;
280
+ grid-gap: 0.4rem;
281
+ & .form-group {
282
+ display:grid;
283
+ grid-gap: 0.2rem;
284
+ grid-template-areas: "l" "i";
285
+ & label {
286
+ grid-area: l;
287
+ max-width: 100%;
288
+ }
289
+ & input {
290
+ grid-area: i;
291
+ max-width: 100%;
292
+ }
293
+ &.inline {
294
+ grid-template-areas: "l i";
295
+ grid-template-columns: 1fr 2fr;
296
+ align-items: center;
297
+ }
298
+ @for $i from 3 through 10 {
299
+ &.inline-#{$i} {
300
+ grid-template-columns: repeat($i,1fr);
301
+ align-items: center;
302
+ }
303
+ }
304
+ }
305
+
306
+ button {
307
+ background-color: $btn-color-default;
308
+ border-color: $btn-color-default;
309
+ color: $btn-color-default-text;
310
+ &:hover {
311
+ background-color: $btn-color-default-hover;
312
+ }
313
+ &.primary {
314
+ background-color: $btn-color-primary;
315
+ border-color: $btn-color-primary;
316
+ color: $btn-color-primary-text;
317
+ &:hover {
318
+ background-color: $btn-color-primary-hover;
319
+ }
320
+ }
321
+ &.success {
322
+ background-color: $btn-color-success;
323
+ border-color: $btn-color-success;
324
+ color: $btn-color-success-text;
325
+ &:hover {
326
+ background-color: $btn-color-success-hover;
327
+ }
328
+ }
329
+ &.warning {
330
+ background-color: $btn-color-warning;
331
+ border-color: $btn-color-warning;
332
+ color: $btn-color-warning-text;
333
+ &:hover {
334
+ background-color: $btn-color-warning-hover;
335
+ }
336
+ }
337
+ &.alert {
338
+ background-color: $btn-color-alert;
339
+ border-color: $btn-color-alert;
340
+ color: $btn-color-alert-text;
341
+ &:hover {
342
+ background-color: $btn-color-alert-hover;
343
+ }
344
+ }
345
+ }
346
+ }
347
+
348
+ input, button, select, textarea {
349
+ padding: 0.3rem;
350
+ border: 0.5px #333 solid;
351
+ border-radius: 0.2rem;
352
+ &:focus {
353
+ border-color: $primary-color-light;
354
+ }
355
+ &:invalid {
356
+ border-color: #990000;
357
+ }
358
+ }