dropdown.less 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. /*
  2. Dropdown menus
  3. ----------------------------
  4. */
  5. /*Dropdowns in general*/
  6. .dropdown-menu {
  7. -webkit-box-shadow: 0px 3px 6px rgba(0,0,0,0.1);
  8. -moz-box-shadow: 0px 3px 6px rgba(0,0,0,0.1);
  9. box-shadow: 0px 3px 6px rgba(0,0,0,0.1);
  10. z-index: 2300;
  11. > li > a > .glyphicon,
  12. > li > a > .fa,
  13. > li > a > .ion{
  14. margin-right: 10px;
  15. }
  16. > li > a:hover {
  17. background-color: @light-blue;
  18. color: #f9f9f9;
  19. }
  20. }
  21. /*Drodown in navbars*/
  22. .skin-blue .navbar {
  23. .dropdown-menu > li > a{
  24. color: #444444;
  25. }
  26. }
  27. /*
  28. Navbar custom dropdown menu
  29. ------------------------------------
  30. */
  31. .navbar-nav > .notifications-menu,
  32. .navbar-nav > .messages-menu,
  33. .navbar-nav > .tasks-menu {
  34. //fix width and padding
  35. > .dropdown-menu {
  36. width: 280px;
  37. //Remove padding and margins
  38. padding: 0 0 0 0!important;
  39. margin: 0!important;
  40. top: 100%;
  41. border: 1px solid #dfdfdf;
  42. .border-radius(4px)!important;
  43. }
  44. //Define header class
  45. > .dropdown-menu > li.header {
  46. .border-radius(4px; 4px; 0; 0);
  47. background-color: #ffffff;
  48. padding: 7px 10px;
  49. border-bottom: 1px solid #f4f4f4;
  50. color: #444444;
  51. font-size: 14px;
  52. &:after {
  53. // Add arrow to the top (you can change the width using border-width)
  54. bottom: 100%;
  55. left: 92%;
  56. border: solid transparent;
  57. content: " ";
  58. height: 0;
  59. width: 0;
  60. position: absolute;
  61. pointer-events: none;
  62. border-color: rgba(255, 255, 255, 0);
  63. border-bottom-color: #ffffff;
  64. border-width: 7px;
  65. margin-left: -7px;
  66. }
  67. }
  68. //Define footer class
  69. > .dropdown-menu > li.footer > a {
  70. .border-radius(0px; 0px; 4px; 4px);
  71. font-size: 12px;
  72. background-color: #f4f4f4;
  73. padding: 7px 10px;
  74. border-bottom: 1px solid #eeeeee;
  75. color: #444444;
  76. text-align: center;
  77. //Hover state
  78. &:hover {
  79. background: #f4f4f4;
  80. text-decoration: none;
  81. font-weight: normal;
  82. }
  83. }
  84. //Clear inner menu padding and margins
  85. > .dropdown-menu > li .menu {
  86. > li > a {
  87. display: block;
  88. white-space: nowrap; /* Prevent text from breaking */
  89. border-bottom: 1px solid #f4f4f4;
  90. // Hove state
  91. &:hover {
  92. background: #f6f6f6;
  93. text-decoration: none;
  94. }
  95. }
  96. margin: 0;
  97. padding: 0;
  98. list-style: none;
  99. overflow-x: hidden;
  100. }
  101. }
  102. //Notifications menu
  103. .navbar-nav > .notifications-menu {
  104. > .dropdown-menu > li .menu {
  105. // Links inside the menu
  106. > li > a {
  107. font-size: 12px;
  108. color: #444444;
  109. // Icons inside the menu
  110. > .glyphicon,
  111. > .fa,
  112. > .ion {
  113. font-size: 20px;
  114. width: 50px;
  115. text-align: center;
  116. padding: 15px 0px;
  117. margin-right: 5px;
  118. /* Default background and font colors */
  119. background: @aqua;
  120. color: #f9f9f9; /* Fallback for browsers that doesn't support rgba */
  121. color: rgba(255, 255, 255, 0.7);
  122. // Icon background variations
  123. &.danger {
  124. background: @red;
  125. }
  126. &.warning {
  127. background: @yellow;
  128. }
  129. &.success {
  130. background: @green;
  131. }
  132. &.info {
  133. background: @aqua;
  134. }
  135. }
  136. }
  137. }
  138. }
  139. //Messages menu
  140. .navbar-nav > .messages-menu {
  141. //Inner menu
  142. > .dropdown-menu > li .menu {
  143. // Messages menu item
  144. > li > a {
  145. margin: 0px;
  146. line-height: 20px;
  147. padding: 10px 5px 10px 5px;
  148. .border-radius(4px);
  149. // User image
  150. > div > img {
  151. margin: auto 10px auto auto;
  152. width: 40px;
  153. height: 40px;
  154. border: 1px solid #dddddd;
  155. }
  156. // Message heading
  157. > h4 {
  158. padding: 0;
  159. margin: 0 0 0 45px;
  160. color: #444444;
  161. font-size: 15px;
  162. // Small for message time display
  163. > small {
  164. color: #999999;
  165. font-size: 10px;
  166. float: right;
  167. }
  168. }
  169. > p {
  170. margin: 0 0 0 45px;
  171. font-size: 12px;
  172. color: #888888;
  173. }
  174. .clearfix();
  175. }
  176. }
  177. }
  178. //Tasks menu
  179. .navbar-nav > .tasks-menu {
  180. > .dropdown-menu > li .menu {
  181. > li > a {
  182. padding: 10px;
  183. > h3 {
  184. font-size: 14px;
  185. padding: 0;
  186. margin: 0 0 10px 0;
  187. color: #666666;
  188. }
  189. > .progress {
  190. padding: 0;
  191. margin: 0;
  192. }
  193. }
  194. }
  195. }
  196. //User menu
  197. .navbar-nav > .user-menu {
  198. > .dropdown-menu {
  199. .border-radius(0);
  200. padding: 1px 0 0 0;
  201. border-top-width: 0;
  202. width: 280px;
  203. // Add arrow to the top (you can change the width by changing the border-width)
  204. &:after {
  205. bottom: 100%;
  206. right: 10px;
  207. border: solid transparent;
  208. content: " ";
  209. height: 0;
  210. width: 0;
  211. position: absolute;
  212. pointer-events: none;
  213. border-color: rgba(255, 255, 255, 0);
  214. border-bottom-color: #ffffff;
  215. border-width: 10px;
  216. margin-left: -10px;
  217. }
  218. // Header menu
  219. > li.user-header {
  220. height: 175px;
  221. padding: 10px;
  222. // Default background color. You can add any .bg-* class to
  223. // the li element to change the background
  224. background: @light-blue;
  225. text-align: center;
  226. // User image
  227. > img {
  228. z-index: 5;
  229. height: 90px;
  230. width: 90px;
  231. border: 8px solid;
  232. border-color: transparent;
  233. border-color: rgba(255, 255, 255, 0.2);
  234. }
  235. > p {
  236. z-index: 5;
  237. color: #f9f9f9;
  238. color: rgba(255, 255, 255, 0.8);
  239. font-size: 17px;
  240. text-shadow: 2px 2px 3px #333333;
  241. margin-top: 10px;
  242. > small {
  243. display: block;
  244. font-size: 12px;
  245. }
  246. }
  247. }
  248. // Menu Body
  249. > li.user-body {
  250. padding: 15px;
  251. border-bottom: 1px solid #f4f4f4;
  252. border-top: 1px solid #dddddd;
  253. .clearfix();
  254. > div > a {
  255. color: @blue;
  256. }
  257. }
  258. // Menu Footer
  259. > li.user-footer {
  260. background-color: @body-bg;
  261. padding: 10px;
  262. .clearfix();
  263. .btn-default {
  264. color: #666666;
  265. }
  266. }
  267. }
  268. }
  269. /* Add fade animation to dropdown menus */
  270. .open > .dropdown-menu {
  271. animation-name: fadeAnimation;
  272. animation-duration:.7s;
  273. animation-iteration-count: 1;
  274. animation-timing-function: ease;
  275. animation-fill-mode: forwards;
  276. -webkit-animation-name: fadeAnimation;
  277. -webkit-animation-duration:.7s;
  278. -webkit-animation-iteration-count: 1;
  279. -webkit-animation-timing-function: ease;
  280. -webkit-animation-fill-mode: forwards;
  281. -moz-animation-name: fadeAnimation;
  282. -moz-animation-duration:.7s;
  283. -moz-animation-iteration-count: 1;
  284. -moz-animation-timing-function: ease;
  285. -moz-animation-fill-mode: forwards;
  286. }
  287. @keyframes fadeAnimation {
  288. from {
  289. opacity: 0;
  290. top: 120%;
  291. }
  292. to {
  293. opacity: 1;
  294. top: 100%
  295. }
  296. }
  297. @-webkit-keyframes fadeAnimation {
  298. from {
  299. opacity: 0;
  300. top: 120%;
  301. }
  302. to {
  303. opacity: 1;
  304. top: 100%;
  305. }
  306. }
  307. /* Fix dropdown menu for small screens to display correctly on small screens */
  308. @media screen and (max-width: @screen-sm) {
  309. .navbar-nav {
  310. > .notifications-menu,
  311. > .user-menu,
  312. > .tasks-menu,
  313. > .messages-menu {
  314. > .dropdown-menu {
  315. position: absolute;
  316. top: 100%;
  317. right: 0;
  318. left: auto;
  319. border-right: 1px solid #dddddd;
  320. border-bottom: 1px solid #dddddd;
  321. border-left: 1px solid #dddddd;
  322. background: #ffffff;
  323. }
  324. }
  325. }
  326. }
  327. /* Fix menu positions on xs screens to appear correctly and fully */
  328. @media screen and (max-width: @screen-xs) {
  329. .navbar-nav {
  330. > .notifications-menu,
  331. > .tasks-menu,
  332. > .messages-menu {
  333. > .dropdown-menu > li.header {
  334. /* Remove arrow from the top */
  335. &:after {
  336. border-width: 0px!important;
  337. }
  338. }
  339. }
  340. }
  341. .navbar-nav {
  342. > .tasks-menu {
  343. > .dropdown-menu {
  344. position: absolute;
  345. right: -120px;
  346. left: auto;
  347. }
  348. }
  349. > .notifications-menu {
  350. > .dropdown-menu {
  351. position: absolute;
  352. right: -170px;
  353. left: auto;
  354. }
  355. }
  356. > .messages-menu {
  357. > .dropdown-menu {
  358. position: absolute;
  359. right: -210px;
  360. left: auto;
  361. }
  362. }
  363. }
  364. }