You are here

ultimenu.offcanvas.css in Ultimenu 8.2

This is the base CSS rules for anything off-canvas.

.is-ultimenu-canvas-off: #header or .region-primary-menu, etc. .is-ultimenu-canvas-on: any sibling of #header.

Tips: Use Modernizer.js to have graceful fallback for old browsers.

The is-ultimenu-canvas--active is if enabled for both mobile and desktop. Otherwise only exists on mobile only.

File

css/components/ultimenu.offcanvas.css
View source
  1. /**
  2. * @file
  3. * This is the base CSS rules for anything off-canvas.
  4. *
  5. * .is-ultimenu-canvas-off: #header or .region-primary-menu, etc.
  6. * .is-ultimenu-canvas-on: any sibling of #header.
  7. *
  8. * Tips: Use Modernizer.js to have graceful fallback for old browsers.
  9. *
  10. * The is-ultimenu-canvas--active is if enabled for both mobile and desktop.
  11. * Otherwise only exists on mobile only.
  12. */
  13. /** Global off-canvas rules. */
  14. .is-ultimenu-canvas-backdrop {
  15. background-color: transparent;
  16. bottom: 0;
  17. left: 0;
  18. opacity: 0;
  19. overflow: hidden;
  20. position: fixed;
  21. top: 0;
  22. -ms-transition: all .3s ease;
  23. transition: all .3s ease;
  24. z-index: -1;
  25. }
  26. .is-ultimenu-expanded .is-ultimenu-canvas-backdrop,
  27. .is-ultimenu-canvas--hiding .is-ultimenu-canvas-backdrop {
  28. background-color: rgba(0, 0, 0, .6);
  29. opacity: 1;
  30. -ms-transition-delay: .2s;
  31. transition-delay: .2s;
  32. height: 100%;
  33. width: 100%;
  34. z-index: 9997;
  35. }
  36. /** If off-canvas is enabled for both mobile and desktop. */
  37. .is-ultimenu-canvas--active {
  38. /** Necessary for `overflow: hidden` when expanded below. */
  39. position: relative;
  40. }
  41. /** Hide body overflow when off-canvas is being expanded. */
  42. .is-ultimenu-canvas.is-ultimenu-expanded,
  43. .is-ultimenu-canvas.is-ultimenu-canvas--hiding {
  44. overflow: hidden;
  45. }
  46. /** The #header element, safe whether enabled for desktop, or mobile only. */
  47. .is-ultimenu-canvas .is-ultimenu-canvas-off {
  48. backface-visibility: hidden;
  49. display: block;
  50. float: none;
  51. width: 100%;
  52. z-index: 9998;
  53. }
  54. /** The #header alike element, if activated for both desktop and mobile. */
  55. .is-ultimenu-canvas--active .is-ultimenu-canvas-off {
  56. /** Adjust and remove !important accordingly. This is to override Bartik. */
  57. background: rgba(0, 0, 0, .9) !important;
  58. bottom: 0;
  59. height: 100%;
  60. height: 100vh;
  61. left: -100%;
  62. max-height: none;
  63. /** Desktop needs the exact pixel to avoid too wide off-canvas. */
  64. max-width: 320px;
  65. min-height: 320px;
  66. overflow: hidden;
  67. padding: 0;
  68. position: fixed;
  69. top: 0;
  70. transition: all 500ms ease;
  71. }
  72. .is-ultimenu-canvas.is-ultimenu-expanded .is-ultimenu-canvas-off {
  73. left: 0;
  74. overflow-y: scroll;
  75. -webkit-overflow-scrolling: touch;
  76. overflow-scrolling: touch;
  77. }
  78. /** Any element below #header alike. */
  79. .is-ultimenu-canvas--active .is-ultimenu-canvas-on {
  80. backface-visibility: hidden;
  81. position: relative;
  82. }
  83. /**
  84. * 944px with 16px base font.
  85. * .is-ultimenu-canvas--active is only available if off-canvas is enabled for
  86. * both desktop and mobile. Or a little later via JS if not. That's why we don't
  87. * rely on it for the smaller device to avoid FOUC.
  88. */
  89. @media only screen and (max-width: 58.999em) {
  90. /** The #header alike element. This ensures it always kicks in. */
  91. .is-ultimenu-canvas .is-ultimenu-canvas-off {
  92. max-width: 80%;
  93. position: fixed;
  94. }
  95. /* Just to satisfy desktop responsive preview while viewing like mobile. */
  96. .is-ultimenu-canvas--active .is-ultimenu-canvas-off {
  97. min-height: 100%;
  98. }
  99. /** Only transform on body for small devices since desktop has fixed width. */
  100. .is-ultimenu-canvas.is-ultimenu-expanded,
  101. .is-ultimenu-canvas.is-ultimenu-canvas--hiding {
  102. transform: translate3d(0px, 0px, 0px);
  103. }
  104. }