_flex.scss 3.0 KB

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