grid.pcss.css

Same filename in other branches
  1. 10 core/themes/olivero/css/layout/grid.pcss.css
  2. 11.x core/themes/olivero/css/layout/grid.pcss.css

Grid system.

File

core/themes/olivero/css/layout/grid.pcss.css

View source
  1. /**
  2. * @file
  3. * Grid system.
  4. */
  5. @import "../base/variables.pcss.css";
  6. .grid-full {
  7. display: grid;
  8. grid-template-rows: 1fr;
  9. grid-template-columns: repeat(var(--grid-col-count), minmax(0, 1fr));
  10. grid-column-gap: var(--grid-gap);
  11. /* .grid-full classes nested 3 or more deep go full width. */
  12. & .grid-full .grid-full {
  13. display: block;
  14. }
  15. @media (--grid-md) {
  16. grid-template-columns: repeat(var(--grid-col-count--md), minmax(0, 1fr));
  17. grid-column-gap: var(--grid-gap--md);
  18. }
  19. }
  20. /*
  21. If the .grid-full is nested within the following, apply the appropriate number of columns.
  22. - .layout--content-narrow class.
  23. - Element that's inheriting the layout--content-narrow styles from its parent region.
  24. */
  25. .layout--content-narrow .grid-full,
  26. .layout--pass--content-narrow > * .grid-full {
  27. @media (--grid-md) {
  28. -ms-grid-columns: (minmax(0, 1fr))[ calc(var(--grid-col-count--md) - 2) ];
  29. grid-template-columns: repeat(calc(var(--grid-col-count--md) - 2), minmax(0, 1fr));
  30. }
  31. @media (--lg) {
  32. -ms-grid-columns: (minmax(0, 1fr))[ calc(var(--grid-col-count--lg) - 6) ];
  33. grid-template-columns: repeat(calc(var(--grid-col-count--lg) - 6), minmax(0, 1fr));
  34. }
  35. }
  36. /*
  37. If the .grid-full is nested within the following, apply the appropriate number of columns.
  38. - .layout--content-medium class.
  39. - Element that's inheriting the layout--content-medium styles from its parent region.
  40. */
  41. .layout--content-medium .grid-full,
  42. .layout--pass--content-medium > * .grid-full {
  43. @media (--grid-md) {
  44. -ms-grid-columns: (minmax(0, 1fr))[ calc(var(--grid-col-count--md) - 2) ];
  45. grid-template-columns: repeat(calc(var(--grid-col-count--md) - 2), minmax(0, 1fr));
  46. }
  47. @media (--lg) {
  48. -ms-grid-columns: (minmax(0, 1fr))[ calc(var(--grid-col-count--md) - 4) ];
  49. grid-template-columns: repeat(calc(var(--grid-col-count--md) - 4), minmax(0, 1fr));
  50. }
  51. }

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