layout-views-grid-vertical.pcss.css

Responsive styles for views grid vertical layout.

File

core/themes/olivero/css/layout/layout-views-grid-vertical.pcss.css

View source
  1. /**
  2. * @file
  3. * Responsive styles for views grid vertical layout.
  4. */
  5. @import "../base/variables.pcss.css";
  6. :root {
  7. --views-grid-layout-gap: var(--sp);
  8. }
  9. .views-view-grid--vertical {
  10. margin-block-end: calc(-1 * var(--views-grid-layout-gap)); /* Offset the bottom row's padding. */
  11. column-gap: var(--views-grid-layout-gap);
  12. &.cols-2 {
  13. @media (--sm) {
  14. column-count: 2;
  15. }
  16. }
  17. &.cols-3 {
  18. @media (--sm) {
  19. column-count: 2;
  20. }
  21. @media (--md) {
  22. column-count: 3;
  23. }
  24. }
  25. &.cols-4 {
  26. @media (--sm) {
  27. column-count: 2;
  28. }
  29. @media (--md) {
  30. column-count: 3;
  31. }
  32. @media (--lg) {
  33. column-count: 4;
  34. }
  35. }
  36. &.cols-5 {
  37. @media (--sm) {
  38. column-count: 2;
  39. }
  40. @media (--md) {
  41. column-count: 3;
  42. }
  43. @media (--lg) {
  44. column-count: 5;
  45. }
  46. }
  47. &.cols-6 {
  48. @media (--sm) {
  49. column-count: 2;
  50. }
  51. @media (--md) {
  52. column-count: 3;
  53. }
  54. @media (--lg) {
  55. column-count: 6;
  56. }
  57. }
  58. &.cols-7 {
  59. @media (--sm) {
  60. column-count: 2;
  61. }
  62. @media (--md) {
  63. column-count: 3;
  64. }
  65. @media (--lg) {
  66. column-count: 7;
  67. }
  68. }
  69. &.cols-8 {
  70. @media (--sm) {
  71. column-count: 2;
  72. }
  73. @media (--md) {
  74. column-count: 4;
  75. }
  76. @media (--lg) {
  77. column-count: 8;
  78. }
  79. }
  80. & .views-view-grid__item {
  81. & > * {
  82. padding-block-end: var(--views-grid-layout-gap);
  83. break-inside: avoid;
  84. }
  85. }
  86. }

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