dropdown.less 9.9 KB

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