You are here

ultimenu.css in Ultimenu 8.2

Same filename and directory in other branches
  1. 8 css/ultimenu.css
  2. 7 css/ultimenu.css

This file contains all Ultimenu layout and basic styling, the essiantials.

Classes: .ultimenu: the menu UL tag. .ultimenu > li: the menu LI tag. .ultimenu__flyout: the ultimenu region container aka flyout. .ultimenu__link: the menu-link A tag.

See also

about RTL

File

css/ultimenu.css
View source
  1. /**
  2. * @file
  3. * This file contains all Ultimenu layout and basic styling, the essiantials.
  4. *
  5. * Classes:
  6. * .ultimenu: the menu UL tag.
  7. * .ultimenu > li: the menu LI tag.
  8. * .ultimenu__flyout: the ultimenu region container aka flyout.
  9. * .ultimenu__link: the menu-link A tag.
  10. * @see about RTL
  11. * - https://drupal.org/node/2032405
  12. */
  13. /**
  14. * Menu list style.
  15. */
  16. .ultimenu {
  17. list-style: none;
  18. margin: 0;
  19. min-height: 42px;
  20. position: relative; /* Make flyout relative to UL for wide flyout */
  21. z-index: 97;
  22. }
  23. /* Add "position: relative;" to make flyout relative to LI for smaller flyout */
  24. .ultimenu > li {
  25. display: block;
  26. margin: 0;
  27. }
  28. /**
  29. * Ugly arrows to support special_menu_items module that stripped out A classes.
  30. * If you don't have special_menu_items, reference it by .ultimenu__link.
  31. */
  32. .ultimenu .ultimenu__link {
  33. display: block;
  34. line-height: 1.6;
  35. position: relative; /* To hold arrows for small device */
  36. text-decoration: none;
  37. transition: background-color .5s, color .5s;
  38. }
  39. /**
  40. * Ultimenu flyout: Never display: none, bad for transition/ animation.
  41. */
  42. .ultimenu__flyout {
  43. bottom: auto;
  44. /* Intentional !important to avoid accidental overrides. */
  45. display: block !important;
  46. left: 0;
  47. height: 0;
  48. line-height: 1.4;
  49. max-height: 0;
  50. overflow: hidden;
  51. opacity: 0;
  52. padding: 0;
  53. position: relative;
  54. top: 100%;
  55. visibility: hidden;
  56. transition: height .4s, padding .3s, opacity .3s;
  57. width: 100%;
  58. z-index: 102;
  59. }
  60. .ultimenu__flyout.is-flyout-expanded {
  61. height: auto;
  62. max-height: 100%;
  63. min-height: 64px;
  64. padding: 20px 0;
  65. overflow: visible;
  66. opacity: 1;
  67. transition-delay: .1s;
  68. visibility: visible;
  69. }
  70. /** This region is placed within .ultimenu__flyout. */
  71. .ultimenu__region {
  72. background-color: #fff;
  73. padding: 20px;
  74. }
  75. /**
  76. * 944px below with 16px base font.
  77. */
  78. @media all and (max-width: 58.999em) {
  79. .ultimenu > li,
  80. .ultimenu .ultimenu__link {
  81. min-width: 100%;
  82. width: 100%;
  83. }
  84. }
  85. /**
  86. * 944px+ with 16px base font.
  87. *
  88. * .ultimenu--hover is for when off-canvas is disabled for desktop.
  89. */
  90. @media all and (min-width: 59em) {
  91. .ultimenu--hover > li {
  92. display: inline-block;
  93. vertical-align: bottom;
  94. }
  95. /** We still have .caret to toggle flyout here. */
  96. .ultimenu--hover .ultimenu__flyout {
  97. position: absolute;
  98. }
  99. /** To hold caret, tablet up. */
  100. .ultimenu.ultimenu--hover .ultimenu__link {
  101. padding-right: 64px;
  102. }
  103. .ultimenu--hover .ultimenu__link .caret {
  104. background-color: transparent;
  105. }
  106. .ultimenu--hover li .is-ultimenu-active + .ultimenu__flyout {
  107. padding: 20px 0;
  108. }
  109. }
  110. /**
  111. * 1025px with 16px base font, assumes no-touch devices.
  112. * Use Modernizr.js to have correct touch detection.
  113. * These rules should work without javascript.
  114. */
  115. @media only screen and (min-width: 64.063em) {
  116. /** Generic rules for all Ultimenu flyout being hovered. */
  117. .ultimenu--hover li:hover > .ultimenu__flyout,
  118. .ultimenu--hover li a:active + .ultimenu__flyout,
  119. .ultimenu--hover li a:focus + .ultimenu__flyout,
  120. .ultimenu--hover li .ultimenu__flyout:focus {
  121. height: auto;
  122. max-height: none;
  123. min-height: 64px;
  124. padding: 20px 0;
  125. overflow: visible;
  126. opacity: 1;
  127. transition-delay: .1s;
  128. visibility: visible;
  129. }
  130. /** Ultimenu placed in the footer, htt: horizontal to top. */
  131. .ultimenu--htt li:hover > .ultimenu__flyout,
  132. .ultimenu--htt li a:active + .ultimenu__flyout,
  133. .ultimenu--htt li a:focus + .ultimenu__flyout,
  134. .ultimenu--htt li .ultimenu__flyout:focus {
  135. height: auto;
  136. bottom: 100%;
  137. max-height: none;
  138. top: auto;
  139. }
  140. /* Unless you want to show caret for laptop up, hide the caret.
  141. Remove this if you want to have clickable Ultimenu for all devices.
  142. Be sure to remove the hover rules above. */
  143. .ultimenu--htt .has-ultimenu .caret,
  144. .ultimenu--vertical .has-ultimenu .caret,
  145. .is-ultimenu-canvas--hover .ultimenu__link .caret {
  146. display: none;
  147. }
  148. .ultimenu.ultimenu--hover .ultimenu__link {
  149. padding-right: 1.5em;
  150. }
  151. }