dropdown.less 6.6 KB

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