dropdown.less 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. /*
  2. * Component: Dropdown menus
  3. * -------------------------
  4. */
  5. /*Dropdowns in general*/
  6. .dropdown-menu {
  7. box-shadow: none;
  8. border-color: #eee;
  9. > li > a {
  10. color: #777;
  11. }
  12. > li > a > .glyphicon,
  13. > li > a > .fa,
  14. > li > a > .ion {
  15. margin-right: 10px;
  16. }
  17. > li > a:hover {
  18. background-color: lighten(@gray-lte, 5%);
  19. color: #333;
  20. }
  21. > .divider {
  22. background-color: #eee;
  23. }
  24. }
  25. //Navbar custom dropdown menu
  26. .navbar-nav > .notifications-menu,
  27. .navbar-nav > .messages-menu,
  28. .navbar-nav > .tasks-menu {
  29. //fix width and padding
  30. > .dropdown-menu {
  31. > li {
  32. position: relative;
  33. }
  34. width: 280px;
  35. //Remove padding and margins
  36. padding: 0 0 0 0;
  37. margin: 0;
  38. top: 100%;
  39. }
  40. //Define header class
  41. > .dropdown-menu > li.header {
  42. .border-radius(4px; 4px; 0; 0);
  43. background-color: #ffffff;
  44. padding: 7px 10px;
  45. border-bottom: 1px solid #f4f4f4;
  46. color: #444444;
  47. font-size: 14px;
  48. }
  49. //Define footer class
  50. > .dropdown-menu > li.footer > a {
  51. .border-radius(0; 0; 4px; 4px);
  52. font-size: 12px;
  53. background-color: #fff;
  54. padding: 7px 10px;
  55. border-bottom: 1px solid #eeeeee;
  56. color: #444 !important;
  57. @media (max-width: @screen-sm-max) {
  58. background: #fff !important;
  59. color: #444 !important;
  60. }
  61. text-align: center;
  62. //Hover state
  63. &:hover {
  64. text-decoration: none;
  65. font-weight: normal;
  66. }
  67. }
  68. //Clear inner menu padding and margins
  69. > .dropdown-menu > li .menu {
  70. max-height: 200px;
  71. margin: 0;
  72. padding: 0;
  73. list-style: none;
  74. overflow-x: hidden;
  75. > li > a {
  76. display: block;
  77. white-space: nowrap; /* Prevent text from breaking */
  78. border-bottom: 1px solid #f4f4f4;
  79. // Hove state
  80. &:hover {
  81. background: #f4f4f4;
  82. text-decoration: none;
  83. }
  84. }
  85. }
  86. }
  87. //Notifications menu
  88. .navbar-nav > .notifications-menu {
  89. > .dropdown-menu > li .menu {
  90. // Links inside the menu
  91. > li > a {
  92. color: #444444;
  93. overflow: hidden;
  94. text-overflow: ellipsis;
  95. padding: 10px;
  96. // Icons inside the menu
  97. > .glyphicon,
  98. > .fa,
  99. > .ion {
  100. width: 20px;
  101. }
  102. }
  103. }
  104. }
  105. //Messages menu
  106. .navbar-nav > .messages-menu {
  107. //Inner menu
  108. > .dropdown-menu > li .menu {
  109. // Messages menu item
  110. > li > a {
  111. margin: 0;
  112. //line-height: 20px;
  113. padding: 10px 10px;
  114. // User image
  115. > div > img {
  116. margin: auto 10px auto auto;
  117. width: 40px;
  118. height: 40px;
  119. }
  120. // Message heading
  121. > h4 {
  122. padding: 0;
  123. margin: 0 0 0 45px;
  124. color: #444444;
  125. font-size: 15px;
  126. position: relative;
  127. // Small for message time display
  128. > small {
  129. color: #999999;
  130. font-size: 10px;
  131. position: absolute;
  132. top: 0;
  133. right: 0;
  134. }
  135. }
  136. > p {
  137. margin: 0 0 0 45px;
  138. font-size: 12px;
  139. color: #888888;
  140. }
  141. .clearfix();
  142. }
  143. }
  144. }
  145. //Tasks menu
  146. .navbar-nav > .tasks-menu {
  147. > .dropdown-menu > li .menu {
  148. > li > a {
  149. padding: 10px;
  150. > h3 {
  151. font-size: 14px;
  152. padding: 0;
  153. margin: 0 0 10px 0;
  154. color: #666666;
  155. }
  156. > .progress {
  157. padding: 0;
  158. margin: 0;
  159. }
  160. }
  161. }
  162. }
  163. //User menu
  164. .navbar-nav > .user-menu {
  165. > .dropdown-menu {
  166. .border-top-radius(0);
  167. padding: 1px 0 0 0;
  168. border-top-width: 0;
  169. width: 280px;
  170. &,
  171. > .user-body {
  172. .border-bottom-radius(4px);
  173. }
  174. // Header menu
  175. > li.user-header {
  176. height: 175px;
  177. padding: 10px;
  178. text-align: center;
  179. // User image
  180. > img {
  181. z-index: 5;
  182. height: 90px;
  183. width: 90px;
  184. border: 3px solid;
  185. border-color: transparent;
  186. border-color: rgba(255, 255, 255, 0.2);
  187. }
  188. > p {
  189. z-index: 5;
  190. color: #fff;
  191. color: rgba(255, 255, 255, 0.8);
  192. font-size: 17px;
  193. //text-shadow: 2px 2px 3px #333333;
  194. margin-top: 10px;
  195. > small {
  196. display: block;
  197. font-size: 12px;
  198. }
  199. }
  200. }
  201. // Menu Body
  202. > .user-body {
  203. padding: 15px;
  204. border-bottom: 1px solid #f4f4f4;
  205. border-top: 1px solid #dddddd;
  206. .clearfix();
  207. a {
  208. color: #444 !important;
  209. @media (max-width: @screen-sm-max) {
  210. background: #fff !important;
  211. color: #444 !important;
  212. }
  213. }
  214. }
  215. // Menu Footer
  216. > .user-footer {
  217. background-color: #f9f9f9;
  218. padding: 10px;
  219. .clearfix();
  220. .btn-default {
  221. color: #666666;
  222. &:hover {
  223. @media (max-width: @screen-sm-max) {
  224. background-color: #f9f9f9;
  225. }
  226. }
  227. }
  228. }
  229. }
  230. .user-image {
  231. float: left;
  232. width: 25px;
  233. height: 25px;
  234. border-radius: 50%;
  235. margin-right: 10px;
  236. margin-top: -2px;
  237. @media (max-width: @screen-xs-max) {
  238. float: none;
  239. margin-right: 0;
  240. margin-top: -8px;
  241. line-height: 10px;
  242. }
  243. }
  244. }
  245. /* Add fade animation to dropdown menus by appending
  246. the class .animated-dropdown-menu to the .dropdown-menu ul (or ol)*/
  247. .open:not(.dropup) > .animated-dropdown-menu {
  248. backface-visibility: visible !important;
  249. .animation(flipInX .7s both);
  250. }
  251. @keyframes flipInX {
  252. 0% {
  253. transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
  254. transition-timing-function: ease-in;
  255. opacity: 0;
  256. }
  257. 40% {
  258. transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
  259. transition-timing-function: ease-in;
  260. }
  261. 60% {
  262. transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
  263. opacity: 1;
  264. }
  265. 80% {
  266. transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  267. }
  268. 100% {
  269. transform: perspective(400px);
  270. }
  271. }
  272. @-webkit-keyframes flipInX {
  273. 0% {
  274. -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
  275. -webkit-transition-timing-function: ease-in;
  276. opacity: 0;
  277. }
  278. 40% {
  279. -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
  280. -webkit-transition-timing-function: ease-in;
  281. }
  282. 60% {
  283. -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
  284. opacity: 1;
  285. }
  286. 80% {
  287. -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  288. }
  289. 100% {
  290. -webkit-transform: perspective(400px);
  291. }
  292. }
  293. /* Fix dropdown menu in navbars */
  294. .navbar-custom-menu > .navbar-nav {
  295. > li {
  296. position: relative;
  297. > .dropdown-menu {
  298. position: absolute;
  299. right: 0;
  300. left: auto;
  301. }
  302. }
  303. }
  304. @media (max-width: @screen-sm-max) {
  305. .navbar-custom-menu > .navbar-nav {
  306. float: right;
  307. > li {
  308. position: static;
  309. > .dropdown-menu {
  310. position: absolute;
  311. right: 5%;
  312. left: auto;
  313. border: 1px solid #ddd;
  314. background: #fff;
  315. }
  316. }
  317. }
  318. }