layout-views-grid.css

Same filename in other branches
  1. 10 core/themes/olivero/css/layout/layout-views-grid.css

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. .views-view-grid {
  16. --views-grid--layout-gap: var(--sp);
  17. --views-grid--column-count: 4; /* Will be overridden by an inline style. */
  18. --views-grid-item--min-width: 6.25rem;
  19. }
  20. .views-view-grid--horizontal {
  21. /**
  22. * Calculated values.
  23. */
  24. --views-grid--gap-count: calc(var(--views-grid--column-count) - 1);
  25. --views-grid--total-gap-width: calc(var(--views-grid--gap-count) * var(--views-grid--layout-gap));
  26. --views-grid-item--max-width: calc((100% - var(--views-grid--total-gap-width)) / var(--views-grid--column-count));
  27. display: grid;
  28. grid-template-columns: repeat(auto-fill, minmax(max(var(--views-grid-item--min-width), var(--views-grid-item--max-width)), 1fr));
  29. grid-gap: var(--views-grid--layout-gap);
  30. }
  31. .views-view-grid--vertical {
  32. margin-block-end: calc(-1 * var(--views-grid--layout-gap)); /* Offset the bottom row's padding. */
  33. column-width: var(--views-grid-item--min-width);
  34. column-count: var(--views-grid--column-count);
  35. column-gap: var(--views-grid--layout-gap);
  36. }
  37. .views-view-grid--vertical .views-view-grid__item > * {
  38. padding-block-end: var(--views-grid--layout-gap);
  39. page-break-inside: avoid;
  40. break-inside: avoid;
  41. }

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.