layout-builder-twocol-section.pcss.css

Same filename in other branches
  1. 9 core/themes/olivero/css/layout/layout-builder-twocol-section.pcss.css
  2. 10 core/themes/olivero/css/layout/layout-builder-twocol-section.pcss.css
/*
 * @file
 * Provides the layout styles for two-column layout section.
 */

@import "../base/media-queries.pcss.css";

.layout--twocol-section {
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: var(--layout-twocol-grid);

  & > .layout__region--first {
    grid-column: var(--layout-twocol-grid__first);
  }

  & > .layout__region--second {
    grid-column: var(--layout-twocol-grid__second);
  }
}

@media (--md) {
  .layout--twocol-section--50-50 {
    --layout-twocol-grid: repeat(2, minmax(0, 1fr));
  }

  .layout--twocol-section--33-67 {
    --layout-twocol-grid: repeat(3, minmax(0, 1fr));
    --layout-twocol-grid__second: span 2;
  }

  .layout--twocol-section--67-33 {
    --layout-twocol-grid: repeat(3, minmax(0, 1fr));
    --layout-twocol-grid__first: span 2;
  }

  .layout--twocol-section--25-75 {
    --layout-twocol-grid: repeat(4, minmax(0, 1fr));
    --layout-twocol-grid__second: span 3;
  }

  .layout--twocol-section--75-25 {
    --layout-twocol-grid: repeat(4, minmax(0, 1fr));
    --layout-twocol-grid__first: span 3;
  }
}

File

core/themes/olivero/css/layout/layout-builder-twocol-section.pcss.css

View source
  1. /*
  2. * @file
  3. * Provides the layout styles for two-column layout section.
  4. */
  5. @import "../base/media-queries.pcss.css";
  6. .layout--twocol-section {
  7. display: grid;
  8. gap: var(--grid-gap);
  9. grid-template-columns: var(--layout-twocol-grid);
  10. & > .layout__region--first {
  11. grid-column: var(--layout-twocol-grid__first);
  12. }
  13. & > .layout__region--second {
  14. grid-column: var(--layout-twocol-grid__second);
  15. }
  16. }
  17. @media (--md) {
  18. .layout--twocol-section--50-50 {
  19. --layout-twocol-grid: repeat(2, minmax(0, 1fr));
  20. }
  21. .layout--twocol-section--33-67 {
  22. --layout-twocol-grid: repeat(3, minmax(0, 1fr));
  23. --layout-twocol-grid__second: span 2;
  24. }
  25. .layout--twocol-section--67-33 {
  26. --layout-twocol-grid: repeat(3, minmax(0, 1fr));
  27. --layout-twocol-grid__first: span 2;
  28. }
  29. .layout--twocol-section--25-75 {
  30. --layout-twocol-grid: repeat(4, minmax(0, 1fr));
  31. --layout-twocol-grid__second: span 3;
  32. }
  33. .layout--twocol-section--75-25 {
  34. --layout-twocol-grid: repeat(4, minmax(0, 1fr));
  35. --layout-twocol-grid__first: span 3;
  36. }
  37. }

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