_global.scss 17 KB

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