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.

1052 lines
31 KiB

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