_field-row.scss 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. @use '../../tools' as *;
  2. .w-field-row {
  3. @include max-form-width();
  4. gap: theme('spacing.5');
  5. // For mobile viewports, we attempt to display all items in the row side by side even if not at the desired size.
  6. display: flex;
  7. flex-wrap: wrap;
  8. @include media-breakpoint-up(md) {
  9. display: grid;
  10. grid-auto-flow: column;
  11. // All columns will be the same size.
  12. grid-auto-columns: minmax(min-content, 1fr);
  13. }
  14. .w-field__wrapper + &,
  15. + .w-field__wrapper {
  16. margin-top: theme('spacing.5');
  17. }
  18. > .w-field__wrapper {
  19. margin-top: 0;
  20. }
  21. // Support explicit sizing of child columns.
  22. // This isn’t equivalent to 12-column grid – instead, there will be as many columns as calculated from usage of those classes.
  23. // For example, a `<div class="col6"/><div class="col3"/>` will generate a 9-column grid, with one item taking two thirds of the space.
  24. // Rather than a 12-column grid with one item taking half and the other a quarter.
  25. @for $i from 1 through 12 {
  26. > .col#{$i} {
  27. display: block;
  28. float: none;
  29. padding: 0;
  30. width: auto;
  31. grid-column: span #{$i};
  32. }
  33. }
  34. }
  35. // Each column will be as wide as its widest member.
  36. .w-field-row--max-content {
  37. @include media-breakpoint-up(md) {
  38. grid-auto-columns: minmax(min-content, max-content);
  39. }
  40. }