_main-sidebar.scss 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. /**
  2. * Component: Main Sidebar
  3. * -----------------------
  4. */
  5. .main-sidebar {
  6. height: 100vh;
  7. overflow-y: hidden;
  8. z-index: $zindex-main-sidebar;
  9. }
  10. .sidebar {
  11. height: calc(100% - 4rem);
  12. overflow-y: auto;
  13. padding-bottom: $sidebar-padding-y;
  14. padding-left: $sidebar-padding-x;
  15. padding-right: $sidebar-padding-x;
  16. padding-top: $sidebar-padding-y;
  17. }
  18. // Sidebar user panel
  19. .user-panel {
  20. position: relative;
  21. [class*='sidebar-dark'] & {
  22. border-bottom: 1px solid lighten($dark, 12%);
  23. }
  24. [class*='sidebar-light'] & {
  25. border-bottom: 1px solid $gray-300;
  26. }
  27. &,
  28. .info {
  29. overflow: hidden;
  30. white-space: nowrap;
  31. }
  32. .image {
  33. display: inline-block;
  34. padding-left: $nav-link-padding-x - .2;
  35. }
  36. img {
  37. height: auto;
  38. width: $sidebar-user-image-width;
  39. }
  40. .info {
  41. display: inline-block;
  42. padding: 5px 5px 5px 10px;
  43. }
  44. .status,
  45. .dropdown-menu {
  46. font-size: $font-size-sm;
  47. }
  48. }
  49. // Sidebar navigation menu
  50. .nav-sidebar {
  51. // All levels
  52. .nav-item {
  53. > .nav-link {
  54. margin-bottom: 0.2rem;
  55. .right {
  56. @include transition(transform $transition-fn $transition-speed);
  57. }
  58. }
  59. }
  60. .nav-link > p > .right {
  61. position: absolute;
  62. right: 1rem;
  63. top: 12px;
  64. &:nth-child(2) {
  65. right: 2.5rem;
  66. }
  67. }
  68. .menu-open {
  69. > .nav-treeview {
  70. display: block;
  71. }
  72. > .nav-link {
  73. i.right {
  74. @include rotate(-90deg);
  75. }
  76. }
  77. }
  78. // First Level
  79. > .nav-item {
  80. margin-bottom: 0;
  81. .nav-icon {
  82. font-size: 1.2rem;
  83. margin-right: .2rem;
  84. text-align: center;
  85. width: $sidebar-nav-icon-width;
  86. &.fa,
  87. &.fas,
  88. &.far,
  89. &.fab,
  90. &.glyphicon,
  91. &.ion {
  92. font-size: 1.1rem;
  93. }
  94. }
  95. .float-right {
  96. margin-top: 3px;
  97. }
  98. }
  99. // Tree view menu
  100. .nav-treeview {
  101. display: none;
  102. list-style: none;
  103. padding: 0;
  104. > .nav-item {
  105. > .nav-link {
  106. > .nav-icon {
  107. width: $sidebar-nav-icon-width;
  108. }
  109. }
  110. }
  111. }
  112. &.nav-child-indent {
  113. .nav-treeview {
  114. padding-left: 1rem;
  115. }
  116. }
  117. .nav-header {
  118. font-size: .9rem;
  119. padding: $nav-link-padding-y;
  120. &:not(:first-of-type) {
  121. padding: 1.7rem 1rem .5rem 1rem;
  122. }
  123. }
  124. .nav-link p {
  125. display: inline-block;
  126. margin: 0;
  127. }
  128. }
  129. #sidebar-overlay {
  130. @include media-breakpoint-down(md) {
  131. .sidebar-open & {
  132. display: block;
  133. }
  134. }
  135. background-color: rgba($black, 0.1);
  136. bottom: 0;
  137. display: none;
  138. left: 0;
  139. position: fixed;
  140. right: 0;
  141. top: 0;
  142. z-index: $zindex-main-sidebar - 1;
  143. }
  144. .sidebar-mini-md {
  145. &.sidebar-open {
  146. #sidebar-overlay {
  147. @include media-breakpoint-up(sm) {
  148. display: none;
  149. }
  150. @include media-breakpoint-down(sm) {
  151. display: block;
  152. }
  153. }
  154. }
  155. }
  156. [class*='sidebar-light-'] {
  157. // Sidebar background color
  158. background-color: $sidebar-light-bg;
  159. // User Panel (resides in the sidebar)
  160. .user-panel {
  161. a:hover {
  162. color: $sidebar-light-hover-color;
  163. }
  164. .status {
  165. background: $sidebar-light-hover-bg;
  166. color: $sidebar-light-color;
  167. &:hover,
  168. &:focus,
  169. &:active {
  170. background: darken($sidebar-light-hover-bg, 3%);
  171. color: $sidebar-light-hover-color;
  172. }
  173. }
  174. .dropdown-menu {
  175. @include box-shadow(0 2px 4px rgba(0, 0, 0, .4));
  176. border-color: darken($sidebar-light-hover-bg, 5%);
  177. }
  178. .dropdown-item {
  179. color: $body-color;
  180. }
  181. }
  182. // Sidebar Menu. First level links
  183. .nav-sidebar > .nav-item {
  184. // links
  185. > .nav-link {
  186. // border-left: 3px solid transparent;
  187. &:active,
  188. &:focus {
  189. color: $sidebar-light-color;
  190. }
  191. }
  192. // Hover and active states
  193. &.menu-open > .nav-link,
  194. &:hover > .nav-link {
  195. background-color: $sidebar-light-hover-bg;
  196. color: $sidebar-light-hover-color;
  197. }
  198. > .nav-link.active {
  199. color: $sidebar-light-active-color;
  200. @if $enable-shadows {
  201. @extend .elevation-1;
  202. }
  203. }
  204. // First Level Submenu
  205. > .nav-treeview {
  206. background: $sidebar-light-submenu-bg;
  207. }
  208. }
  209. // Section Heading
  210. .nav-header {
  211. background: inherit;
  212. color: darken($sidebar-light-color, 5%);
  213. }
  214. // All links within the sidebar menu
  215. .sidebar {
  216. a {
  217. color: $sidebar-light-color;
  218. &:hover {
  219. text-decoration: none;
  220. }
  221. }
  222. }
  223. // All submenus
  224. .nav-treeview {
  225. > .nav-item {
  226. > .nav-link {
  227. color: $sidebar-light-submenu-color;
  228. }
  229. > .nav-link.active {
  230. &,
  231. &:hover {
  232. background-color: $sidebar-light-submenu-active-bg;
  233. color: $sidebar-light-submenu-active-color;
  234. }
  235. }
  236. > .nav-link:hover {
  237. background-color: $sidebar-light-submenu-hover-bg;
  238. }
  239. }
  240. }
  241. }
  242. [class*='sidebar-dark-'] {
  243. // Sidebar background color
  244. background-color: $sidebar-dark-bg;
  245. // User Panel (resides in the sidebar)
  246. .user-panel {
  247. a:hover {
  248. color: $sidebar-dark-hover-color;
  249. }
  250. .status {
  251. background: $sidebar-dark-hover-bg;
  252. color: $sidebar-dark-color;
  253. &:hover,
  254. &:focus,
  255. &:active {
  256. background: darken($sidebar-dark-hover-bg, 3%);
  257. color: $sidebar-dark-hover-color;
  258. }
  259. }
  260. .dropdown-menu {
  261. @include box-shadow(0 2px 4px rgba(0, 0, 0, .4));
  262. border-color: darken($sidebar-dark-hover-bg, 5%);
  263. }
  264. .dropdown-item {
  265. color: $body-color;
  266. }
  267. }
  268. // Sidebar Menu. First level links
  269. .nav-sidebar > .nav-item {
  270. // links
  271. > .nav-link {
  272. // border-left: 3px solid transparent;
  273. &:active {
  274. color: $sidebar-dark-color;
  275. }
  276. }
  277. // Hover and active states
  278. &.menu-open > .nav-link,
  279. &:hover > .nav-link,
  280. & > .nav-link:focus {
  281. background-color: $sidebar-dark-hover-bg;
  282. color: $sidebar-dark-hover-color;
  283. }
  284. > .nav-link.active {
  285. color: $sidebar-dark-hover-color;
  286. @if $enable-shadows {
  287. @extend .elevation-1;
  288. }
  289. }
  290. // First Level Submenu
  291. > .nav-treeview {
  292. background: $sidebar-dark-submenu-bg;
  293. }
  294. }
  295. // Section Heading
  296. .nav-header {
  297. background: inherit; //darken($sidebar-dark-bg, 3%);
  298. color: lighten($sidebar-dark-color, 5%);
  299. }
  300. // All links within the sidebar menu
  301. .sidebar {
  302. a {
  303. color: $sidebar-dark-color;
  304. &:hover,
  305. &:focus {
  306. text-decoration: none;
  307. }
  308. }
  309. }
  310. // All submenus
  311. .nav-treeview {
  312. > .nav-item {
  313. > .nav-link {
  314. color: $sidebar-dark-submenu-color;
  315. &:hover,
  316. &:focus {
  317. background-color: $sidebar-dark-submenu-hover-bg;
  318. color: $sidebar-dark-submenu-hover-color;
  319. }
  320. }
  321. > .nav-link.active {
  322. &,
  323. &:hover,
  324. &:focus {
  325. background-color: $sidebar-dark-submenu-active-bg;
  326. color: $sidebar-dark-submenu-active-color;
  327. }
  328. }
  329. }
  330. }
  331. }
  332. // Sidebar variants
  333. @each $name, $color in $theme-colors {
  334. .sidebar-dark-#{$name},
  335. .sidebar-light-#{$name} {
  336. @include sidebar-color($color)
  337. }
  338. }
  339. @each $name, $color in $colors {
  340. .sidebar-dark-#{$name},
  341. .sidebar-light-#{$name} {
  342. @include sidebar-color($color)
  343. }
  344. }