You are here

layout-views-grid.css in Drupal 10

Responsive styles for views grid horizontal layout.

This creates the correct count of columns and automatically resizes the grid-items to fit into it. The grid-items will flow onto the next row when they reach the --views-grid-item--min-width value.

File

core/themes/olivero/css/layout/layout-views-grid.css
View source
  1. /*
  2. * DO NOT EDIT THIS FILE.
  3. * See the following change record for more information,
  4. * https://www.drupal.org/node/3084859
  5. * @preserve
  6. */
  7. /**
  8. * @file
  9. * Responsive styles for views grid horizontal layout.
  10. *
  11. * This creates the correct count of columns and automatically resizes the
  12. * grid-items to fit into it. The grid-items will flow onto the next row when
  13. * they reach the --views-grid-item--min-width value.
  14. */
  15. /*
  16. * Media query breakpoints.
  17. * Processed by postcss/postcss-custom-media.
  18. */
  19. /* Navigation related breakpoints */
  20. /* Grid related breakpoints */
  21. /* Grid shifts from 6 to 14 columns. */
  22. /* Width of the entire grid maxes out. */
  23. .views-view-grid {
  24. --views-grid--layout-gap: var(--sp);
  25. --views-grid--column-count: 4; /* Will be overridden by an inline style. */
  26. --views-grid-item--min-width: 6.25rem;
  27. }
  28. .views-view-grid--horizontal {
  29. /**
  30. * Calculated values.
  31. */
  32. --views-grid--gap-count: calc(var(--views-grid--column-count) - 1);
  33. --views-grid--total-gap-width: calc(var(--views-grid--gap-count) * var(--views-grid--layout-gap));
  34. --views-grid-item--max-width: calc((100% - var(--views-grid--total-gap-width)) / var(--views-grid--column-count));
  35. display: grid;
  36. grid-template-columns: repeat(auto-fill, minmax(max(var(--views-grid-item--min-width), var(--views-grid-item--max-width)), 1fr));
  37. grid-gap: var(--views-grid--layout-gap);
  38. }
  39. .views-view-grid--vertical {
  40. margin-bottom: calc(-1 * var(--views-grid--layout-gap)); /* Offset the bottom row's padding. */
  41. column-width: var(--views-grid-item--min-width);
  42. column-count: var(--views-grid--column-count);
  43. grid-column-gap: var(--views-grid--layout-gap)
  44. }
  45. .views-view-grid--vertical .views-view-grid__item > * {
  46. padding-bottom: var(--views-grid--layout-gap);
  47. page-break-inside: avoid;
  48. break-inside: avoid;
  49. }