wide-content.pcss.css

Same filename in other branches
  1. 11.x core/themes/olivero/css/components/wide-content.pcss.css

Wide content

This component breaks out of the layout-content-narrow grid layout using a combination of carefully calculated negative margins and widths. It is used on the article's default image field.

File

core/themes/olivero/css/components/wide-content.pcss.css

View source
  1. /**
  2. * @file
  3. * Wide content
  4. *
  5. * This component breaks out of the layout-content-narrow grid layout using a
  6. * combination of carefully calculated negative margins and widths. It is used
  7. * on the article's default image field.
  8. */
  9. @import "../base/media-queries.pcss.css";
  10. .wide-content {
  11. margin-block-start: var(--sp0-5);
  12. margin-block-end: var(--sp2);
  13. margin-inline-start: 0;
  14. margin-inline-end: 0;
  15. @media (--grid-md) {
  16. width: calc(var(--grid-col-count) * var(--grid-col-width) + var(--grid-gap-count) * var(--grid-gap));
  17. margin-block: var(--sp2) var(--sp4);
  18. margin-inline-start: calc(-1 * ((var(--grid-col-width) + var(--grid-gap))));
  19. }
  20. @media (--lg) {
  21. width: calc(12 * var(--grid-col-width) + 11 * var(--grid-gap));
  22. margin-inline-start: calc(-1 * (var(--grid-col-width) + var(--grid-gap)));
  23. }
  24. }
  25. /* Ensure that image doesn't overlap sidebar. */
  26. .sidebar-grid .wide-content {
  27. @media (--lg) {
  28. width: calc(9 * var(--grid-col-width) + 8 * var(--grid-gap));
  29. }
  30. @media (--xl) {
  31. width: calc(10 * var(--grid-col-width) + 9 * var(--grid-gap));
  32. }
  33. }
  34. /* Ensure that image doesn't overlap layout builder sections when editing layouts. */
  35. .layout-builder .wide-content,
  36. .region--hero .wide-content {
  37. max-width: 100%;
  38. margin-inline: 0;
  39. }

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