_field-row.scss 1.3 KB

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