views-responsive-grid.css

Same filename in other branches
  1. 10 core/modules/views/css/views-responsive-grid.css
/**
 * CSS for Views responsive grid style.
 */

.views-view-responsive-grid {
  --views-responsive-grid--layout-gap: 10px; /* Will be overridden by an inline style. */
  --views-responsive-grid--column-count: 4; /* Will be overridden by an inline style. */
  --views-responsive-grid--cell-min-width: 100px; /* Will be overridden by an inline style. */
}

.views-view-responsive-grid--horizontal {
  /**
   * Calculated values.
   */
  --views-responsive-grid--gap-count: calc(var(--views-responsive-grid--column-count) - 1);
  --views-responsive-grid--total-gap-width: calc(var(--views-responsive-grid--gap-count) * var(--views-responsive-grid--layout-gap));
  --views-responsive-grid-item--max-width: calc((100% - var(--views-responsive-grid--total-gap-width)) / var(--views-responsive-grid--column-count));
  --views-responsive-grid-item--calculated-min-width: min(100%, var(--views-responsive-grid--cell-min-width)); /* Ensure that cell minimum width does not overflow container. */

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(var(--views-responsive-grid-item--calculated-min-width), var(--views-responsive-grid-item--max-width)), 1fr));
  gap: var(--views-responsive-grid--layout-gap);
}

.views-view-responsive-grid--vertical {
  margin-bottom: calc(var(--views-responsive-grid--layout-gap) * -1); /* Offset the bottom row's padding. */
  column-width: var(--views-responsive-grid--cell-min-width);
  column-count: var(--views-responsive-grid--column-count);
  column-gap: var(--views-responsive-grid--layout-gap);
}

.views-view-responsive-grid--vertical .views-view-responsive-grid__item > * {
  padding-bottom: var(--views-responsive-grid--layout-gap);
  page-break-inside: avoid;
  break-inside: avoid;
}

File

core/modules/views/css/views-responsive-grid.css

View source
  1. /**
  2. * CSS for Views responsive grid style.
  3. */
  4. .views-view-responsive-grid {
  5. --views-responsive-grid--layout-gap: 10px; /* Will be overridden by an inline style. */
  6. --views-responsive-grid--column-count: 4; /* Will be overridden by an inline style. */
  7. --views-responsive-grid--cell-min-width: 100px; /* Will be overridden by an inline style. */
  8. }
  9. .views-view-responsive-grid--horizontal {
  10. /**
  11. * Calculated values.
  12. */
  13. --views-responsive-grid--gap-count: calc(var(--views-responsive-grid--column-count) - 1);
  14. --views-responsive-grid--total-gap-width: calc(var(--views-responsive-grid--gap-count) * var(--views-responsive-grid--layout-gap));
  15. --views-responsive-grid-item--max-width: calc((100% - var(--views-responsive-grid--total-gap-width)) / var(--views-responsive-grid--column-count));
  16. --views-responsive-grid-item--calculated-min-width: min(100%, var(--views-responsive-grid--cell-min-width)); /* Ensure that cell minimum width does not overflow container. */
  17. display: grid;
  18. grid-template-columns: repeat(auto-fill, minmax(max(var(--views-responsive-grid-item--calculated-min-width), var(--views-responsive-grid-item--max-width)), 1fr));
  19. gap: var(--views-responsive-grid--layout-gap);
  20. }
  21. .views-view-responsive-grid--vertical {
  22. margin-bottom: calc(var(--views-responsive-grid--layout-gap) * -1); /* Offset the bottom row's padding. */
  23. column-width: var(--views-responsive-grid--cell-min-width);
  24. column-count: var(--views-responsive-grid--column-count);
  25. column-gap: var(--views-responsive-grid--layout-gap);
  26. }
  27. .views-view-responsive-grid--vertical .views-view-responsive-grid__item > * {
  28. padding-bottom: var(--views-responsive-grid--layout-gap);
  29. page-break-inside: avoid;
  30. break-inside: avoid;
  31. }

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