_main-sidebar.scss 7.1 KB

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