You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1066 lines
31 KiB

7 years ago
  1. /*!
  2. * Angular Material Design
  3. * https://github.com/angular/material
  4. * @license MIT
  5. * v1.1.2-master-a9ba340
  6. */
  7. $font-family: Roboto, 'Helvetica Neue', sans-serif !default;
  8. $font-size: 10px !default;
  9. $display-4-font-size-base: rem(11.20) !default;
  10. $display-3-font-size-base: rem(5.600) !default;
  11. $display-2-font-size-base: rem(4.500) !default;
  12. $display-1-font-size-base: rem(3.400) !default;
  13. $headline-font-size-base: rem(2.400) !default;
  14. $title-font-size-base: rem(2.000) !default;
  15. $subhead-font-size-base: rem(1.600) !default;
  16. $body-font-size-base: rem(1.400) !default;
  17. $caption-font-size-base: rem(1.200) !default;
  18. $baseline-grid: 8px !default;
  19. $layout-gutter-width: ($baseline-grid * 2) !default;
  20. $layout-breakpoint-xs: 600px !default;
  21. $layout-breakpoint-sm: 960px !default;
  22. $layout-breakpoint-md: 1280px !default;
  23. $layout-breakpoint-lg: 1920px !default;
  24. $button-left-right-padding: rem(0.600) !default;
  25. $icon-size: rem(2.400) !default;
  26. $app-bar-height: 64px !default;
  27. $toast-height: $baseline-grid * 3 !default;
  28. $toast-margin: $baseline-grid * 1 !default;
  29. $shadow-key-umbra-opacity: 0.2 !default;
  30. $shadow-key-penumbra-opacity: 0.14 !default;
  31. $shadow-ambient-shadow-opacity: 0.12 !default;
  32. $whiteframe-shadow-1dp: 0px 1px 3px 0px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 1px 1px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 2px 1px -1px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  33. $whiteframe-shadow-2dp: 0px 1px 5px 0px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 2px 2px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 1px -2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  34. $whiteframe-shadow-3dp: 0px 1px 8px 0px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 3px 4px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 3px -2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  35. $whiteframe-shadow-4dp: 0px 2px 4px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 4px 5px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 1px 10px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  36. $whiteframe-shadow-5dp: 0px 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 5px 8px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 1px 14px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  37. $whiteframe-shadow-6dp: 0px 3px 5px -1px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 6px 10px 0px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 1px 18px 0px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  38. $whiteframe-shadow-7dp: 0px 4px 5px -2px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 7px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 2px 16px 1px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  39. $whiteframe-shadow-8dp: 0px 5px 5px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 8px 10px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 14px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  40. $whiteframe-shadow-9dp: 0px 5px 6px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 9px 12px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 3px 16px 2px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  41. $whiteframe-shadow-10dp: 0px 6px 6px -3px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 10px 14px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 4px 18px 3px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  42. $whiteframe-shadow-11dp: 0px 6px 7px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 11px 15px 1px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 4px 20px 3px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  43. $whiteframe-shadow-12dp: 0px 7px 8px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 12px 17px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 5px 22px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  44. $whiteframe-shadow-13dp: 0px 7px 8px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 13px 19px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 5px 24px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  45. $whiteframe-shadow-14dp: 0px 7px 9px -4px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 14px 21px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 5px 26px 4px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  46. $whiteframe-shadow-15dp: 0px 8px 9px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 15px 22px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 6px 28px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  47. $whiteframe-shadow-16dp: 0px 8px 10px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 16px 24px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 6px 30px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  48. $whiteframe-shadow-17dp: 0px 8px 11px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 17px 26px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 6px 32px 5px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  49. $whiteframe-shadow-18dp: 0px 9px 11px -5px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 18px 28px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 7px 34px 6px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  50. $whiteframe-shadow-19dp: 0px 9px 12px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 19px 29px 2px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 7px 36px 6px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  51. $whiteframe-shadow-20dp: 0px 10px 13px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 20px 31px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 8px 38px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  52. $whiteframe-shadow-21dp: 0px 10px 13px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 21px 33px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 8px 40px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  53. $whiteframe-shadow-22dp: 0px 10px 14px -6px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 22px 35px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 8px 42px 7px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  54. $whiteframe-shadow-23dp: 0px 11px 14px -7px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 23px 36px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 9px 44px 8px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  55. $whiteframe-shadow-24dp: 0px 11px 15px -7px rgba(0, 0, 0, $shadow-key-umbra-opacity), 0px 24px 38px 3px rgba(0, 0, 0, $shadow-key-penumbra-opacity), 0px 9px 46px 8px rgba(0, 0, 0, $shadow-ambient-shadow-opacity) !default;
  56. $z-index-toast: 105 !default;
  57. $z-index-tooltip: 100 !default;
  58. $z-index-menu: 100 !default;
  59. $z-index-calendar-pane: 100 !default;
  60. $z-index-select: 90 !default;
  61. $z-index-dialog: 80 !default;
  62. $z-index-bottom-sheet: 70 !default;
  63. $z-index-scroll-mask: 50 !default;
  64. $z-index-scroll-mask-bar: 65 !default;
  65. $z-index-sidenav: 60 !default;
  66. $z-index-backdrop: 50 !default;
  67. $z-index-fab: 20 !default;
  68. $z-index-progress-circular: 2 !default; // Used to fix animation bug in Chrome
  69. $swift-ease-out-duration: 0.4s !default;
  70. $swift-ease-out-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1) !default;
  71. $swift-ease-out: all $swift-ease-out-duration $swift-ease-out-timing-function !default;
  72. $swift-ease-in-duration: 0.3s !default;
  73. $swift-ease-in-timing-function: cubic-bezier(0.55, 0, 0.55, 0.2) !default;
  74. $swift-ease-in: all $swift-ease-in-duration $swift-ease-in-timing-function !default;
  75. $swift-ease-in-out-duration: 0.5s !default;
  76. $swift-ease-in-out-timing-function: cubic-bezier(0.35, 0, 0.25, 1) !default;
  77. $swift-ease-in-out: all $swift-ease-in-out-duration $swift-ease-in-out-timing-function !default;
  78. $swift-linear-duration: 0.08s !default;
  79. $swift-linear-timing-function: linear !default;
  80. $swift-linear: all $swift-linear-duration $swift-linear-timing-function !default;
  81. $material-enter-duration: 0.3s;
  82. $material-enter-timing-function: cubic-bezier(0.0, 0.0, 0.2, 1);
  83. $material-enter: all $material-enter-duration $material-enter-timing-function;
  84. $material-leave-duration: 0.3s;
  85. $material-leave-timing-function: cubic-bezier(0.4, 0.0, 1, 1);
  86. $material-leave: all $material-leave-duration $material-leave-timing-function;
  87. $button-fab-width: rem(5.600) !default;
  88. $button-fab-height: rem(5.600) !default;
  89. $button-fab-padding: rem(1.60) !default;
  90. $checkbox-width: 20px !default;
  91. $checkbox-height: $checkbox-width !default;
  92. $checkbox-border-radius: 2px !default;
  93. $checkbox-border-width: 2px !default;
  94. // Typography
  95. // ------------------------------
  96. //-- Must be defined before $font-size.
  97. @function rem($multiplier) {
  98. @return $multiplier * $font-size;
  99. }
  100. // Layout
  101. // ------------------------------
  102. // Button
  103. // Icon
  104. // App bar variables
  105. // Whiteframes
  106. // NOTE(shyndman): gulp-sass seems to be failing if I split the shadow defs across
  107. // multiple lines. Ugly. Sorry.
  108. // Z-indexes
  109. //--------------------------------------------
  110. // Easing Curves
  111. //--------------------------------------------
  112. // Fab Buttons (shared between buttons.scss and fab*.scss)
  113. // -------------------------------------------
  114. // Shared Checkbox variables
  115. @mixin margin-selectors($before:1em, $after:1em, $start:0px, $end:0px) {
  116. -webkit-margin-before: $before;
  117. -webkit-margin-after: $after;
  118. -webkit-margin-start: $start;
  119. -webkit-margin-end: $end;
  120. }
  121. @mixin not-selectable($value:none) {
  122. -webkit-touch-callout: $value;
  123. -webkit-user-select: $value;
  124. -khtml-user-select: $value;
  125. -moz-user-select: $value;
  126. -ms-user-select: $value;
  127. user-select: $value;
  128. }
  129. @mixin input-placeholder-color($color) {
  130. $pseudos: '::-webkit-input-placeholder', ':-moz-placeholder', '::-moz-placeholder',
  131. ':-ms-input-placeholder', '::-webkit-input-placeholder';
  132. // It is important to export every pseudo within its own block, because otherwise the placeholder
  133. // won't be set on the most browsers.
  134. @each $pseudo in $pseudos {
  135. &#{$pseudo} {
  136. color: unquote($color);
  137. }
  138. }
  139. }
  140. @mixin pie-clearfix {
  141. &:after {
  142. content: '';
  143. display: table;
  144. clear: both;
  145. }
  146. }
  147. @mixin md-shadow-bottom-z-1() {
  148. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
  149. }
  150. @mixin md-shadow-bottom-z-2() {
  151. box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.4);
  152. }
  153. // Mixin for a "flat" input that can be used for components that contain an input
  154. // (datepicker, autocomplete).
  155. @mixin md-flat-input() {
  156. font-size: 14px;
  157. box-sizing: border-box;
  158. border: none;
  159. box-shadow: none;
  160. outline: none;
  161. background: transparent;
  162. // The "clear X" that IE adds to input[type="search"]
  163. &::-ms-clear {
  164. display: none;
  165. }
  166. }
  167. // Typography mixins
  168. @mixin md-title() {
  169. font-size: $title-font-size-base;
  170. font-weight: 500;
  171. letter-spacing: 0.005em;
  172. }
  173. @mixin md-body-1() {
  174. font-size: $body-font-size-base;
  175. font-weight: 400;
  176. letter-spacing: 0.010em;
  177. line-height: rem(2);
  178. }
  179. @mixin md-body-2() {
  180. font-size: $body-font-size-base;
  181. font-weight: 500;
  182. letter-spacing: 0.010em;
  183. line-height: rem(2.4);
  184. }
  185. @mixin md-subhead() {
  186. font-size: $subhead-font-size-base;
  187. font-weight: 400;
  188. letter-spacing: 0.010em;
  189. line-height: rem(2.4);
  190. }
  191. @function map-to-string($map) {
  192. $map-str: '{';
  193. $keys: map-keys($map);
  194. $len: length($keys);
  195. @for $i from 1 through $len {
  196. $key: nth($keys, $i);
  197. $value: map-get($map, $key);
  198. $map-str: $map-str + '_' + $key + '_: _' + map-get($map, $key) + '_';
  199. @if $i != $len {
  200. $map-str: $map-str + ',';
  201. }
  202. }
  203. @return $map-str + '}';
  204. }
  205. // This is a mixin, which fixes IE11's vertical alignment issue, when using `min-height`.
  206. // See https://connect.microsoft.com/IE/feedback/details/816293/
  207. @mixin ie11-min-height-flexbug($min-height) {
  208. &::before {
  209. content: '';
  210. min-height: $min-height;
  211. visibility: hidden;
  212. display: inline-block;
  213. }
  214. }
  215. // mixin definition ; sets LTR and RTL within the same style call
  216. // @see https://css-tricks.com/almanac/properties/d/direction/
  217. @mixin rtl($prop, $ltr-value, $rtl-value) {
  218. #{$prop}: $ltr-value;
  219. [dir=rtl] & {
  220. #{$prop}: $rtl-value;
  221. }
  222. }
  223. @mixin rtl-prop($ltr-prop, $rtl-prop, $value, $reset-value) {
  224. #{$ltr-prop}: $value;
  225. [dir=rtl] & {
  226. #{$ltr-prop}: $reset-value;
  227. #{$rtl-prop}: $value;
  228. }
  229. }
  230. // To reverse padding (top left bottom right) -> (top right bottom left)
  231. @function rtl-value($list) {
  232. @if length($list) == 4 {
  233. @return nth($list, 1) nth($list, 4) nth($list, 3) nth($list, 2)
  234. }
  235. @if length($list) == 5 {
  236. @return nth($list, 1) nth($list, 4) nth($list, 3) nth($list, 2) nth($list, 5)
  237. }
  238. @return $list;
  239. }
  240. // Position a FAB button.
  241. @mixin fab-position($spot, $top: auto, $right: auto, $bottom: auto, $left: auto) {
  242. &.md-fab-#{$spot} {
  243. top: $top;
  244. right: $right;
  245. bottom: $bottom;
  246. left: $left;
  247. position: absolute;
  248. }
  249. }
  250. @mixin fab-all-positions() {
  251. @include fab-position(bottom-right, auto, ($button-fab-width - $button-fab-padding)/2, ($button-fab-height - $button-fab-padding)/2, auto);
  252. @include fab-position(bottom-left, auto, auto, ($button-fab-height - $button-fab-padding)/2, ($button-fab-width - $button-fab-padding)/2);
  253. @include fab-position(top-right, ($button-fab-height - $button-fab-padding)/2, ($button-fab-width - $button-fab-padding)/2, auto, auto);
  254. @include fab-position(top-left, ($button-fab-height - $button-fab-padding)/2, auto, auto, ($button-fab-width - $button-fab-padding)/2);
  255. }
  256. // This mixin allows a user to use the md-checkbox css outside of the
  257. // md-checkbox directive.
  258. // See src/components/select/select.scss for an example.
  259. @mixin checkbox-container(
  260. $checkedSelector: '.md-checked',
  261. $width: $checkbox-width,
  262. $height: $checkbox-height,
  263. $border-width: $checkbox-border-width,
  264. $border-radius: $checkbox-border-radius) {
  265. .md-container {
  266. position: absolute;
  267. top: 50%;
  268. transform: translateY(-50%);
  269. box-sizing: border-box;
  270. display: inline-block;
  271. width: $width;
  272. height: $height;
  273. @include rtl(left, 0, auto);
  274. @include rtl(right, auto, 0);
  275. &:before {
  276. box-sizing: border-box;
  277. background-color: transparent;
  278. border-radius: 50%;
  279. content: '';
  280. position: absolute;
  281. display: block;
  282. height: auto;
  283. left: 0;
  284. top: 0;
  285. right: 0;
  286. bottom: 0;
  287. transition: all 0.5s;
  288. width: auto;
  289. }
  290. &:after {
  291. box-sizing: border-box;
  292. content: '';
  293. position: absolute;
  294. top: -10px;
  295. right: -10px;
  296. bottom: -10px;
  297. left: -10px;
  298. }
  299. .md-ripple-container {
  300. position: absolute;
  301. display: block;
  302. width: auto;
  303. height: auto;
  304. left: -15px;
  305. top: -15px;
  306. right: -15px;
  307. bottom: -15px;
  308. }
  309. }
  310. // unchecked
  311. .md-icon {
  312. box-sizing: border-box;
  313. transition: 240ms;
  314. position: absolute;
  315. top: 0;
  316. left: 0;
  317. width: $width;
  318. height: $height;
  319. border-width: $border-width;
  320. border-style: solid;
  321. border-radius: $border-radius;
  322. }
  323. &#{$checkedSelector} .md-icon {
  324. border-color: transparent;
  325. &:after {
  326. box-sizing: border-box;
  327. transform: rotate(45deg);
  328. position: absolute;
  329. left: $width / 3 - $border-width;
  330. top: $width / 9 - $border-width;
  331. display: table;
  332. width: $width / 3;
  333. height: $width * 2 / 3;
  334. border-width: $border-width;
  335. border-style: solid;
  336. border-top: 0;
  337. border-left: 0;
  338. content: '';
  339. }
  340. }
  341. // disabled
  342. &[disabled] {
  343. cursor: default;
  344. }
  345. &.md-indeterminate .md-icon {
  346. &:after {
  347. box-sizing: border-box;
  348. position: absolute;
  349. top: 50%;
  350. left: 50%;
  351. transform: translate(-50%, -50%);
  352. display: table;
  353. width: $width * 0.6;
  354. height: $border-width;
  355. border-width: $border-width;
  356. border-style: solid;
  357. border-top: 0;
  358. border-left: 0;
  359. content: '';
  360. }
  361. }
  362. }
  363. // Mixin to create a primary checkbox.
  364. // Used by the checkbox and select component.
  365. @mixin checkbox-primary($checkedSelector: '.md-checked') {
  366. .md-ripple {
  367. color: '{{primary-600}}';
  368. }
  369. &#{$checkedSelector} .md-ripple {
  370. color: '{{background-600}}';
  371. }
  372. .md-ink-ripple {
  373. color: '{{foreground-2}}';
  374. }
  375. &#{$checkedSelector} .md-ink-ripple {
  376. color: '{{primary-color-0.87}}';
  377. }
  378. &:not(.md-checked) .md-icon {
  379. border-color: '{{foreground-2}}';
  380. }
  381. &#{$checkedSelector} .md-icon {
  382. background-color: '{{primary-color-0.87}}';
  383. }
  384. &#{$checkedSelector}.md-focused .md-container:before {
  385. background-color: '{{primary-color-0.26}}';
  386. }
  387. &#{$checkedSelector} .md-icon:after {
  388. border-color: '{{primary-contrast-0.87}}';
  389. }
  390. & .md-indeterminate[disabled] {
  391. .md-container {
  392. color: '{{foreground-3}}';
  393. }
  394. }
  395. }
  396. @mixin dense($prop, $normal, $dense) {
  397. #{$prop}: $normal;
  398. .md-dense > &:not(.md-dense-disabled),
  399. .md-dense :not(.md-dense-disabled) &:not(.md-dense-disabled) {
  400. #{$prop}: $dense;
  401. }
  402. }
  403. @mixin dense-rtl($prop, $ltr-normal, $rtl-normal, $ltr-dense, $rtl-dense) {
  404. @include rtl($prop, $ltr-normal, $rtl-normal);
  405. .md-dense > &:not(.md-dense-disabled),
  406. .md-dense :not(.md-dense-disabled) &:not(.md-dense-disabled) {
  407. @include rtl($prop, $ltr-dense, $rtl-dense);
  408. }
  409. }
  410. /*
  411. *
  412. * Responsive attributes
  413. *
  414. * References:
  415. * 1) https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties#flex
  416. * 2) https://css-tricks.com/almanac/properties/f/flex/
  417. * 3) https://css-tricks.com/snippets/css/a-guide-to-flexbox/
  418. * 4) https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items
  419. * 5) http://godban.com.ua/projects/flexgrid
  420. *
  421. *
  422. */
  423. @mixin flex-order-for-name($sizes:null) {
  424. @if $sizes == null {
  425. $sizes : '';
  426. .flex-order {
  427. order : 0;
  428. }
  429. }
  430. @for $i from -20 through 20 {
  431. $order : '';
  432. $suffix : '';
  433. @each $s in $sizes {
  434. @if $s != '' { $suffix : '#{$s}-#{$i}'; }
  435. @else { $suffix : '#{$i}'; }
  436. $order : '.flex-order-#{$suffix}';
  437. }
  438. #{$order} {
  439. order: #{$i};
  440. }
  441. }
  442. }
  443. @mixin offset-for-name($sizes:null) {
  444. @if $sizes == null { $sizes : ''; }
  445. @for $i from 0 through 19 {
  446. $offsets : '';
  447. $suffix : '';
  448. @each $s in $sizes {
  449. @if $s != '' { $suffix : '#{$s}-#{$i * 5}'; }
  450. @else { $suffix : '#{$i * 5}'; }
  451. $offsets : '.offset-#{$suffix}, .flex-offset-#{$suffix}';
  452. }
  453. #{$offsets} {
  454. @if $i != 0 { @include rtl-prop(margin-left, margin-right, #{$i * 5 + '%'}, auto); }
  455. @else { @include rtl-prop(margin-left, margin-right, 0, auto); }
  456. }
  457. }
  458. @each $i in 33 {
  459. $offsets : '';
  460. $suffix : '';
  461. @each $s in $sizes {
  462. @if $s != '' { $suffix : '#{$s}-#{$i}'; }
  463. @else { $suffix : '#{$i}'; }
  464. $offsets : '.offset-#{$suffix}, .flex-offset-#{$suffix} ';
  465. }
  466. #{$offsets} {
  467. margin-left: calc(100% / 3);
  468. }
  469. }
  470. @each $i in 66 {
  471. $offsets : '';
  472. $suffix : '';
  473. @each $s in $sizes {
  474. @if $s != '' { $suffix : '#{$s}-#{$i}'; }
  475. @else { $suffix : '#{$i}'; }
  476. $offsets : '.offset-#{$suffix}, .flex-offset-#{$suffix} ';
  477. }
  478. #{$offsets} {
  479. @include rtl-prop(margin-left, margin-right, calc(200% / 3), auto);
  480. }
  481. }
  482. }
  483. @mixin layout-for-name($name: null) {
  484. @if $name == null { $name : ''; }
  485. @if $name != '' { $name : '-#{$name}'; }
  486. .layout#{$name}, .layout#{$name}-column, .layout#{$name}-row {
  487. box-sizing: border-box;
  488. display: -webkit-box;
  489. display: -webkit-flex;
  490. display: -moz-box;
  491. display: -ms-flexbox;
  492. display: flex;
  493. }
  494. .layout#{$name}-column { flex-direction: column; }
  495. .layout#{$name}-row { flex-direction: row; }
  496. }
  497. @mixin flex-properties-for-name($name: null) {
  498. $flexName: 'flex';
  499. @if $name != null {
  500. $flexName: 'flex-#{$name}';
  501. $name : '-#{$name}';
  502. } @else {
  503. $name : '';
  504. }
  505. .#{$flexName} { flex: 1; box-sizing: border-box; } // === flex: 1 1 0%;
  506. .#{$flexName}-grow { flex: 1 1 100%; box-sizing: border-box; }
  507. .#{$flexName}-initial { flex: 0 1 auto; box-sizing: border-box; }
  508. .#{$flexName}-auto { flex: 1 1 auto; box-sizing: border-box; }
  509. .#{$flexName}-none { flex: 0 0 auto; box-sizing: border-box; }
  510. .#{$flexName}-noshrink { flex: 1 0 auto; box-sizing: border-box; }
  511. .#{$flexName}-nogrow { flex: 0 1 auto; box-sizing: border-box; }
  512. // (1-20) * 5 = 0-100%
  513. @for $i from 0 through 20 {
  514. $value : #{$i * 5 + '%'};
  515. .#{$flexName}-#{$i * 5} {
  516. flex: 1 1 100%;
  517. max-width: #{$value};
  518. max-height: 100%;
  519. box-sizing: border-box;
  520. }
  521. .layout-row > .#{$flexName}-#{$i * 5} {
  522. flex: 1 1 100%;
  523. max-width: #{$value};
  524. max-height: 100%;
  525. box-sizing: border-box;
  526. // Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
  527. @if $i == 0 { min-width: 0; }
  528. }
  529. .layout-column > .#{$flexName}-#{$i * 5} {
  530. flex: 1 1 100%;
  531. max-width: 100%;
  532. max-height: #{$value};
  533. box-sizing: border-box;
  534. }
  535. .layout-row {
  536. > .#{$flexName}-33 , > .#{$flexName}-33 { flex: 1 1 33.33%; max-width: 33.33%; max-height: 100%; box-sizing: border-box; }
  537. > .#{$flexName}-66 , > .#{$flexName}-66 { flex: 1 1 66.66%; max-width: 66.66%; max-height: 100%; box-sizing: border-box; }
  538. }
  539. .layout-column {
  540. > .#{$flexName}-33 , > .#{$flexName}-33 { flex: 1 1 33.33%; max-width: 100%; max-height: 33.33%; box-sizing: border-box; }
  541. > .#{$flexName}-66 , > .#{$flexName}-66 { flex: 1 1 66.66%; max-width: 100%; max-height: 66.66%; box-sizing: border-box; }
  542. }
  543. .layout#{$name}-row > .#{$flexName}-#{$i * 5} {
  544. flex: 1 1 100%;
  545. max-width: #{$value};
  546. max-height: 100%;
  547. box-sizing: border-box;
  548. // Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
  549. @if $i == 0 { min-width: 0; }
  550. }
  551. .layout#{$name}-column > .#{$flexName}-#{$i * 5} {
  552. flex: 1 1 100%;
  553. max-width: 100%;
  554. max-height: #{$value};
  555. box-sizing: border-box;
  556. // Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
  557. @if $i == 0 { min-height: 0; }
  558. }
  559. }
  560. .layout#{$name}-row {
  561. > .#{$flexName}-33 , > .#{$flexName}-33 { flex: 1 1 100%; max-width: 33.33%; max-height: 100%; box-sizing: border-box; }
  562. > .#{$flexName}-66 , > .#{$flexName}-66 { flex: 1 1 100%; max-width: 66.66%; max-height: 100%; box-sizing: border-box; }
  563. // Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
  564. > .flex { min-width: 0; }
  565. }
  566. .layout#{$name}-column {
  567. > .#{$flexName}-33 , > .#{$flexName}-33 { flex: 1 1 100%; max-width: 100%; max-height: 33.33%; box-sizing: border-box; }
  568. > .#{$flexName}-66 , > .#{$flexName}-66 { flex: 1 1 100%; max-width: 100%; max-height: 66.66%; box-sizing: border-box; }
  569. // Bug workaround for http://crbug.com/546034 - flex issues on Chrome 48
  570. > .flex { min-height: 0; }
  571. }
  572. }
  573. @mixin layout-align-for-name($suffix: null) {
  574. // Alignment attributes for layout containers' children
  575. // Arrange on the Main Axis
  576. // center, start, end, space-between, space-around
  577. // flex-start is the default for justify-content
  578. // ------------------------------
  579. $name: 'layout-align';
  580. @if $suffix != null {
  581. $name: 'layout-align-#{$suffix}';
  582. }
  583. .#{$name},
  584. .#{$name}-start-stretch // defaults
  585. {
  586. justify-content : flex-start;
  587. align-content : stretch;
  588. align-items: stretch;
  589. }
  590. // Main Axis Center
  591. .#{$name}-start,
  592. .#{$name}-start-start,
  593. .#{$name}-start-center,
  594. .#{$name}-start-end,
  595. .#{$name}-start-stretch
  596. {
  597. justify-content: flex-start;
  598. }
  599. // Main Axis Center
  600. .#{$name}-center, //stretch
  601. .#{$name}-center-start,
  602. .#{$name}-center-center,
  603. .#{$name}-center-end,
  604. .#{$name}-center-stretch
  605. {
  606. justify-content: center;
  607. }
  608. // Main Axis End
  609. .#{$name}-end, //stretch
  610. .#{$name}-end-start,
  611. .#{$name}-end-center,
  612. .#{$name}-end-end,
  613. .#{$name}-end-stretch
  614. {
  615. justify-content: flex-end;
  616. }
  617. // Main Axis Space Around
  618. .#{$name}-space-around, //stretch
  619. .#{$name}-space-around-center,
  620. .#{$name}-space-around-start,
  621. .#{$name}-space-around-end,
  622. .#{$name}-space-around-stretch
  623. {
  624. justify-content: space-around;
  625. }
  626. // Main Axis Space Between
  627. .#{$name}-space-between, //stretch
  628. .#{$name}-space-between-center,
  629. .#{$name}-space-between-start,
  630. .#{$name}-space-between-end,
  631. .#{$name}-space-between-stretch
  632. {
  633. justify-content: space-between;
  634. }
  635. // Arrange on the Cross Axis
  636. // center, start, end
  637. // stretch is the default for align-items
  638. // ------------------------------
  639. // Cross Axis Start
  640. .#{$name}-start-start,
  641. .#{$name}-center-start,
  642. .#{$name}-end-start,
  643. .#{$name}-space-between-start,
  644. .#{$name}-space-around-start
  645. {
  646. align-items: flex-start;
  647. align-content: flex-start;
  648. }
  649. // Cross Axis Center
  650. .#{$name}-start-center,
  651. .#{$name}-center-center,
  652. .#{$name}-end-center,
  653. .#{$name}-space-between-center,
  654. .#{$name}-space-around-center
  655. {
  656. align-items: center;
  657. align-content: center;
  658. max-width: 100%;
  659. }
  660. // Cross Axis Center IE overflow fix
  661. .#{$name}-start-center > *,
  662. .#{$name}-center-center > *,
  663. .#{$name}-end-center > *,
  664. .#{$name}-space-between-center > *,
  665. .#{$name}-space-around-center > *
  666. {
  667. max-width: 100%;
  668. box-sizing: border-box;
  669. }
  670. // Cross Axis End
  671. .#{$name}-start-end,
  672. .#{$name}-center-end,
  673. .#{$name}-end-end,
  674. .#{$name}-space-between-end,
  675. .#{$name}-space-around-end
  676. {
  677. align-items: flex-end;
  678. align-content: flex-end;
  679. }
  680. // Cross Axis Start
  681. .#{$name}-start-stretch,
  682. .#{$name}-center-stretch,
  683. .#{$name}-end-stretch,
  684. .#{$name}-space-between-stretch,
  685. .#{$name}-space-around-stretch
  686. {
  687. align-items: stretch;
  688. align-content: stretch;
  689. }
  690. }
  691. @mixin layout-padding-margin() {
  692. // NOTE: these`> *` selectors should only be applied for layout="row" or layout="column" children !!
  693. .layout-padding-sm > *,
  694. .layout-padding > .flex-sm
  695. {
  696. padding: $layout-gutter-width / 4;
  697. }
  698. .layout-padding,
  699. .layout-padding-gt-sm,
  700. .layout-padding-md,
  701. // NOTE: these`> *` selectors should only be applied for layout="row" or layout="column" children !!
  702. .layout-padding > *,
  703. .layout-padding-gt-sm > *,
  704. .layout-padding-md > *,
  705. .layout-padding > .flex,
  706. .layout-padding > .flex-gt-sm,
  707. .layout-padding > .flex-md
  708. {
  709. padding: $layout-gutter-width / 2;
  710. }
  711. // NOTE: these`> *` selectors should only be applied for layout="row" or layout="column" children !!
  712. .layout-padding-gt-md > *,
  713. .layout-padding-lg > *,
  714. .layout-padding-gt-lg > *,
  715. .layout-padding > .flex-gt-md,
  716. .layout-padding > .flex-lg,
  717. .layout-padding > .flex-lg,
  718. .layout-padding > .flex-gt-lg
  719. {
  720. padding: $layout-gutter-width / 1;
  721. }
  722. // Margin enhancements
  723. .layout-margin-sm > *,
  724. .layout-margin > .flex-sm
  725. {
  726. margin: $layout-gutter-width / 4;
  727. }
  728. .layout-margin,
  729. .layout-margin-gt-sm,
  730. .layout-margin-md,
  731. // NOTE: these`> *` selectors should only be applied for layout="row" or layout="column" children !!
  732. .layout-margin > *,
  733. .layout-margin-gt-sm > *,
  734. .layout-margin-md > *,
  735. .layout-margin > .flex,
  736. .layout-margin > .flex-gt-sm,
  737. .layout-margin > .flex-md
  738. {
  739. margin: $layout-gutter-width / 2;
  740. }
  741. // NOTE: these`> *` selectors should only be applied for layout="row" or layout="column" children !!
  742. .layout-margin-gt-md > *,
  743. .layout-margin-lg > *,
  744. .layout-margin-gt-lg > *,
  745. .layout-margin > .flex-gt-md,
  746. .layout-margin > .flex-lg,
  747. .layout-margin > .flex-gt-lg
  748. {
  749. margin: $layout-gutter-width / 1;
  750. }
  751. .layout-wrap {
  752. flex-wrap: wrap;
  753. }
  754. .layout-nowrap {
  755. flex-wrap: nowrap;
  756. }
  757. .layout-fill {
  758. margin: 0;
  759. width: 100%;
  760. min-height: 100%;
  761. height: 100%;
  762. }
  763. }
  764. @mixin layouts_for_breakpoint($name:null) {
  765. @include flex-order-for-name($name);
  766. @include offset-for-name($name);
  767. @include layout-align-for-name($name);
  768. @include flex-properties-for-name($name);
  769. @include layout-for-name($name);
  770. }
  771. /*
  772. * Since Layout API uses ng-cloak to hide the dom elements while layouts are adjusted
  773. *
  774. */
  775. [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
  776. display: none !important;
  777. }
  778. /*
  779. *
  780. * Responsive attributes
  781. *
  782. * References:
  783. * 1) https://scotch.io/tutorials/a-visual-guide-to-css3-flexbox-properties#flex
  784. * 2) https://css-tricks.com/almanac/properties/f/flex/
  785. * 3) https://css-tricks.com/snippets/css/a-guide-to-flexbox/
  786. * 4) https://github.com/philipwalton/flexbugs#3-min-height-on-a-flex-container-wont-apply-to-its-flex-items
  787. * 5) http://godban.com.ua/projects/flexgrid
  788. *
  789. *
  790. */
  791. @-moz-document url-prefix() {
  792. .layout-fill {
  793. margin: 0;
  794. width: 100%;
  795. min-height: 100%;
  796. height: 100%;
  797. }
  798. }
  799. /*
  800. * Apply Mixins to create Layout/Flexbox styles
  801. *
  802. */
  803. @include layouts_for_breakpoint();
  804. @include layout-padding-margin();
  805. /**
  806. * `hide-gt-sm show-gt-lg` should hide from 600px to 1200px
  807. * `show-md hide-gt-sm` should show from 0px to 960px and hide at >960px
  808. * `hide-gt-md show-gt-sm` should show everywhere (show overrides hide)`
  809. *
  810. * hide means hide everywhere
  811. * Sizes:
  812. * $layout-breakpoint-xs: 600px !default;
  813. * $layout-breakpoint-sm: 960px !default;
  814. * $layout-breakpoint-md: 1280px !default;
  815. * $layout-breakpoint-lg: 1920px !default;
  816. */
  817. @media (max-width: $layout-breakpoint-xs - 1) {
  818. // Xtra-SMALL SCREEN
  819. .hide-xs, .hide {
  820. &:not(.show-xs):not(.show) {
  821. display: none;
  822. }
  823. }
  824. @include layouts_for_breakpoint(xs);
  825. }
  826. @media (min-width: $layout-breakpoint-xs) {
  827. // BIGGER THAN Xtra-SMALL SCREEN
  828. @include layouts_for_breakpoint(gt-xs);
  829. }
  830. @media (min-width: $layout-breakpoint-xs) and (max-width: $layout-breakpoint-sm - 1) {
  831. .hide, .hide-gt-xs {
  832. &:not(.show-gt-xs):not(.show-sm):not(.show) {
  833. display: none;
  834. }
  835. }
  836. .hide-sm:not(.show-gt-xs):not(.show-sm):not(.show) {
  837. display: none;
  838. }
  839. @include layouts_for_breakpoint(sm);
  840. }
  841. @media (min-width: $layout-breakpoint-sm) {
  842. // BIGGER THAN SMALL SCREEN
  843. @include layouts_for_breakpoint(gt-sm);
  844. }
  845. @media (min-width: $layout-breakpoint-sm) and (max-width: $layout-breakpoint-md - 1) {
  846. // MEDIUM SCREEN
  847. .hide, .hide-gt-xs, .hide-gt-sm {
  848. &:not(.show-gt-xs):not(.show-gt-sm):not(.show-md):not(.show) {
  849. display: none;
  850. }
  851. }
  852. .hide-md:not(.show-md):not(.show-gt-sm):not(.show-gt-xs):not(.show) {
  853. display: none;
  854. }
  855. @include layouts_for_breakpoint(md);
  856. }
  857. @media (min-width: $layout-breakpoint-md) {
  858. // BIGGER THAN MEDIUM SCREEN
  859. @include layouts_for_breakpoint(gt-md);
  860. }
  861. @media (min-width: $layout-breakpoint-md) and (max-width: $layout-breakpoint-lg - 1) {
  862. // LARGE SCREEN
  863. .hide,.hide-gt-xs, .hide-gt-sm, .hide-gt-md {
  864. &:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-lg):not(.show) {
  865. display: none;
  866. }
  867. }
  868. .hide-lg:not(.show-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show) {
  869. display: none;
  870. }
  871. @include layouts_for_breakpoint(lg);
  872. }
  873. @media (min-width: $layout-breakpoint-lg) {
  874. @include layouts_for_breakpoint(gt-lg);
  875. @include layouts_for_breakpoint(xl);
  876. // BIGGER THAN LARGE SCREEN
  877. .hide, .hide-gt-xs, .hide-gt-sm, .hide-gt-md, .hide-gt-lg {
  878. &:not(.show-gt-xs):not(.show-gt-sm):not(.show-gt-md):not(.show-gt-lg):not(.show-xl):not(.show) {
  879. display: none;
  880. }
  881. }
  882. .hide-xl:not(.show-xl):not(.show-gt-lg):not(.show-gt-md):not(.show-gt-sm):not(.show-gt-xs):not(.show) {
  883. display: none;
  884. }
  885. }
  886. // General printing Rules
  887. @media print {
  888. .hide-print:not(.show-print):not(.show) {
  889. display: none !important;
  890. }
  891. }