_global.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  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. transition: $property $speed $ease;
  65. }
  66. // @mixins
  67. //
  68. // We use this to add box-sizing across browser prefixes
  69. @mixin box-sizing($type:border-box) {
  70. -webkit-box-sizing: $type; // Android < 2.3, iOS < 4
  71. -moz-box-sizing: $type; // Firefox < 29
  72. box-sizing: $type; // Chrome, IE 8+, Opera, Safari 5.1
  73. }
  74. // @mixins
  75. //
  76. // We use this to create isosceles triangles
  77. // $triangle-size - Used to set border-size. No default, set a px or em size.
  78. // $triangle-color - Used to set border-color which makes up triangle. No default
  79. // $triangle-direction - Used to determine which direction triangle points. Options: top, bottom, left, right
  80. @mixin css-triangle($triangle-size, $triangle-color, $triangle-direction) {
  81. content: "";
  82. display: block;
  83. width: 0;
  84. height: 0;
  85. border: inset $triangle-size;
  86. @if ($triangle-direction == top) {
  87. border-color: $triangle-color transparent transparent transparent;
  88. border-top-style: solid;
  89. }
  90. @if ($triangle-direction == bottom) {
  91. border-color: transparent transparent $triangle-color transparent;
  92. border-bottom-style: solid;
  93. }
  94. @if ($triangle-direction == left) {
  95. border-color: transparent transparent transparent $triangle-color;
  96. border-left-style: solid;
  97. }
  98. @if ($triangle-direction == right) {
  99. border-color: transparent $triangle-color transparent transparent;
  100. border-right-style: solid;
  101. }
  102. }
  103. // @mixins
  104. //
  105. // We use this to create the icon with three lines aka the hamburger icon, the menu-icon or the navicon
  106. // $width - Width of hamburger icon in rem
  107. // $left - If false, icon will be centered horizontally || explicitly set value in rem
  108. // $top - If false, icon will be centered vertically || explicitly set value in rem
  109. // $thickness - thickness of lines in hamburger icon, set value in px
  110. // $gap - spacing between the lines in hamburger icon, set value in px
  111. // $color - icon color
  112. // $hover-color - icon color during hover
  113. // $offcanvas - Set to true of @include in offcanvas
  114. @mixin hamburger($width, $left, $top, $thickness, $gap, $color, $hover-color, $offcanvas) {
  115. span::after {
  116. content: "";
  117. position: absolute;
  118. display: block;
  119. height: 0;
  120. @if $offcanvas {
  121. @if $top {
  122. top: $top;
  123. }
  124. @else {
  125. top: 50%;
  126. margin-top: (-$width/2);
  127. }
  128. @if $left {
  129. left: $left;
  130. }
  131. @else {
  132. left: ($tabbar-menu-icon-width - $width)/2;
  133. }
  134. }
  135. @else {
  136. top: 50%;
  137. margin-top: -($width/2);
  138. #{$opposite-direction}: $topbar-link-padding;
  139. }
  140. box-shadow:
  141. 0 0 0 $thickness $color,
  142. 0 $gap + $thickness 0 $thickness $color,
  143. 0 (2 * $gap + 2*$thickness) 0 $thickness $color;
  144. width: $width;
  145. }
  146. span:hover:after {
  147. box-shadow:
  148. 0 0 0 $thickness $hover-color,
  149. 0 $gap + $thickness 0 $thickness $hover-color,
  150. 0 (2 * $gap + 2*$thickness) 0 $thickness $hover-color;
  151. }
  152. }
  153. // We use this to do clear floats
  154. @mixin clearfix {
  155. &:before, &:after { content: " "; display: table; }
  156. &:after { clear: both; }
  157. }
  158. // @mixins
  159. //
  160. // We use this to add a glowing effect to block elements
  161. // $selector - Used for selector state. Default: focus, Options: hover, active, visited
  162. // $fade-time - Default: 300ms
  163. // $glowing-effect-color - Default: fade-out($primary-color, .25)
  164. @mixin block-glowing-effect($selector:focus, $fade-time:300ms, $glowing-effect-color:fade-out($primary-color, .25)) {
  165. transition: box-shadow $fade-time, border-color $fade-time ease-in-out;
  166. &:#{$selector} {
  167. box-shadow: 0 0 5px $glowing-effect-color;
  168. border-color: $glowing-effect-color;
  169. }
  170. }
  171. // @mixins
  172. //
  173. // We use this to translate elements in 2D
  174. // $horizontal: Default: 0
  175. // $vertical: Default: 0
  176. @mixin translate2d($horizontal:0, $vertical:0) {
  177. transform: translate($horizontal,$vertical)
  178. }
  179. // @mixins
  180. //
  181. // Makes an element visually hidden, but accessible.
  182. // @see http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
  183. @mixin element-invisible {
  184. position: absolute !important;
  185. height: 1px;
  186. width: 1px;
  187. overflow: hidden;
  188. clip: rect(1px, 1px, 1px, 1px);
  189. }
  190. // @mixins
  191. //
  192. // Turns off the element-invisible effect.
  193. @mixin element-invisible-off {
  194. position: static !important;
  195. height: auto;
  196. width: auto;
  197. overflow: visible;
  198. clip: auto;
  199. }
  200. $white : #FFFFFF !default;
  201. $ghost : #FAFAFA !default;
  202. $snow : #F9F9F9 !default;
  203. $vapor : #F6F6F6 !default;
  204. $white-smoke : #F5F5F5 !default;
  205. $silver : #EFEFEF !default;
  206. $smoke : #EEEEEE !default;
  207. $gainsboro : #DDDDDD !default;
  208. $iron : #CCCCCC !default;
  209. $base : #AAAAAA !default;
  210. $aluminum : #999999 !default;
  211. $jumbo : #888888 !default;
  212. $monsoon : #777777 !default;
  213. $steel : #666666 !default;
  214. $charcoal : #555555 !default;
  215. $tuatara : #444444 !default;
  216. $oil : #333333 !default;
  217. $jet : #222222 !default;
  218. $black : #000000 !default;
  219. // We use these as default colors throughout
  220. $primary-color: #008CBA !default; // bondi-blue
  221. $secondary-color: #e7e7e7 !default; // white-lilac
  222. $alert-color: #f04124 !default; // cinnabar
  223. $success-color: #43AC6A !default; // sea-green
  224. $warning-color: #f08a24 !default; // carrot
  225. $info-color: #a0d3e8 !default; // cornflower
  226. // We use these to define default font stacks
  227. $font-family-sans-serif: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif !default;
  228. $font-family-serif: Georgia, Cambria, "Times New Roman", Times, serif !default;
  229. $font-family-monospace: Consolas, "Liberation Mono", Courier, monospace !default;
  230. // We use these to define default font weights
  231. $font-weight-normal: normal !default;
  232. $font-weight-bold: bold !default;
  233. // We use these to control various global styles
  234. $body-bg: #fff !default;
  235. $body-font-color: #222 !default;
  236. $body-font-family: $font-family-sans-serif !default;
  237. $body-font-weight: $font-weight-normal !default;
  238. $body-font-style: normal !default;
  239. // We use this to control font-smoothing
  240. $font-smoothing: antialiased !default;
  241. // We use these to control text direction settings
  242. $text-direction: ltr !default;
  243. $default-float: left !default;
  244. $opposite-direction: right !default;
  245. @if $text-direction == ltr {
  246. $default-float: left;
  247. $opposite-direction: right;
  248. } @else {
  249. $default-float: right;
  250. $opposite-direction: left;
  251. }
  252. // We use these to make sure border radius matches unless we want it different.
  253. $global-radius: 3px !default;
  254. $global-rounded: 1000px !default;
  255. // We use these to control inset shadow shiny edges and depressions.
  256. $shiny-edge-size: 0 1px 0 !default;
  257. $shiny-edge-color: rgba(#fff, .5) !default;
  258. $shiny-edge-active-color: rgba(#000, .2) !default;
  259. // We use this to control whether or not CSS classes come through in the gem files.
  260. $include-html-classes: true !default;
  261. $include-print-styles: true !default;
  262. $include-html-global-classes: $include-html-classes !default;
  263. $column-gutter: rem-calc(30) !default;
  264. // Media Query Ranges
  265. $small-range: (0, 40em) !default;
  266. $medium-range: (40.063em, 64em) !default;
  267. $large-range: (64.063em, 90em) !default;
  268. $xlarge-range: (90.063em, 120em) !default;
  269. $xxlarge-range: (120.063em, 99999999em) !default;
  270. $screen: "only screen" !default;
  271. $landscape: "#{$screen} and (orientation: landscape)" !default;
  272. $portrait: "#{$screen} and (orientation: portrait)" !default;
  273. $small-up: $screen !default;
  274. $small-only: "#{$screen} and (max-width: #{upper-bound($small-range)})" !default;
  275. $medium-up: "#{$screen} and (min-width:#{lower-bound($medium-range)})" !default;
  276. $medium-only: "#{$screen} and (min-width:#{lower-bound($medium-range)}) and (max-width:#{upper-bound($medium-range)})" !default;
  277. $large-up: "#{$screen} and (min-width:#{lower-bound($large-range)})" !default;
  278. $large-only: "#{$screen} and (min-width:#{lower-bound($large-range)}) and (max-width:#{upper-bound($large-range)})" !default;
  279. $xlarge-up: "#{$screen} and (min-width:#{lower-bound($xlarge-range)})" !default;
  280. $xlarge-only: "#{$screen} and (min-width:#{lower-bound($xlarge-range)}) and (max-width:#{upper-bound($xlarge-range)})" !default;
  281. $xxlarge-up: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)})" !default;
  282. $xxlarge-only: "#{$screen} and (min-width:#{lower-bound($xxlarge-range)}) and (max-width:#{upper-bound($xxlarge-range)})" !default;
  283. // Legacy
  284. $small: $medium-up;
  285. $medium: $medium-up;
  286. $large: $large-up;
  287. //We use this as cursors values for enabling the option of having custom cursors in the whole site's stylesheet
  288. $cursor-auto-value: auto !default;
  289. $cursor-crosshair-value: crosshair !default;
  290. $cursor-default-value: default !default;
  291. $cursor-disabled-value: not-allowed !default;
  292. $cursor-pointer-value: pointer !default;
  293. $cursor-help-value: help !default;
  294. $cursor-text-value: text !default;
  295. @include exports("global") {
  296. // Meta styles are included in all builds, as they are a dependancy of the Javascript.
  297. // Used to provide media query values for javascript components.
  298. // Forward slash placed around everything to convince PhantomJS to read the value.
  299. meta.foundation-version {
  300. font-family: "/5.5.1/";
  301. }
  302. meta.foundation-mq-small {
  303. font-family: "/" + unquote($small-up) + "/";
  304. width: lower-bound($small-range);
  305. }
  306. meta.foundation-mq-small-only {
  307. font-family: "/" + unquote($small-only) + "/";
  308. width: lower-bound($small-range);
  309. }
  310. meta.foundation-mq-medium {
  311. font-family: "/" + unquote($medium-up) + "/";
  312. width: lower-bound($medium-range);
  313. }
  314. meta.foundation-mq-medium-only {
  315. font-family: "/" + unquote($medium-only) + "/";
  316. width: lower-bound($medium-range);
  317. }
  318. meta.foundation-mq-large {
  319. font-family: "/" + unquote($large-up) + "/";
  320. width: lower-bound($large-range);
  321. }
  322. meta.foundation-mq-large-only {
  323. font-family: "/" + unquote($large-only) + "/";
  324. width: lower-bound($large-range);
  325. }
  326. meta.foundation-mq-xlarge {
  327. font-family: "/" + unquote($xlarge-up) + "/";
  328. width: lower-bound($xlarge-range);
  329. }
  330. meta.foundation-mq-xlarge-only {
  331. font-family: "/" + unquote($xlarge-only) + "/";
  332. width: lower-bound($xlarge-range);
  333. }
  334. meta.foundation-mq-xxlarge {
  335. font-family: "/" + unquote($xxlarge-up) + "/";
  336. width: lower-bound($xxlarge-range);
  337. }
  338. meta.foundation-data-attribute-namespace {
  339. font-family: #{$namespace};
  340. }
  341. @if $include-html-global-classes {
  342. // Must be 100% for off canvas to work
  343. html, body { height: 100%; }
  344. // Set box-sizing globally to handle padding and border widths
  345. *,
  346. *:before,
  347. *:after {
  348. @include box-sizing(border-box);
  349. }
  350. html,
  351. body { font-size: $base-font-size; }
  352. // Default body styles
  353. body {
  354. background: $body-bg;
  355. color: $body-font-color;
  356. padding: 0;
  357. margin: 0;
  358. font-family: $body-font-family;
  359. font-weight: $body-font-weight;
  360. font-style: $body-font-style;
  361. line-height: $base-line-height; // Set to $base-line-height to take on browser default of 150%
  362. position: relative;
  363. cursor: $cursor-auto-value;
  364. }
  365. a:hover { cursor: $cursor-pointer-value; }
  366. // Grid Defaults to get images and embeds to work properly
  367. img { max-width: 100%; height: auto; }
  368. img { -ms-interpolation-mode: bicubic; }
  369. #map_canvas,
  370. .map_canvas {
  371. img,
  372. embed,
  373. object { max-width: none !important;
  374. }
  375. }
  376. // Miscellaneous useful HTML classes
  377. .left { float: left !important; }
  378. .right { float: right !important; }
  379. .clearfix { @include clearfix; }
  380. // Hide visually and from screen readers
  381. .hide {
  382. display: none;
  383. }
  384. // Hide visually and from screen readers, but maintain layout
  385. .invisible { visibility: hidden; }
  386. // Font smoothing
  387. // Antialiased font smoothing works best for light text on a dark background.
  388. // Apply to single elements instead of globally to body.
  389. // Note this only applies to webkit-based desktop browsers and Firefox 25 (and later) on the Mac.
  390. .antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
  391. // Get rid of gap under images by making them display: inline-block; by default
  392. img {
  393. display: inline-block;
  394. vertical-align: middle;
  395. }
  396. //
  397. // Global resets for forms
  398. //
  399. // Make sure textarea takes on height automatically
  400. textarea { height: auto; min-height: 50px; }
  401. // Make select elements 100% width by default
  402. select { width: 100%; }
  403. }
  404. }