2
0

_mixins.grid.scss 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. @use 'sass:math';
  2. // grid settings
  3. $grid-columns: 12;
  4. $grid-gutter-width: 3%;
  5. // Utility variable - you should never need to modify this
  6. $padding: math.div($grid-gutter-width, 2);
  7. // Our row container
  8. @mixin row($padding: 0) {
  9. @include clearfix();
  10. display: block;
  11. margin-inline-end: auto;
  12. margin-inline-start: auto;
  13. padding-inline-end: $padding;
  14. padding-inline-start: $padding;
  15. }
  16. @mixin row-flush() {
  17. margin-inline-start: -$padding;
  18. margin-inline-end: -$padding;
  19. }
  20. // Our column container
  21. @mixin column($x, $padding: $padding, $grid-columns: $grid-columns) {
  22. display: inline;
  23. float: inline-start;
  24. width: 100% * math.div($x, $grid-columns);
  25. padding-inline-end: $padding;
  26. padding-inline-start: $padding;
  27. }
  28. // only used in places where padding not applied to same elements as row or row-flush
  29. // most of the time this class should be applied directly to the html elements
  30. @mixin nice-padding {
  31. padding-inline-start: $mobile-nice-padding;
  32. padding-inline-end: $mobile-nice-padding;
  33. @include media-breakpoint-up(sm) {
  34. padding-inline-start: $desktop-nice-padding;
  35. padding-inline-end: $desktop-nice-padding;
  36. }
  37. }
  38. @mixin nice-margin {
  39. margin-inline-start: $mobile-nice-padding;
  40. margin-inline-end: $mobile-nice-padding;
  41. @include media-breakpoint-up(sm) {
  42. margin-inline-start: $desktop-nice-padding;
  43. margin-inline-end: $desktop-nice-padding;
  44. }
  45. }
  46. @mixin max-form-width {
  47. max-width: $max-form-width;
  48. }