You are here

ultimenu.css in Ultimenu 8

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

This file contains all Ultimenu layout and very basic styling.

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 very basic styling.
  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. /* Remove this box-sizing if your theme is already using one globally */
  14. .ultimenu *,
  15. .ultimenu *::before,
  16. .ultimenu *::after {
  17. box-sizing: border-box;
  18. }
  19. /**
  20. * Menu list style.
  21. */
  22. .ultimenu {
  23. list-style: none;
  24. margin: 0;
  25. min-height: 40px;
  26. padding: 0;
  27. position: relative; /* Make flyout relative to UL for wide flyout */
  28. }
  29. .block .ultimenu {
  30. padding: 0;
  31. }
  32. .ultimenu .ultimenu__link {
  33. line-height: 1.6;
  34. }
  35. /* Add "position: relative;" to make flyout relative to LI for smaller flyout */
  36. .ultimenu > li {
  37. display: inline-block;
  38. margin: 0;
  39. }
  40. /**
  41. * Ultimenu flyout.
  42. */
  43. .ultimenu__flyout {
  44. left: 0; /* LTR */
  45. line-height: 1.4;
  46. padding: 20px 0;
  47. width: 100%;
  48. z-index: 102;
  49. }
  50. [dir="rtl"] .ultimenu__flyout {
  51. left: 0;
  52. }
  53. .ultimenu__flyout .block {
  54. max-width: 100%;
  55. }
  56. /**
  57. * Orientation.
  58. * -vtr: vdertical to right
  59. * -vtl: vertical to left
  60. * -htt: horizontal to top
  61. * -htb: horizontal to bottom
  62. */
  63. .ultimenu--horizontal {
  64. padding: 0; /* Overrides bartik .block ul padding */
  65. z-index: 9;
  66. }
  67. .ultimenu--vertical {
  68. height: auto;
  69. z-index: 8;
  70. }
  71. .ultimenu--vertical > li {
  72. display: block;
  73. float: none;
  74. position: relative;
  75. }
  76. .ultimenu--vtr .ultimenu__flyout {
  77. left: 100%; /* LTR */
  78. top: 0;
  79. }
  80. [dir="rtl"] .ultimenu--vtr .ultimenu__flyout {
  81. left: auto;
  82. right: 100%;
  83. }
  84. .ultimenu--vtl .ultimenu__flyout {
  85. left: auto; /* LTR */
  86. right: 100%; /* LTR */
  87. top: 0;
  88. }
  89. [dir="rtl"] .ultimenu--vtl .ultimenu__flyout {
  90. left: 100%;
  91. right: auto;
  92. }
  93. .ultimenu--htt .ultimenu__flyout {
  94. bottom: 100%;
  95. margin-bottom: 20px;
  96. top: auto;
  97. }
  98. .button.button--ultimenu {
  99. background: #555;
  100. border: 1px solid #333;
  101. border-radius: 4px;
  102. height: 32px;
  103. margin: 0;
  104. padding: 0;
  105. position: absolute;
  106. right: 10px;
  107. text-align: center;
  108. top: 5px;
  109. width: 42px;
  110. z-index: 999;
  111. }
  112. .button.button--ultimenu:hover,
  113. .button.button--ultimenu:active,
  114. .button.button--ultimenu:focus {
  115. background: #111;
  116. border-color: #555;
  117. }
  118. .button--ultimenu .bars {
  119. display: block;
  120. font-size: 0;
  121. height: 0;
  122. position: absolute;
  123. right: 10px;
  124. top: -5px;
  125. width: 20px;
  126. box-shadow: 0 12px 0 2px white, 0 20px 0 2px white, 0 28px 0 2px white;
  127. }
  128. /**
  129. * Smaller medium.
  130. */
  131. @media all and (max-width: 58.999em) {
  132. /* Ultimenu flyout. Mobile version has no :hover, so safe to display: none,
  133. and relies on click events via jQuery. */
  134. .ultimenu {
  135. overflow: hidden;
  136. }
  137. .ultimenu__flyout {
  138. display: none;
  139. }
  140. .ultimenu > li,
  141. .ultimenu .ultimenu__link {
  142. min-width: 100%;
  143. width: 100%;
  144. }
  145. .ultimenu--main {
  146. background: #222;
  147. display: none; /* We use jQuery to toggle this on smaller device */
  148. }
  149. /* Mobile needs a handler for click event. */
  150. .ultimenu--main .ultimenu__link {
  151. color: #fff;
  152. padding: 1em 1.75em;
  153. min-height: 42px;
  154. }
  155. .ultimenu--main .ultimenu__link:hover,
  156. .ultimenu--main .ultimenu__link:active {
  157. background: #000;
  158. }
  159. /* @todo is-active https://www.drupal.org/node/2281785 */
  160. .ultimenu--main .ultimenu__link.is-active {
  161. background: #111;
  162. }
  163. .has-ultimenu .caret {
  164. background-color: rgba(0,0,0, .2);
  165. display: block;
  166. height: 100%;
  167. min-height: 34px;
  168. position: absolute;
  169. right: 10px; /* LTR */
  170. top: 0;
  171. width: 42px;
  172. }
  173. [dir="rtl"] .has-ultimenu .caret {
  174. left: 10px;
  175. right: auto;
  176. }
  177. .has-ultimenu .caret::before {
  178. border: 8px solid transparent;
  179. border-top: 12px solid #fff;
  180. content: '';
  181. display: block;
  182. height: 0;
  183. margin-top: -6px;
  184. position: absolute;
  185. right: 10px; /* LTR */
  186. top: 50%;
  187. width: 0;
  188. z-index: 2;
  189. }
  190. .has-ultimenu .js-ultimenu-active .caret::before {
  191. border-bottom: 12px solid #fff;
  192. border-top: 0;
  193. }
  194. [dir="rtl"] .has-ultimenu .caret::before {
  195. left: 10px;
  196. right: auto;
  197. }
  198. .ultimenu__flyout,
  199. .ultimenu--vtl .ultimenu__flyout,
  200. .ultimenu--vtr .ultimenu__flyout,
  201. .ultimenu--htt .ultimenu__flyout {
  202. bottom: auto;
  203. height: auto;
  204. left: auto;
  205. margin: 0;
  206. right: auto;
  207. top: auto;
  208. width: 100%;
  209. }
  210. /* Button for main menu. */
  211. .button.button--ultimenu {
  212. cursor: pointer;
  213. display: block;
  214. }
  215. }
  216. /**
  217. * Larger medium ~ 944px
  218. */
  219. @media all and (min-width: 59em) {
  220. .ultimenu .ultimenu__link {
  221. line-height: 1.4;
  222. }
  223. /* Ultimenu flyout: Never display: none, bad for animation. */
  224. .ultimenu__flyout {
  225. border-radius: 5px;
  226. display: block !important; /* Intentional !important to avoid overrides */
  227. margin: 20px 0 0;
  228. /** Fixed for unwanted hover. Or target .ultimenu selector. */
  229. max-height: 0;
  230. overflow: hidden;
  231. opacity: 0;
  232. position: absolute;
  233. top: 100%;
  234. transition: visibility 0s linear 0.5s, opacity .5s linear, margin .5s ease, max-height .8s ease .2s;
  235. visibility: hidden;
  236. }
  237. .ultimenu > li {
  238. display: inline-block;
  239. margin: 0 -4px 0 0; /* LTR */
  240. }
  241. [dir="rtl"] .ultimenu > li {
  242. margin: 0 0 0 -4px;
  243. }
  244. .ultimenu--vertical > li {
  245. display: block;
  246. margin-right: 0;
  247. }
  248. [dir="rtl"] .ultimenu--vertical > li {
  249. margin-left: 0;
  250. }
  251. .ultimenu li:hover > .ultimenu__flyout,
  252. .ultimenu li a:focus + .ultimenu__flyout,
  253. .ultimenu li .ultimenu__flyout:focus-within {
  254. display: block;
  255. margin-top: 0;
  256. max-height: 100%;
  257. overflow: visible;
  258. opacity: 1;
  259. transition-delay: 0s;
  260. visibility: visible;
  261. }
  262. .ultimenu--vertical .ultimenu__flyout {
  263. margin-top: 0;
  264. }
  265. .ultimenu--vtl .ultimenu__flyout {
  266. margin-right: 20px; /* LTR */
  267. }
  268. [dir="rtl"] .ultimenu--vtl .ultimenu__flyout {
  269. margin-left: 20px;
  270. margin-right: auto;
  271. }
  272. .ultimenu--vtr .ultimenu__flyout {
  273. margin-left: 20px; /* LTR */
  274. }
  275. [dir="rtl"] .ultimenu--vtr .ultimenu__flyout {
  276. margin-left: auto;
  277. margin-right: 20px;
  278. }
  279. .ultimenu--vtl li:hover .ultimenu__flyout {
  280. margin-right: 10px; /* LTR */
  281. }
  282. [dir="rtl"] .ultimenu--vtl li:hover .ultimenu__flyout {
  283. margin-left: 10px;
  284. margin-right: auto;
  285. }
  286. .ultimenu--vtr li:hover .ultimenu__flyout {
  287. margin-left: 10px; /* LTR */
  288. }
  289. [dir="rtl"] .ultimenu--vtr li:hover .ultimenu__flyout {
  290. margin-left: auto;
  291. margin-right: 10px;
  292. }
  293. .ultimenu--htt li:hover .ultimenu__flyout {
  294. margin-bottom: 10px;
  295. }
  296. .ultimenu__link .caret {
  297. display: none;
  298. }
  299. .button.button--ultimenu {
  300. display: none;
  301. }
  302. #header .ultimenu__flyout,
  303. #footer .ultimenu__flyout {
  304. min-width: 600px;
  305. }
  306. .sidebar .ultimenu__flyout {
  307. min-width: 500px;
  308. }
  309. }
  310. /**
  311. * Basic skins.
  312. * Based on bartik if region navigation is replacing theme_links()
  313. */
  314. .ultimenu__flyout {
  315. color: #777;
  316. }
  317. /**
  318. * Ugly arrows to support special_menu_items module that stripped out A classes.
  319. * If you don't have special_menu_items, reference it by .ultimenu__link.
  320. */
  321. .ultimenu .ultimenu__link {
  322. display: block;
  323. padding: .5em 1.25em;
  324. position: relative; /* To hold arrows for small device */
  325. transition: background-color .5s, color .5s;
  326. text-decoration: none;
  327. }
  328. .ultimenu--vertical .ultimenu__link {
  329. padding: .5em 0;
  330. }
  331. /**
  332. * Menu description.
  333. */
  334. .ultimenu .ultimenu__link small {
  335. display: block;
  336. font-size: 70%;
  337. line-height: 1;
  338. }
  339. /**
  340. * Core bartik do not have clearfix for region, add support for floating blocks
  341. * with micro clearfix.
  342. */
  343. .ultimenu__flyout::after,
  344. .ultimenu .region::after {
  345. clear: both;
  346. content: " ";
  347. display: table;
  348. }