dropdown.less 7.1 KB

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