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. 11.x 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: flex;
  flex-wrap: wrap;

  & > .layout__region {
    flex: 1 0 100%;
    margin-block-end: var(--grid-gap);

    @media (--md) {
      flex-grow: 0;
      flex-shrink: 0;
      margin-block-end: 0;
    }
  }
}

@media (--md) {
  .layout--twocol-section--50-50 {
    & > .layout__region--first {
      flex-basis: calc(50% - (var(--grid-gap) * 0.5));
      margin-inline-end: calc(var(--grid-gap) * 0.5);
    }

    & > .layout__region--second {
      flex-basis: calc(50% - (var(--grid-gap) * 0.5));
      margin-inline-start: calc(var(--grid-gap) * 0.5);
    }
  }

  .layout--twocol-section--33-67 {
    & > .layout__region--first {
      flex-basis: calc(33.33% - (var(--grid-gap) * 0.3333));
      margin-inline-end: calc(var(--grid-gap) * 0.3333);
    }

    & > .layout__region--second {
      flex-basis: calc(66.66% - (var(--grid-gap) * 0.6666));
      margin-inline-start: calc(var(--grid-gap) * 0.6666);
    }
  }

  .layout--twocol-section--67-33 {
    & > .layout__region--first {
      flex-basis: calc(66.66% - (var(--grid-gap) * 0.6666));
      margin-inline-end: calc(var(--grid-gap) * 0.6666);
    }

    & > .layout__region--second {
      flex-basis: calc(33.33% - (var(--grid-gap) * 0.3333));
      margin-inline-start: calc(var(--grid-gap) * 0.3333);
    }
  }

  .layout--twocol-section--25-75 {
    & > .layout__region--first {
      flex-basis: calc(25% - (var(--grid-gap) * 0.25));
      margin-inline-end: calc(var(--grid-gap) * 0.25);
    }

    & > .layout__region--second {
      flex-basis: calc(75% - (var(--grid-gap) * 0.75));
      margin-inline-start: calc(var(--grid-gap) * 0.75);
    }
  }

  .layout--twocol-section--75-25 {
    & > .layout__region--first {
      flex-basis: calc(75% - (var(--grid-gap) * 0.75));
      margin-inline-end: calc(var(--grid-gap) * 0.75);
    }

    & > .layout__region--second {
      flex-basis: calc(25% - (var(--grid-gap) * 0.25));
      margin-inline-start: calc(var(--grid-gap) * 0.25);
    }
  }
}

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: flex;
  8. flex-wrap: wrap;
  9. & > .layout__region {
  10. flex: 1 0 100%;
  11. margin-block-end: var(--grid-gap);
  12. @media (--md) {
  13. flex-grow: 0;
  14. flex-shrink: 0;
  15. margin-block-end: 0;
  16. }
  17. }
  18. }
  19. @media (--md) {
  20. .layout--twocol-section--50-50 {
  21. & > .layout__region--first {
  22. flex-basis: calc(50% - (var(--grid-gap) * 0.5));
  23. margin-inline-end: calc(var(--grid-gap) * 0.5);
  24. }
  25. & > .layout__region--second {
  26. flex-basis: calc(50% - (var(--grid-gap) * 0.5));
  27. margin-inline-start: calc(var(--grid-gap) * 0.5);
  28. }
  29. }
  30. .layout--twocol-section--33-67 {
  31. & > .layout__region--first {
  32. flex-basis: calc(33.33% - (var(--grid-gap) * 0.3333));
  33. margin-inline-end: calc(var(--grid-gap) * 0.3333);
  34. }
  35. & > .layout__region--second {
  36. flex-basis: calc(66.66% - (var(--grid-gap) * 0.6666));
  37. margin-inline-start: calc(var(--grid-gap) * 0.6666);
  38. }
  39. }
  40. .layout--twocol-section--67-33 {
  41. & > .layout__region--first {
  42. flex-basis: calc(66.66% - (var(--grid-gap) * 0.6666));
  43. margin-inline-end: calc(var(--grid-gap) * 0.6666);
  44. }
  45. & > .layout__region--second {
  46. flex-basis: calc(33.33% - (var(--grid-gap) * 0.3333));
  47. margin-inline-start: calc(var(--grid-gap) * 0.3333);
  48. }
  49. }
  50. .layout--twocol-section--25-75 {
  51. & > .layout__region--first {
  52. flex-basis: calc(25% - (var(--grid-gap) * 0.25));
  53. margin-inline-end: calc(var(--grid-gap) * 0.25);
  54. }
  55. & > .layout__region--second {
  56. flex-basis: calc(75% - (var(--grid-gap) * 0.75));
  57. margin-inline-start: calc(var(--grid-gap) * 0.75);
  58. }
  59. }
  60. .layout--twocol-section--75-25 {
  61. & > .layout__region--first {
  62. flex-basis: calc(75% - (var(--grid-gap) * 0.75));
  63. margin-inline-end: calc(var(--grid-gap) * 0.75);
  64. }
  65. & > .layout__region--second {
  66. flex-basis: calc(25% - (var(--grid-gap) * 0.25));
  67. margin-inline-start: calc(var(--grid-gap) * 0.25);
  68. }
  69. }
  70. }

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