-
Notifications
You must be signed in to change notification settings - Fork 10
/
_global.scss
executable file
·421 lines (354 loc) · 12.5 KB
/
_global.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
// Foundation by ZURB
// foundation.zurb.com
// Licensed under MIT Open Source
@import "functions";
//
// Foundation Variables
//
// Data attribute namespace
// styles get applied to [data-mysite-plugin], etc
$namespace: false !default;
// The default font-size is set to 100% of the browser style sheet (usually 16px)
// for compatibility with browser-based text zoom or user-set defaults.
// Since the typical default browser font-size is 16px, that makes the calculation for grid size.
// If you want your base font-size to be different and not have it affect the grid breakpoints,
// set $rem-base to $base-font-size and make sure $base-font-size is a px value.
$base-font-size: 100% !default;
// $base-line-height is 24px while $base-font-size is 16px
$base-line-height: 150% !default;
//
// Global Foundation Mixins
//
// @mixins
//
// We use this to control border radius.
// $radius - Default: $global-radius || 4px
@mixin radius($radius:$global-radius) {
@if $radius {
border-radius: $radius;
}
}
// @mixins
//
// We use this to create equal side border radius on elements.
// $side - Options: left, right, top, bottom
@mixin side-radius($side, $radius:$global-radius) {
@if ($side == left or $side == right) {
border-bottom-#{$side}-radius: $radius;
border-top-#{$side}-radius: $radius;
} @else {
border-#{$side}-left-radius: $radius;
border-#{$side}-right-radius: $radius;
}
}
// @mixins
//
// We can control whether or not we have inset shadows edges.
// $active - Default: true, Options: false
@mixin inset-shadow($active:true) {
box-shadow: $shiny-edge-size $shiny-edge-color inset;
@if $active { &:active {
box-shadow: $shiny-edge-size $shiny-edge-active-color inset; } }
}
// @mixins
//
// We use this to add transitions to elements
// $property - Default: all, Options: http://www.w3.org/TR/css3-transitions/#animatable-properties
// $speed - Default: 300ms
// $ease - Default:ease-out, Options: http://css-tricks.com/almanac/properties/t/transition-timing-function/
@mixin single-transition($property:all, $speed:300ms, $ease:ease-out) {
transition: $property $speed $ease;
}
// @mixins
//
// We use this to add box-sizing across browser prefixes
@mixin box-sizing($type:border-box) {
-webkit-box-sizing: $type; // Android < 2.3, iOS < 4
-moz-box-sizing: $type; // Firefox < 29
box-sizing: $type; // Chrome, IE 8+, Opera, Safari 5.1
}
// @mixins
//
// We use this to create isosceles triangles
// $triangle-size - Used to set border-size. No default, set a px or em size.
// $triangle-color - Used to set border-color which makes up triangle. No default
// $triangle-direction - Used to determine which direction triangle points. Options: top, bottom, left, right
@mixin css-triangle($triangle-size, $triangle-color, $triangle-direction) {
content: "";
display: block;
width: 0;
height: 0;
border: inset $triangle-size;
@if ($triangle-direction == top) {
border-color: $triangle-color transparent transparent transparent;
border-top-style: solid;
}
@if ($triangle-direction == bottom) {
border-color: transparent transparent $triangle-color transparent;
border-bottom-style: solid;
}
@if ($triangle-direction == left) {
border-color: transparent transparent transparent $triangle-color;
border-left-style: solid;
}
@if ($triangle-direction == right) {
border-color: transparent $triangle-color transparent transparent;
border-right-style: solid;
}
}
// @mixins
//
// We use this to create the icon with three lines aka the hamburger icon, the menu-icon or the navicon
// $width - Width of hamburger icon in rem
// $left - If false, icon will be centered horizontally || explicitly set value in rem
// $top - If false, icon will be centered vertically || explicitly set value in rem
// $thickness - thickness of lines in hamburger icon, set value in px
// $gap - spacing between the lines in hamburger icon, set value in px
// $color - icon color
// $hover-color - icon color during hover
// $offcanvas - Set to true of @include in offcanvas
@mixin hamburger($width, $left, $top, $thickness, $gap, $color, $hover-color, $offcanvas) {
span::after {
content: "";
position: absolute;
display: block;
height: 0;
@if $offcanvas {
@if $top {
top: $top;
}
@else {
top: 50%;
margin-top: -$width/2;
}
@if $left {
left: $left;
}
@else {
left: ($tabbar-menu-icon-width - $width)/2;
}
}
@else {
top: 50%;
margin-top: -$width/2;
#{$opposite-direction}: $topbar-link-padding;
}
box-shadow:
0 0px 0 $thickness $color,
0 $gap + $thickness 0 $thickness $color,
0 (2 * $gap + 2*$thickness) 0 $thickness $color;
width: $width;
}
span:hover:after {
box-shadow:
0 0px 0 $thickness $hover-color,
0 $gap + $thickness 0 $thickness $hover-color,
0 (2 * $gap + 2*$thickness) 0 $thickness $hover-color;
}
}
// We use this to do clear floats
@mixin clearfix {
&:before, &:after { content: " "; display: table; }
&:after { clear: both; }
}
// @mixins
//
// We use this to add a glowing effect to block elements
// $selector - Used for selector state. Default: focus, Options: hover, active, visited
// $fade-time - Default: 300ms
// $glowing-effect-color - Default: fade-out($primary-color, .25)
@mixin block-glowing-effect($selector:focus, $fade-time:300ms, $glowing-effect-color:fade-out($primary-color, .25)) {
transition: box-shadow $fade-time, border-color $fade-time ease-in-out;
&:#{$selector} {
box-shadow: 0 0 5px $glowing-effect-color;
border-color: $glowing-effect-color;
}
}
// @mixins
//
// We use this to translate elements in 2D
// $horizontal: Default: 0
// $vertical: Default: 0
@mixin translate2d($horizontal:0, $vertical:0) {
transform: translate($horizontal,$vertical)
}
// @mixins
//
// Makes an element visually hidden, but accessible.
// @see http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
@mixin element-invisible {
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
clip: rect(1px, 1px, 1px, 1px);
}
// @mixins
//
// Turns off the element-invisible effect.
@mixin element-invisible-off {
position: static !important;
height: auto;
width: auto;
overflow: visible;
clip: auto;
}
// We use these to define default font weights
$font-weight-normal: normal !default;
$font-weight-bold: bold !default;
// We use these to control various global styles
$body-bg: #fff !default;
$body-font-color: #222 !default;
$body-font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif !default;
$body-font-weight: $font-weight-normal !default;
$body-font-style: normal !default;
// We use this to control font-smoothing
$font-smoothing: antialiased !default;
// We use these to control text direction settings
$text-direction: ltr !default;
$default-float: left !default;
$opposite-direction: right !default;
@if $text-direction == ltr {
$default-float: left;
$opposite-direction: right;
} @else {
$default-float: right;
$opposite-direction: left;
}
// We use these as default colors throughout
$primary-color: #008CBA !default;
$secondary-color: #e7e7e7 !default;
$alert-color: #f04124 !default;
$success-color: #43AC6A !default;
$warning-color: #f08a24 !default;
$info-color: #a0d3e8 !default;
// We use these to make sure border radius matches unless we want it different.
$global-radius: 3px !default;
$global-rounded: 1000px !default;
// We use these to control inset shadow shiny edges and depressions.
$shiny-edge-size: 0 1px 0 !default;
$shiny-edge-color: rgba(#fff, .5) !default;
$shiny-edge-active-color: rgba(#000, .2) !default;
// We use this to control whether or not CSS classes come through in the gem files.
$include-html-classes: true !default;
$include-print-styles: true !default;
$include-html-global-classes: $include-html-classes !default;
$column-gutter: rem-calc(30) !default;
// Media Query Ranges
$small-range: (0em, 40em) !default;
$medium-range: (40.063em, 64em) !default;
$large-range: (64.063em, 90em) !default;
$xlarge-range: (90.063em, 120em) !default;
$xxlarge-range: (120.063em, 99999999em) !default;
$screen: "only screen" !default;
$landscape: "#{$screen} and (orientation: landscape)" !default;
$portrait: "#{$screen} and (orientation: portrait)" !default;
$small-up: $screen !default;
$small-only: "#{$screen} and (max-width: #{upper-bound($small-range)})" !default;
$medium-up: "#{$screen} and (min-width:#{lower-bound($medium-range)})" !default;
$medium-only: "#{$screen} and (min-width:#{lower-bound($medium-range)}) and (max-width:#{upper-bound($medium-range)})" !default;
$large-up: "#{$screen} and (min-width:#{lower-bound($large-range)})" !default;
$large-only: "#{$screen} and (min-width:#{lower-bound($large-range)}) and (max-width:#{upper-bound($large-range)})" !default;
$xlarge-up: "#{$screen} and (min-width:#{lower-bound($xlarge-range)})" !default;
$xlarge-only: "#{$screen} and (min-width:#{lower-bound($xlarge-range)}) and (max-width:#{upper-bound($xlarge-range)})" !default;
$xxlarge-up: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)})" !default;
$xxlarge-only: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)}) and (max-width:#{upper-bound($xxlarge-range)})" !default;
// Legacy
$small: $medium-up;
$medium: $medium-up;
$large: $large-up;
//We use this as cursors values for enabling the option of having custom cursors in the whole site's stylesheet
$cursor-crosshair-value: crosshair !default;
$cursor-default-value: default !default;
$cursor-pointer-value: pointer !default;
$cursor-help-value: help !default;
$cursor-text-value: text !default;
@include exports("global") {
// Meta styles are included in all builds, as they are a dependancy of the Javascript.
// Used to provide media query values for javascript components.
// Forward slash placed around everything to convince PhantomJS to read the value.
meta.foundation-version {
font-family: "/5.3.1/";
}
meta.foundation-mq-small {
font-family: "/" + unquote($small-up) + "/";
width: lower-bound($small-range);
}
meta.foundation-mq-medium {
font-family: "/" + unquote($medium-up) + "/";
width: lower-bound($medium-range);
}
meta.foundation-mq-large {
font-family: "/" + unquote($large-up) + "/";
width: lower-bound($large-range);
}
meta.foundation-mq-xlarge {
font-family: "/" + unquote($xlarge-up) + "/";
width: lower-bound($xlarge-range);
}
meta.foundation-mq-xxlarge {
font-family: "/" + unquote($xxlarge-up) + "/";
width: lower-bound($xxlarge-range);
}
meta.foundation-data-attribute-namespace {
font-family: #{$namespace};
}
@if $include-html-global-classes {
// Must be 100% for off canvas to work
html, body { height: 100%; }
// Set box-sizing globally to handle padding and border widths
*,
*:before,
*:after {
@include box-sizing(border-box);
}
html,
body { font-size: $base-font-size; }
// Default body styles
body {
background: $body-bg;
color: $body-font-color;
padding: 0;
margin: 0;
font-family: $body-font-family;
font-weight: $body-font-weight;
font-style: $body-font-style;
line-height: 1; // Set to $base-line-height to take on browser default of 150%
position: relative;
cursor: $cursor-default-value;
}
a:hover { cursor: $cursor-pointer-value; }
// Grid Defaults to get images and embeds to work properly
img { max-width: 100%; height: auto; }
img { -ms-interpolation-mode: bicubic; }
#map_canvas,
.map_canvas {
img,
embed,
object { max-width: none !important;
}
}
// Miscellaneous useful HTML classes
.left { float: left !important; }
.right { float: right !important; }
.clearfix { @include clearfix; }
.hide { display: none; }
// Font smoothing
// Antialiased font smoothing works best for light text on a dark background.
// Apply to single elements instead of globally to body.
// Note this only applies to webkit-based desktop browsers and Firefox 25 (and later) on the Mac.
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
// Get rid of gap under images by making them display: inline-block; by default
img {
display: inline-block;
vertical-align: middle;
}
//
// Global resets for forms
//
// Make sure textarea takes on height automatically
textarea { height: auto; min-height: 50px; }
// Make select elements 100% width by default
select { width: 100%; }
}
}