a zip code crypto-currency system good for red ONLY

grid.mixins.scss 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. @import "../../themes/ionic.globals";
  2. @import "../../themes/ionic.mixins";
  3. // Responsive Mixins
  4. // --------------------------------------------------
  5. // Creates a grid with padding
  6. // ---------------------------------------------------------------------------------
  7. @mixin make-grid($padding-width: $grid-padding-width) {
  8. @include padding($padding-width / 2);
  9. @include margin-horizontal(auto);
  10. width: 100%;
  11. display: flex;
  12. flex-direction: column;
  13. // Remove the padding from the grid and all immediate children columns
  14. &[no-padding] {
  15. @include padding(0);
  16. > .row > .col {
  17. @include padding(0);
  18. }
  19. }
  20. }
  21. // Creates maximum widths for the grid based on screen size
  22. // ---------------------------------------------------------------------------------
  23. @mixin make-grid-max-widths($max-widths: $grid-max-widths, $breakpoints: $grid-breakpoints) {
  24. @each $breakpoint, $container-max-width in $max-widths {
  25. @include media-breakpoint-up($breakpoint, $breakpoints) {
  26. width: $container-max-width;
  27. max-width: 100%;
  28. }
  29. }
  30. }
  31. // Creates a row used to align columns
  32. // ---------------------------------------------------------------------------------
  33. @mixin make-row() {
  34. display: flex;
  35. flex-wrap: wrap;
  36. &[nowrap] {
  37. flex-wrap: nowrap;
  38. }
  39. &[wrap-reverse] {
  40. flex-wrap: wrap-reverse;
  41. }
  42. &[align-items-start] {
  43. align-items: flex-start;
  44. }
  45. &[align-items-center] {
  46. align-items: center;
  47. }
  48. &[align-items-end] {
  49. align-items: flex-end;
  50. }
  51. &[align-items-stretch] {
  52. align-items: stretch;
  53. }
  54. &[align-items-baseline] {
  55. align-items: baseline;
  56. }
  57. &[justify-content-start] {
  58. justify-content: flex-start;
  59. }
  60. &[justify-content-center] {
  61. justify-content: center;
  62. }
  63. &[justify-content-end] {
  64. justify-content: flex-end;
  65. }
  66. &[justify-content-around] {
  67. justify-content: space-around;
  68. }
  69. &[justify-content-between] {
  70. justify-content: space-between;
  71. }
  72. }
  73. // Creates the base column which has shared styles among all columns
  74. // ---------------------------------------------------------------------------------
  75. @mixin make-column-base($padding-width: $grid-padding-width) {
  76. @include padding($padding-width / 2);
  77. position: relative;
  78. width: 100%;
  79. @include margin(0);
  80. min-height: 1px; // Prevent columns from collapsing when empty
  81. flex-basis: 0;
  82. flex-grow: 1;
  83. max-width: 100%;
  84. &[align-self-start] {
  85. align-self: flex-start;
  86. }
  87. &[align-self-end] {
  88. align-self: flex-end;
  89. }
  90. &[align-self-center] {
  91. align-self: center;
  92. }
  93. &[align-self-stretch] {
  94. align-self: stretch;
  95. }
  96. &[align-self-baseline] {
  97. align-self: baseline;
  98. }
  99. }
  100. // Create an individual column
  101. // ---------------------------------------------------------------------------------
  102. @mixin make-column($size, $columns: $grid-columns) {
  103. flex: 0 0 percentage($size / $columns);
  104. width: percentage($size / $columns);
  105. // Add a `max-width` to ensure content within each column does not blow out
  106. // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
  107. // do not appear to require this.
  108. max-width: percentage($size / $columns);
  109. }
  110. // Adds padding to the column
  111. // ---------------------------------------------------------------------------------
  112. @mixin make-column-padding($padding-widths: $grid-padding-widths) {
  113. @each $breakpoint in map-keys($padding-widths) {
  114. @include media-breakpoint-up($breakpoint) {
  115. $padding-width: map-get($padding-widths, $breakpoint);
  116. @include padding($padding-width / 2);
  117. }
  118. }
  119. }
  120. // Offset the column using margin-start
  121. // ---------------------------------------------------------------------------------
  122. @mixin make-column-offset($size, $columns: $grid-columns) {
  123. @include margin-horizontal(percentage($size / $columns), null);
  124. }
  125. // Push the column using left
  126. // ---------------------------------------------------------------------------------
  127. @mixin make-column-push($size, $columns: $grid-columns) {
  128. @include position(null, null, null, if($size > 0, percentage($size / $columns), auto));
  129. }
  130. // Pull the column using right
  131. // ---------------------------------------------------------------------------------
  132. @mixin make-column-pull($size, $columns: $grid-columns) {
  133. @include position(null, if($size > 0, percentage($size / $columns), auto), null, null);
  134. }
  135. // Determine which modifier to add
  136. // ---------------------------------------------------------------------------------
  137. @mixin make-column-modifier($type, $size, $columns) {
  138. // Work around the lack of dynamic mixin @include support (https://github.com/sass/sass/issues/626)
  139. @if $type == push {
  140. @include make-column-push($size, $columns);
  141. } @else if $type == pull {
  142. @include make-column-pull($size, $columns);
  143. } @else if $type == offset {
  144. @include make-column-offset($size, $columns);
  145. }
  146. }
  147. // Create the responsive grid columns
  148. // --------------------------------------------------
  149. @mixin make-grid-columns($columns: $grid-columns, $padding-widths: $grid-padding-widths, $breakpoints: $grid-breakpoints) {
  150. @each $breakpoint in map-keys($breakpoints) {
  151. $infix: breakpoint-infix($breakpoint, $breakpoints);
  152. // Allow columns to stretch full width below their breakpoints
  153. @for $i from 1 through $columns {
  154. [col#{$infix}-#{$i}] {
  155. @include make-column-padding($padding-widths);
  156. }
  157. }
  158. [col#{$infix}] {
  159. @include make-column-padding($padding-widths);
  160. }
  161. @include media-breakpoint-up($breakpoint, $breakpoints) {
  162. // Provide basic `[col-{bp}]` attributes for equal-width flexbox columns
  163. [col#{$infix}] {
  164. flex-basis: 0;
  165. flex-grow: 1;
  166. max-width: 100%;
  167. }
  168. [col#{$infix}-auto] {
  169. flex: 0 0 auto;
  170. width: auto;
  171. }
  172. @for $i from 1 through $columns {
  173. [col#{$infix}-#{$i}] {
  174. @include make-column($i, $columns);
  175. }
  176. }
  177. @each $modifier in (pull, push) {
  178. @for $i from 0 through $columns {
  179. [#{$modifier}#{$infix}-#{$i}] {
  180. @include make-column-modifier($modifier, $i, $columns)
  181. }
  182. }
  183. }
  184. // `$columns - 1` because offsetting by the width of an entire row isn't possible
  185. @for $i from 0 through ($columns - 1) {
  186. @if not ($infix == "" and $i == 0) { // Avoid emitting useless [offset-xs-0]
  187. [offset#{$infix}-#{$i}] {
  188. @include make-column-modifier(offset, $i, $columns)
  189. }
  190. }
  191. }
  192. }
  193. }
  194. }