wrapper.pcss.css

Same filename and directory in other branches
  1. 10 core/misc/dialog/off-canvas/css/wrapper.pcss.css
  2. 11.x core/misc/dialog/off-canvas/css/wrapper.pcss.css

CSS for off-canvas dialog wrapper.

@internal

File

core/misc/dialog/off-canvas/css/wrapper.pcss.css

View source
  1. /**
  2. * @file
  3. * CSS for off-canvas dialog wrapper.
  4. *
  5. * @internal
  6. */
  7. #drupal-off-canvas-wrapper {
  8. --off-canvas-wrapper-box-shadow: 0 0 4px 2px rgb(0, 0, 0, 0.3);
  9. --off-canvas-wrapper-border-color: #2d2d2d;
  10. --off-canvas-wrapper-border-width: 1px;
  11. z-index: 501; /* Layer the dialog just under the toolbar. */
  12. overflow: auto;
  13. box-sizing: border-box;
  14. height: 100%;
  15. border-inline-start: solid var(--off-canvas-wrapper-border-width) var(--off-canvas-wrapper-border-color);
  16. box-shadow: var(--off-canvas-wrapper-box-shadow);
  17. /*
  18. * When the off-canvas appears at the top or bottom of the page (Workspaces
  19. * does this), it should not obscure the Navigation module's toolbar.
  20. *
  21. * Note that the Layout Builder off-canvas dialog includes
  22. * `data-offset-top="0"`, so we need to be sure to not select that.
  23. *
  24. * Note that we have to use `!important` below to override the dialog JS's
  25. * inline CSS.
  26. *
  27. * @todo
  28. * We *may* able to remove this code once the https://www.drupal.org/i/3096017
  29. * is fixed.
  30. */
  31. [data-admin-toolbar] &:is([data-offset-top]:not([data-offset-top="0"]), [data-offset-bottom]:not([data-offset-bottom="0"])) {
  32. left: var(--drupal-displace-offset-left, 0) !important;
  33. width: calc(100% - var(--drupal-displace-offset-left, 0px)) !important;
  34. &:dir(rtl) {
  35. right: var(--drupal-displace-offset-right, 0) !important;
  36. width: calc(100% - var(--drupal-displace-offset-right, 0px)) !important;
  37. }
  38. }
  39. /*
  40. * Force the off-canvas dialog to be 100% width at the same breakpoint the
  41. * dialog system uses to expand dialog widths.
  42. */
  43. @media (max-width: 768px) {
  44. width: 100% !important;
  45. }
  46. }
  47. /* When off-canvas dialog is at 100% width stop the body from scrolling */
  48. body.js-off-canvas-dialog-open {
  49. @media (max-width: 768px) {
  50. position: fixed;
  51. }
  52. }
  53. /* This is a page level content wrapper that shrinks when off-canvas is open. */
  54. .dialog-off-canvas-main-canvas {
  55. transition:
  56. padding-right 0.7s ease,
  57. padding-left 0.7s ease,
  58. padding-top 0.3s ease;
  59. @media (prefers-reduced-motion: reduce) {
  60. transition: none;
  61. }
  62. }

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