_flex.scss 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. // Page Container
  2. .container {
  3. width: $large-desktop-container;
  4. margin: 0 auto;
  5. padding: 0;
  6. @include breakpoint(desktop-range) {
  7. width: $desktop-container;
  8. }
  9. @include breakpoint(tablet-range) {
  10. width: $tablet-container;
  11. }
  12. @include breakpoint(large-mobile-range) {
  13. width: $large-mobile-container;
  14. }
  15. @include breakpoint(small-mobile-range) {
  16. width: $mobile-container;
  17. }
  18. }
  19. // Grid Row and Column Setup
  20. .grid {
  21. @include display(flex);
  22. @include flex-flow(row);
  23. list-style: none;
  24. margin: 0;
  25. padding: 0;
  26. @include breakpoint(mobile-only) {
  27. @include flex-flow(row wrap);
  28. }
  29. }
  30. .block {
  31. @include flex(1);
  32. min-width: 0;
  33. min-height: 0;
  34. @include breakpoint(mobile-only) {
  35. @include flex(0 100%);
  36. }
  37. }
  38. // Content Block Spacing
  39. .content {
  40. margin: $content-margin;
  41. padding: $content-padding;
  42. }
  43. body [class*="size-"] {
  44. @include breakpoint(mobile-only) {
  45. @include flex(0 100%);
  46. }
  47. }
  48. // Custom Size Modifiers
  49. .size-1-2 {
  50. @include flex(0 percentage(1/2));
  51. }
  52. .size-1-3 {
  53. @include flex(0 percentage(1/3));
  54. }
  55. .size-1-4 {
  56. @include flex(0 percentage(1/4));
  57. }
  58. .size-1-5 {
  59. @include flex(0 percentage(1/5));
  60. }
  61. .size-1-6 {
  62. @include flex(0 percentage(1/6));
  63. }
  64. .size-1-7 {
  65. @include flex(0 percentage(1/7));
  66. }
  67. .size-1-8 {
  68. @include flex(0 percentage(1/8));
  69. }
  70. .size-1-9 {
  71. @include flex(0 percentage(1/9));
  72. }
  73. .size-1-10 {
  74. @include flex(0 percentage(1/10));
  75. }
  76. .size-1-11 {
  77. @include flex(0 percentage(1/11));
  78. }
  79. .size-1-12 {
  80. @include flex(0 percentage(1/12));
  81. }
  82. @include breakpoint(tablet-range) {
  83. .size-tablet-1-2 {
  84. @include flex(0 percentage(1/2));
  85. }
  86. .size-tablet-1-3 {
  87. @include flex(0 percentage(1/3));
  88. }
  89. .size-tablet-1-4 {
  90. @include flex(0 percentage(1/4));
  91. }
  92. .size-tablet-1-5 {
  93. @include flex(0 percentage(1/5));
  94. }
  95. .size-tablet-1-6 {
  96. @include flex(0 percentage(1/6));
  97. }
  98. .size-tablet-1-7 {
  99. @include flex(0 percentage(1/7));
  100. }
  101. .size-tablet-1-8 {
  102. @include flex(0 percentage(1/8));
  103. }
  104. .size-tablet-1-9 {
  105. @include flex(0 percentage(1/9));
  106. }
  107. .size-tablet-1-10 {
  108. @include flex(0 percentage(1/10));
  109. }
  110. .size-tablet-1-11 {
  111. @include flex(0 percentage(1/11));
  112. }
  113. .size-tablet-1-12 {
  114. @include flex(0 percentage(1/12));
  115. }
  116. }
  117. // Fix for Firefox versions 27 and below
  118. @include breakpoint(mobile-only) {
  119. @supports not (flex-wrap: wrap) {
  120. .grid {
  121. display: block;
  122. @include flex-wrap(inherit);
  123. }
  124. .block {
  125. display: block;
  126. @include flex(inherit);
  127. }
  128. }
  129. }
  130. // Reordering
  131. .first-block {
  132. -webkit-box-ordinal-group: 0;
  133. -webkit-order: -1;
  134. -ms-flex-order: -1;
  135. order: -1;
  136. }
  137. .last-block {
  138. -webkit-box-ordinal-group: 2;
  139. -webkit-order: 1;
  140. -ms-flex-order: 1;
  141. order: 1;
  142. }
  143. // Fixed Grid Style
  144. .fixed-blocks {
  145. @include flex-flow(row wrap);
  146. .block {
  147. @include flex(inherit);
  148. width: $fixed-block-full;
  149. @include breakpoint(desktop-range) {
  150. width: $fixed-block-desktop;
  151. }
  152. @include breakpoint(tablet-range) {
  153. width: $fixed-block-tablet;
  154. }
  155. @include breakpoint(mobile-only) {
  156. width: 100%;
  157. }
  158. }
  159. }
  160. // Fix for browsers that don't support flex-wrap
  161. @supports not (flex-wrap: wrap) {
  162. .fixed-blocks {
  163. display: block;
  164. @include flex-flow(inherit);
  165. }
  166. }