_sidebar.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. // Sidebar
  2. .sidebar {
  3. width: $sidebar-collapsed-width;
  4. min-height: 100vh;
  5. .nav-item {
  6. position: relative;
  7. &:last-child {
  8. margin-bottom: 1rem;
  9. }
  10. .nav-link {
  11. text-align: center;
  12. padding: 0.75rem 1rem;
  13. width: $sidebar-collapsed-width;
  14. span {
  15. font-size: 0.65rem;
  16. display: block;
  17. }
  18. }
  19. &.active {
  20. .nav-link {
  21. font-weight: 700;
  22. }
  23. }
  24. // Accordion
  25. .collapse {
  26. position: absolute;
  27. left: calc(#{$sidebar-collapsed-width} + #{$grid-gutter-width} / 2);
  28. z-index: 1;
  29. top: 2px;
  30. // Grow In Animation
  31. @extend .animated--grow-in;
  32. .collapse-inner {
  33. border-radius: $border-radius;
  34. box-shadow: $box-shadow;
  35. }
  36. }
  37. .collapsing {
  38. display: none;
  39. transition: none;
  40. }
  41. .collapse,
  42. .collapsing {
  43. .collapse-inner {
  44. padding: .5rem 0;
  45. min-width: 10rem;
  46. font-size: $dropdown-font-size;
  47. margin: 0 0 1rem 0;
  48. .collapse-header {
  49. margin: 0;
  50. white-space: nowrap;
  51. padding: .5rem 1.5rem;
  52. text-transform: uppercase;
  53. font-weight: 800;
  54. font-size: 0.65rem;
  55. color: $gray-500;
  56. }
  57. .collapse-item {
  58. padding: 0.5rem 1rem;
  59. margin: 0 0.5rem;
  60. display: block;
  61. color: $gray-900;
  62. text-decoration: none;
  63. border-radius: $border-radius;
  64. white-space: nowrap;
  65. &:hover {
  66. background-color: $gray-200;
  67. }
  68. &:active {
  69. background-color: $gray-300;
  70. }
  71. &.active {
  72. color: $primary;
  73. font-weight: 700;
  74. }
  75. }
  76. }
  77. }
  78. }
  79. #sidebarToggle {
  80. width: 2.5rem;
  81. height: 2.5rem;
  82. text-align: center;
  83. margin-bottom: 1rem;
  84. cursor: pointer;
  85. &::after {
  86. font-weight: 900;
  87. content: '\f104';
  88. font-family: 'Font Awesome 5 Free';
  89. margin-right: 0.1rem;
  90. }
  91. &:hover {
  92. text-decoration: none;
  93. }
  94. &:focus {
  95. outline: none;
  96. }
  97. }
  98. &.toggled {
  99. width: 0 !important;
  100. overflow: hidden;
  101. #sidebarToggle::after {
  102. content: '\f105';
  103. font-family: 'Font Awesome 5 Free';
  104. margin-left: 0.25rem;
  105. }
  106. .sidebar-card {
  107. display: none;
  108. }
  109. }
  110. .sidebar-brand {
  111. height: $topbar-base-height;
  112. text-decoration: none;
  113. font-size: 1rem;
  114. font-weight: 800;
  115. padding: 1.5rem 1rem;
  116. text-align: center;
  117. text-transform: uppercase;
  118. letter-spacing: 0.05rem;
  119. z-index: 1;
  120. .sidebar-brand-icon i {
  121. font-size: 2rem;
  122. }
  123. .sidebar-brand-text {
  124. display: none;
  125. }
  126. }
  127. hr.sidebar-divider {
  128. margin: 0 1rem 1rem;
  129. }
  130. .sidebar-heading {
  131. text-align: center;
  132. padding: 0 1rem;
  133. font-weight: 800;
  134. font-size: 0.65rem;
  135. @extend .text-uppercase;
  136. }
  137. .sidebar-card {
  138. display: flex;
  139. flex-direction: column;
  140. align-items: center;
  141. font-size: $font-size-sm;
  142. border-radius: $border-radius;
  143. color: fade-out($white, 0.2);
  144. margin-left: 1rem;
  145. margin-right: 1rem;
  146. margin-bottom: 1rem;
  147. padding: 1rem;
  148. background-color: fade-out($black, 0.9);
  149. .sidebar-card-illustration {
  150. height: 3rem;
  151. display: block;
  152. }
  153. .sidebar-card-title {
  154. font-weight: bold;
  155. }
  156. p {
  157. font-size: 0.75rem;
  158. color: fade-out($white, 0.5);
  159. }
  160. }
  161. }
  162. @include media-breakpoint-up(md) {
  163. .sidebar {
  164. width: $sidebar-base-width !important;
  165. .nav-item {
  166. // Accordion
  167. .collapse {
  168. position: relative;
  169. left: 0;
  170. z-index: 1;
  171. top: 0;
  172. animation: none;
  173. .collapse-inner {
  174. border-radius: 0;
  175. box-shadow: none;
  176. }
  177. }
  178. .collapsing {
  179. display: block;
  180. transition: $transition-collapse;
  181. }
  182. .collapse,
  183. .collapsing {
  184. margin: 0 1rem;
  185. }
  186. .nav-link {
  187. display: block;
  188. width: 100%;
  189. text-align: left;
  190. padding: 1rem;
  191. width: $sidebar-base-width;
  192. i {
  193. font-size: 0.85rem;
  194. margin-right: 0.25rem;
  195. }
  196. span {
  197. font-size: 0.85rem;
  198. display: inline;
  199. }
  200. // Accordion Arrow Icon
  201. &[data-toggle="collapse"] {
  202. &::after {
  203. width: 1rem;
  204. text-align: center;
  205. float: right;
  206. vertical-align: 0;
  207. border: 0;
  208. font-weight: 900;
  209. content: '\f107';
  210. font-family: 'Font Awesome 5 Free';
  211. }
  212. &.collapsed::after {
  213. content: '\f105';
  214. }
  215. }
  216. }
  217. }
  218. .sidebar-brand {
  219. .sidebar-brand-icon i {
  220. font-size: 2rem;
  221. }
  222. .sidebar-brand-text {
  223. display: inline;
  224. }
  225. }
  226. .sidebar-heading {
  227. text-align: left;
  228. }
  229. &.toggled {
  230. overflow: visible;
  231. width: $sidebar-collapsed-width !important;
  232. .nav-item {
  233. // Accordion
  234. .collapse {
  235. position: absolute;
  236. left: calc(#{$sidebar-collapsed-width} + #{$grid-gutter-width} / 2);
  237. z-index: 1;
  238. top: 2px;
  239. // Grow In Animation for Toggled State
  240. animation-name: growIn;
  241. animation-duration: 200ms;
  242. animation-timing-function: transform cubic-bezier(.18, 1.25, .4, 1), opacity cubic-bezier(0, 1, .4, 1);
  243. .collapse-inner {
  244. box-shadow: $box-shadow;
  245. border-radius: $border-radius;
  246. }
  247. }
  248. .collapsing {
  249. display: none;
  250. transition: none;
  251. }
  252. .collapse,
  253. .collapsing {
  254. margin: 0;
  255. }
  256. &:last-child {
  257. margin-bottom: 1rem;
  258. }
  259. .nav-link {
  260. text-align: center;
  261. padding: 0.75rem 1rem;
  262. width: $sidebar-collapsed-width;
  263. span {
  264. font-size: 0.65rem;
  265. display: block;
  266. }
  267. i {
  268. margin-right: 0;
  269. }
  270. &[data-toggle="collapse"]::after {
  271. display: none;
  272. }
  273. }
  274. }
  275. .sidebar-brand {
  276. .sidebar-brand-icon i {
  277. font-size: 2rem;
  278. }
  279. .sidebar-brand-text {
  280. display: none;
  281. }
  282. }
  283. .sidebar-heading {
  284. text-align: center;
  285. }
  286. }
  287. }
  288. }
  289. // Sidebar Color Variants
  290. // Sidebar Light
  291. .sidebar-light {
  292. .sidebar-brand {
  293. color: $gray-700;
  294. }
  295. hr.sidebar-divider {
  296. border-top: 1px solid $gray-200;
  297. }
  298. .sidebar-heading {
  299. color: $gray-500;
  300. }
  301. .nav-item {
  302. .nav-link {
  303. color: $gray-600;
  304. i {
  305. color: $gray-400;
  306. }
  307. &:active,
  308. &:focus,
  309. &:hover {
  310. color: $gray-700;
  311. i {
  312. color: $gray-700;
  313. }
  314. }
  315. // Accordion
  316. &[data-toggle="collapse"]::after {
  317. color: $gray-500;
  318. }
  319. }
  320. &.active {
  321. .nav-link {
  322. color: $gray-700;
  323. i {
  324. color: $gray-700;
  325. }
  326. }
  327. }
  328. }
  329. // Color the sidebar toggler
  330. #sidebarToggle {
  331. background-color: $gray-200;
  332. &::after {
  333. color: $gray-500;
  334. }
  335. &:hover {
  336. background-color: $gray-300;
  337. }
  338. }
  339. }
  340. // Sidebar Dark
  341. .sidebar-dark {
  342. .sidebar-brand {
  343. color: $white;
  344. }
  345. hr.sidebar-divider {
  346. border-top: 1px solid fade-out($white, 0.85);
  347. }
  348. .sidebar-heading {
  349. color: fade-out($white, 0.6);
  350. }
  351. .nav-item {
  352. .nav-link {
  353. color: fade-out($white, 0.2);
  354. i {
  355. color: fade-out($white, 0.7);
  356. }
  357. &:active,
  358. &:focus,
  359. &:hover {
  360. color: $white;
  361. i {
  362. color: $white;
  363. }
  364. }
  365. // Accordion
  366. &[data-toggle="collapse"]::after {
  367. color: fade-out($white, 0.5);
  368. }
  369. }
  370. &.active {
  371. .nav-link {
  372. color: $white;
  373. i {
  374. color: $white;
  375. }
  376. }
  377. }
  378. }
  379. // Color the sidebar toggler
  380. #sidebarToggle {
  381. background-color: fade-out($white, 0.8);
  382. &::after {
  383. color: fade-out($white, 0.5);
  384. }
  385. &:hover {
  386. background-color: fade-out($white, 0.75);
  387. }
  388. }
  389. &.toggled {
  390. #sidebarToggle::after {
  391. color: fade-out($white, 0.5);
  392. }
  393. }
  394. }