_main-sidebar.scss 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212
  1. //
  2. // Component: Main Sidebar
  3. //
  4. .main-sidebar {
  5. height: 100vh;
  6. overflow-y: hidden;
  7. z-index: $zindex-main-sidebar;
  8. // Remove Firefox Focusring
  9. a {
  10. &:-moz-focusring {
  11. border: 0;
  12. outline: none;
  13. }
  14. }
  15. }
  16. .sidebar {
  17. height: calc(100% - (#{$main-header-height-inner} + #{$main-header-bottom-border-width}));
  18. overflow-x: hidden;
  19. overflow-y: initial;
  20. padding-bottom: $sidebar-padding-y;
  21. padding-left: $sidebar-padding-x;
  22. padding-right: $sidebar-padding-x;
  23. padding-top: $sidebar-padding-y;
  24. @include scrollbar-color-gray();
  25. @include scrollbar-width-none();
  26. &:hover {
  27. @include scrollbar-width-thin();
  28. }
  29. .brand-link.border-bottom-0 ~ & {
  30. height: calc(100% - #{$main-header-height-inner});
  31. }
  32. }
  33. // Sidebar user panel
  34. .user-panel {
  35. position: relative;
  36. [class*="sidebar-dark"] & {
  37. border-bottom: 1px solid lighten($dark, 12%);
  38. }
  39. [class*="sidebar-light"] & {
  40. border-bottom: 1px solid $gray-300;
  41. }
  42. &,
  43. .info {
  44. overflow: hidden;
  45. white-space: nowrap;
  46. }
  47. .image {
  48. display: inline-block;
  49. padding-left: $nav-link-padding-x - .2;
  50. }
  51. img {
  52. height: auto;
  53. width: $sidebar-user-image-width;
  54. }
  55. .info {
  56. display: inline-block;
  57. padding: 5px 5px 5px 10px;
  58. }
  59. .status,
  60. .dropdown-menu {
  61. font-size: $font-size-sm;
  62. }
  63. }
  64. // Sidebar navigation menu
  65. .nav-sidebar {
  66. // All levels
  67. .nav-item {
  68. > .nav-link {
  69. margin-bottom: .2rem;
  70. .right {
  71. @include transition(transform $transition-fn $transition-speed);
  72. }
  73. }
  74. }
  75. .nav-link > .right,
  76. .nav-link > p > .right {
  77. position: absolute;
  78. right: 1rem;
  79. top: .7rem;
  80. i,
  81. span {
  82. margin-left: .5rem;
  83. }
  84. &:nth-child(2) {
  85. right: 2.2rem;
  86. }
  87. }
  88. .menu-open {
  89. > .nav-treeview {
  90. display: block;
  91. }
  92. }
  93. .menu-open,
  94. .menu-is-opening {
  95. > .nav-link {
  96. svg.right,
  97. i.right {
  98. @include rotate(-90deg);
  99. }
  100. }
  101. }
  102. // First Level
  103. > .nav-item {
  104. margin-bottom: 0;
  105. .nav-icon {
  106. margin-left: .05rem;
  107. font-size: 1.2rem;
  108. margin-right: .2rem;
  109. text-align: center;
  110. width: $sidebar-nav-icon-width;
  111. /* stylelint-disable selector-class-pattern */
  112. &.fa,
  113. &.fas,
  114. &.far,
  115. &.fab,
  116. &.fal,
  117. &.fad,
  118. &.svg-inline--fa,
  119. &.ion {
  120. font-size: 1.1rem;
  121. }
  122. /* stylelint-enable selector-class-pattern */
  123. }
  124. .float-right {
  125. margin-top: 3px;
  126. }
  127. }
  128. // Tree view menu
  129. .nav-treeview {
  130. display: none;
  131. list-style: none;
  132. padding: 0;
  133. > .nav-item {
  134. > .nav-link {
  135. > .nav-icon {
  136. width: $sidebar-nav-icon-width;
  137. }
  138. }
  139. }
  140. }
  141. &.nav-child-indent {
  142. .nav-treeview {
  143. transition: padding $transition-speed $transition-fn;
  144. padding-left: 1rem;
  145. .text-sm & {
  146. padding-left: .5rem;
  147. }
  148. }
  149. &.nav-legacy {
  150. .nav-treeview {
  151. .nav-treeview {
  152. padding-left: 2rem;
  153. margin-left: -1rem;
  154. .text-sm & {
  155. padding-left: 1rem;
  156. margin-left: -.5rem;
  157. }
  158. }
  159. }
  160. }
  161. }
  162. .nav-header {
  163. font-size: .9rem;
  164. padding: $nav-link-padding-y ($nav-link-padding-y * 1.5);
  165. }
  166. .nav-link p {
  167. display: inline;
  168. margin: 0;
  169. white-space: normal;
  170. }
  171. }
  172. .sidebar-is-opening .sidebar .nav-sidebar {
  173. .nav-link p {
  174. animation-name: fade-in;
  175. animation-duration: $transition-speed;
  176. animation-fill-mode: both;
  177. }
  178. }
  179. #sidebar-overlay {
  180. @include media-breakpoint-down(md) {
  181. .sidebar-open & {
  182. display: block;
  183. }
  184. }
  185. background-color: rgba($black, .1);
  186. bottom: 0;
  187. display: none;
  188. left: 0;
  189. position: fixed;
  190. right: 0;
  191. top: 0;
  192. z-index: $zindex-main-sidebar - 1;
  193. }
  194. [class*="sidebar-light-"] {
  195. // Sidebar background color
  196. background-color: $sidebar-light-bg;
  197. // User Panel (resides in the sidebar)
  198. .user-panel {
  199. a:hover {
  200. color: $sidebar-light-hover-color;
  201. }
  202. .status {
  203. background-color: $sidebar-light-hover-bg;
  204. color: $sidebar-light-color;
  205. &:hover,
  206. &:focus,
  207. &:active {
  208. background-color: darken($sidebar-light-hover-bg, 3%);
  209. color: $sidebar-light-hover-color;
  210. }
  211. }
  212. .dropdown-menu {
  213. @include box-shadow(0 2px 4px rgba(0, 0, 0, .4));
  214. border-color: darken($sidebar-light-hover-bg, 5%);
  215. }
  216. .dropdown-item {
  217. color: $body-color;
  218. }
  219. }
  220. // Sidebar Menu. First level links
  221. .nav-sidebar > .nav-item {
  222. // links
  223. > .nav-link {
  224. // border-left: 3px solid transparent;
  225. &:active,
  226. &:focus {
  227. color: $sidebar-light-color;
  228. }
  229. }
  230. // Hover and active states
  231. &.menu-open > .nav-link,
  232. &:hover > .nav-link {
  233. background-color: $sidebar-light-hover-bg;
  234. color: $sidebar-light-hover-color;
  235. }
  236. > .nav-link.active {
  237. color: $sidebar-light-active-color;
  238. @if $enable-shadows {
  239. box-shadow: map-get($elevations, 1);
  240. }
  241. }
  242. // First Level Submenu
  243. > .nav-treeview {
  244. background-color: $sidebar-light-submenu-bg;
  245. }
  246. }
  247. // Section Heading
  248. .nav-header {
  249. background-color: inherit;
  250. color: darken($sidebar-light-color, 5%);
  251. }
  252. // All links within the sidebar menu
  253. .sidebar {
  254. a {
  255. color: $sidebar-light-color;
  256. &:hover {
  257. text-decoration: none;
  258. }
  259. }
  260. }
  261. // All submenus
  262. .nav-treeview {
  263. > .nav-item {
  264. > .nav-link {
  265. color: $sidebar-light-submenu-color;
  266. &:hover,
  267. &:focus {
  268. background-color: $sidebar-light-submenu-hover-bg;
  269. color: $sidebar-light-submenu-hover-color;
  270. }
  271. }
  272. > .nav-link.active {
  273. &,
  274. &:hover {
  275. background-color: $sidebar-light-submenu-active-bg;
  276. color: $sidebar-light-submenu-active-color;
  277. }
  278. }
  279. > .nav-link:hover {
  280. background-color: $sidebar-light-submenu-hover-bg;
  281. }
  282. }
  283. }
  284. // Flat style
  285. .nav-flat {
  286. .nav-item {
  287. .nav-treeview {
  288. .nav-treeview {
  289. border-color: $sidebar-light-submenu-active-bg;
  290. }
  291. > .nav-item {
  292. > .nav-link {
  293. &,
  294. &.active {
  295. border-color: $sidebar-light-submenu-active-bg;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. }
  302. }
  303. [class*="sidebar-dark-"] {
  304. // Sidebar background color
  305. background-color: $sidebar-dark-bg;
  306. // User Panel (resides in the sidebar)
  307. .user-panel {
  308. a:hover {
  309. color: $sidebar-dark-hover-color;
  310. }
  311. .status {
  312. background-color: $sidebar-dark-hover-bg;
  313. color: $sidebar-dark-color;
  314. &:hover,
  315. &:focus,
  316. &:active {
  317. background-color: darken($sidebar-dark-hover-bg, 3%);
  318. color: $sidebar-dark-hover-color;
  319. }
  320. }
  321. .dropdown-menu {
  322. @include box-shadow(0 2px 4px rgba(0, 0, 0, .4));
  323. border-color: darken($sidebar-dark-hover-bg, 5%);
  324. }
  325. .dropdown-item {
  326. color: $body-color;
  327. }
  328. }
  329. // Sidebar Menu. First level links
  330. .nav-sidebar > .nav-item {
  331. // links
  332. > .nav-link {
  333. // border-left: 3px solid transparent;
  334. &:active {
  335. color: $sidebar-dark-color;
  336. }
  337. }
  338. // Hover and active states
  339. &.menu-open > .nav-link,
  340. &:hover > .nav-link,
  341. > .nav-link:focus {
  342. background-color: $sidebar-dark-hover-bg;
  343. color: $sidebar-dark-hover-color;
  344. }
  345. > .nav-link.active {
  346. color: $sidebar-dark-hover-color;
  347. @if $enable-shadows {
  348. box-shadow: map-get($elevations, 1);
  349. }
  350. }
  351. // First Level Submenu
  352. > .nav-treeview {
  353. background-color: $sidebar-dark-submenu-bg;
  354. }
  355. }
  356. // Section Heading
  357. .nav-header {
  358. background-color: inherit; //darken($sidebar-dark-bg, 3%);
  359. color: lighten($sidebar-dark-color, 5%);
  360. }
  361. // All links within the sidebar menu
  362. .sidebar {
  363. a {
  364. color: $sidebar-dark-color;
  365. &:hover,
  366. &:focus {
  367. text-decoration: none;
  368. }
  369. }
  370. }
  371. // All submenus
  372. .nav-treeview {
  373. > .nav-item {
  374. > .nav-link {
  375. color: $sidebar-dark-submenu-color;
  376. &:hover,
  377. &:focus {
  378. background-color: $sidebar-dark-submenu-hover-bg;
  379. color: $sidebar-dark-submenu-hover-color;
  380. }
  381. }
  382. > .nav-link.active {
  383. &,
  384. &:hover,
  385. &:focus {
  386. background-color: $sidebar-dark-submenu-active-bg;
  387. color: $sidebar-dark-submenu-active-color;
  388. }
  389. }
  390. }
  391. }
  392. // Flat Style
  393. .nav-flat {
  394. .nav-item {
  395. .nav-treeview {
  396. .nav-treeview {
  397. border-color: $sidebar-dark-submenu-active-bg;
  398. }
  399. > .nav-item {
  400. > .nav-link {
  401. &,
  402. &.active {
  403. border-color: $sidebar-dark-submenu-active-bg;
  404. }
  405. }
  406. }
  407. }
  408. }
  409. }
  410. }
  411. // Sidebar variants
  412. @each $name, $color in $theme-colors {
  413. .sidebar-dark-#{$name},
  414. .sidebar-light-#{$name} {
  415. @include sidebar-color($color);
  416. }
  417. }
  418. @each $name, $color in $colors {
  419. .sidebar-dark-#{$name},
  420. .sidebar-light-#{$name} {
  421. @include sidebar-color($color);
  422. }
  423. }
  424. .sidebar-mini .main-sidebar:not(.sidebar-no-expand),
  425. .sidebar-mini-md .main-sidebar:not(.sidebar-no-expand),
  426. .sidebar-mini-xs .main-sidebar:not(.sidebar-no-expand),
  427. .sidebar-mini .main-sidebar:not(.sidebar-no-expand):hover,
  428. .sidebar-mini-md .main-sidebar:not(.sidebar-no-expand):hover,
  429. .sidebar-mini-xs .main-sidebar:not(.sidebar-no-expand):hover,
  430. .sidebar-mini .main-sidebar.sidebar-focused,
  431. .sidebar-mini-md .main-sidebar.sidebar-focused,
  432. .sidebar-mini-xs .main-sidebar.sidebar-focused {
  433. .nav-compact.nav-sidebar.nav-child-indent:not(.nav-flat) .nav-treeview {
  434. padding-left: 1rem;
  435. margin-left: -.5rem;
  436. }
  437. }
  438. // Nav Flat
  439. .nav-flat {
  440. margin: (-$sidebar-padding-x * .5) (-$sidebar-padding-x) 0;
  441. .nav-item {
  442. > .nav-link {
  443. border-radius: 0;
  444. margin-bottom: 0;
  445. > .nav-icon {
  446. margin-left: .55rem;
  447. }
  448. }
  449. }
  450. &:not(.nav-child-indent) {
  451. .nav-treeview {
  452. .nav-item {
  453. > .nav-link {
  454. > .nav-icon {
  455. margin-left: .4rem;
  456. }
  457. }
  458. }
  459. }
  460. }
  461. &.nav-child-indent {
  462. .nav-treeview {
  463. padding-left: 0;
  464. .nav-icon {
  465. margin-left: .85rem;
  466. }
  467. .nav-treeview {
  468. border-left: .2rem solid;
  469. .nav-icon {
  470. margin-left: 1.15rem;
  471. }
  472. .nav-treeview {
  473. .nav-icon {
  474. margin-left: 1.45rem;
  475. }
  476. .nav-treeview {
  477. .nav-icon {
  478. margin-left: 1.75rem;
  479. }
  480. .nav-treeview {
  481. .nav-icon {
  482. margin-left: 2.05rem;
  483. }
  484. }
  485. }
  486. }
  487. }
  488. }
  489. }
  490. .sidebar-collapse &.nav-child-indent .sidebar {
  491. .nav-treeview {
  492. .nav-icon {
  493. margin-left: .55rem;
  494. }
  495. .nav-link {
  496. padding-left: calc(#{$nav-link-padding-x} - .2rem);
  497. }
  498. .nav-treeview {
  499. .nav-icon {
  500. margin-left: .35rem;
  501. }
  502. .nav-treeview {
  503. .nav-icon {
  504. margin-left: .15rem;
  505. }
  506. .nav-treeview {
  507. .nav-icon {
  508. margin-left: -.15rem;
  509. }
  510. .nav-treeview {
  511. .nav-icon {
  512. margin-left: -.35rem;
  513. }
  514. }
  515. }
  516. }
  517. }
  518. }
  519. }
  520. .sidebar-mini .main-sidebar:not(.sidebar-no-expand):hover &,
  521. .sidebar-mini-md .main-sidebar:not(.sidebar-no-expand):hover &,
  522. .sidebar-mini-xs .main-sidebar:not(.sidebar-no-expand):hover &,
  523. .sidebar-mini .main-sidebar.sidebar-focused &,
  524. .sidebar-mini-md .main-sidebar.sidebar-focused &,
  525. .sidebar-mini-xs .main-sidebar.sidebar-focused & {
  526. &.nav-compact.nav-sidebar .nav-treeview {
  527. .nav-icon {
  528. margin-left: .4rem;
  529. }
  530. }
  531. &.nav-sidebar.nav-child-indent .nav-treeview {
  532. .nav-icon {
  533. margin-left: .85rem;
  534. }
  535. .nav-treeview {
  536. .nav-icon {
  537. margin-left: 1.15rem;
  538. }
  539. .nav-treeview {
  540. .nav-icon {
  541. margin-left: 1.45rem;
  542. }
  543. .nav-treeview {
  544. .nav-icon {
  545. margin-left: 1.75rem;
  546. }
  547. .nav-treeview {
  548. .nav-icon {
  549. margin-left: 2.05rem;
  550. }
  551. }
  552. }
  553. }
  554. }
  555. }
  556. }
  557. .nav-icon {
  558. @include transition(margin-left $transition-fn $transition-speed);
  559. }
  560. .nav-treeview {
  561. .nav-icon {
  562. margin-left: -.2rem;
  563. }
  564. }
  565. &.nav-sidebar > .nav-item {
  566. .nav-treeview,
  567. > .nav-treeview {
  568. background-color: rgba($white, .05);
  569. .nav-item {
  570. > .nav-link {
  571. border-left: .2rem solid;
  572. }
  573. }
  574. }
  575. }
  576. }
  577. .nav-legacy {
  578. margin: (-$sidebar-padding-x * .5) (-$sidebar-padding-x) 0;
  579. &.nav-sidebar .nav-item {
  580. > .nav-link {
  581. border-radius: 0;
  582. margin-bottom: 0;
  583. > .nav-icon {
  584. margin-left: .55rem;
  585. .text-sm & {
  586. margin-left: .75rem;
  587. }
  588. }
  589. }
  590. }
  591. &.nav-sidebar > .nav-item {
  592. > .nav-link {
  593. &.active {
  594. background-color: inherit;
  595. border-left: 3px solid transparent;
  596. box-shadow: none;
  597. > .nav-icon {
  598. margin-left: calc(.55rem - 3px);
  599. .text-sm & {
  600. margin-left: calc(.75rem - 3px);
  601. }
  602. }
  603. }
  604. }
  605. }
  606. .text-sm &.nav-sidebar.nav-flat .nav-treeview {
  607. .nav-item {
  608. > .nav-link {
  609. > .nav-icon {
  610. margin-left: calc(.75rem - 3px);
  611. }
  612. }
  613. }
  614. }
  615. .sidebar-mini &,
  616. .sidebar-mini-md &,
  617. .sidebar-mini-xs & {
  618. > .nav-item .nav-link {
  619. .nav-icon {
  620. @include transition(margin-left $transition-fn $transition-speed);
  621. margin-left: .6rem;
  622. }
  623. }
  624. }
  625. .sidebar-mini.sidebar-collapse,
  626. .sidebar-mini-md.sidebar-collapse,
  627. .sidebar-mini-xs.sidebar-collapse {
  628. .main-sidebar.sidebar-focused &.nav-child-indent,
  629. .main-sidebar:hover &.nav-child-indent {
  630. .nav-treeview {
  631. padding-left: 1rem;
  632. .nav-treeview {
  633. padding-left: 2rem;
  634. margin-left: -1rem;
  635. }
  636. }
  637. }
  638. }
  639. .sidebar-mini.sidebar-collapse.text-sm,
  640. .sidebar-mini-md.sidebar-collapse.text-sm,
  641. .sidebar-mini-xs.sidebar-collapse.text-sm {
  642. .main-sidebar.sidebar-focused &.nav-child-indent,
  643. .main-sidebar:hover &.nav-child-indent {
  644. .nav-treeview {
  645. padding-left: .5rem;
  646. .nav-treeview {
  647. padding-left: 1rem;
  648. margin-left: -.5rem;
  649. }
  650. }
  651. }
  652. }
  653. .sidebar-mini.sidebar-collapse &,
  654. .sidebar-mini-md.sidebar-collapse &,
  655. .sidebar-mini-xs.sidebar-collapse & {
  656. .sidebar {
  657. > .nav-item > .nav-link {
  658. .nav-icon {
  659. margin-left: .55rem;
  660. }
  661. &.active {
  662. > .nav-icon {
  663. margin-left: .36rem;
  664. }
  665. }
  666. }
  667. &.nav-child-indent {
  668. .nav-treeview {
  669. .nav-treeview {
  670. padding-left: 0;
  671. margin-left: 0;
  672. }
  673. }
  674. }
  675. }
  676. }
  677. .sidebar-mini.sidebar-collapse.text-sm &,
  678. .sidebar-mini-md.sidebar-collapse.text-sm &,
  679. .sidebar-mini-xs.sidebar-collapse.text-sm & {
  680. .sidebar {
  681. > .nav-item > .nav-link {
  682. .nav-icon {
  683. margin-left: .75rem;
  684. }
  685. &.active {
  686. > .nav-icon {
  687. margin-left: calc(.75rem - 3px);
  688. }
  689. }
  690. }
  691. }
  692. }
  693. [class*="sidebar-dark"] & {
  694. &.nav-sidebar > .nav-item {
  695. .nav-treeview,
  696. > .nav-treeview {
  697. background-color: rgba($white, .05);
  698. }
  699. > .nav-link.active {
  700. color: $sidebar-dark-active-color;
  701. }
  702. }
  703. .nav-treeview > .nav-item > .nav-link {
  704. &.active,
  705. &:focus,
  706. &:hover {
  707. background-color: transparent;
  708. color: $sidebar-dark-active-color;
  709. }
  710. }
  711. }
  712. [class*="sidebar-light"] & {
  713. &.nav-sidebar > .nav-item {
  714. .nav-treeview,
  715. > .nav-treeview {
  716. background-color: rgba($black, .05);
  717. }
  718. > .nav-link.active {
  719. color: $sidebar-light-active-color;
  720. }
  721. }
  722. .nav-treeview > .nav-item > .nav-link {
  723. &.active,
  724. &:focus,
  725. &:hover {
  726. background-color: transparent;
  727. color: $sidebar-light-active-color;
  728. }
  729. }
  730. }
  731. }
  732. .nav-collapse-hide-child {
  733. .menu-open > .nav-treeview {
  734. max-height: min-content;
  735. animation-name: fade-in;
  736. animation-duration: $transition-speed;
  737. animation-fill-mode: both;
  738. }
  739. .sidebar-collapse .sidebar:not(:hover) & {
  740. .menu-open > .nav-treeview {
  741. max-height: 0;
  742. animation-name: fade-out;
  743. animation-duration: $transition-speed;
  744. animation-fill-mode: both;
  745. }
  746. }
  747. .sidebar-mini.sidebar-collapse,
  748. .sidebar-mini-md.sidebar-collapse,
  749. .sidebar-mini-xs.sidebar-collapse {
  750. .main-sidebar.sidebar-focused &,
  751. .main-sidebar:not(.sidebar-no-expand):hover & {
  752. .menu-open > .nav-treeview {
  753. max-height: min-content;
  754. animation-name: fade-in;
  755. animation-duration: $transition-speed;
  756. animation-fill-mode: both;
  757. }
  758. }
  759. }
  760. }
  761. // Nav Compact
  762. .nav-compact {
  763. .nav-link,
  764. .nav-header {
  765. padding-top: ($nav-link-padding-y * .5);
  766. padding-bottom: ($nav-link-padding-y * .5);
  767. }
  768. .nav-header:not(:first-of-type) {
  769. padding-top: ($nav-link-padding-y * 1.5);
  770. padding-bottom: ($nav-link-padding-y * .5);
  771. }
  772. .nav-link > .right,
  773. .nav-link > p > .right {
  774. top: .465rem;
  775. }
  776. .text-sm & {
  777. .nav-link > .right,
  778. .nav-link > p > .right {
  779. top: .7rem;
  780. }
  781. }
  782. }
  783. // Sidebar Form Control
  784. [class*="sidebar-dark"] {
  785. .form-control-sidebar,
  786. .btn-sidebar {
  787. background-color: lighten($sidebar-dark-bg, 5%);
  788. border: 1px solid lighten($sidebar-dark-bg, 15%);
  789. color: lighten(color-yiq(lighten($sidebar-dark-bg, 5%)), 15%);
  790. }
  791. .form-control-sidebar:focus,
  792. .btn-sidebar:focus {
  793. border: 1px solid lighten($sidebar-dark-bg, 30%);
  794. }
  795. .btn-sidebar:hover {
  796. background-color: lighten($sidebar-dark-bg, 7.5%);
  797. }
  798. .btn-sidebar:focus {
  799. background-color: lighten($sidebar-dark-bg, 10%);
  800. }
  801. .list-group-item {
  802. background-color: lighten($sidebar-dark-bg, 7.5%);
  803. border-color: lighten($sidebar-dark-bg, 15%);
  804. color: $sidebar-dark-color;
  805. &:hover {
  806. background-color: lighten($sidebar-dark-bg, 10%);
  807. }
  808. &:focus {
  809. background-color: lighten($sidebar-dark-bg, 12.5%);
  810. }
  811. .search-path {
  812. color: $gray-500;
  813. }
  814. }
  815. }
  816. [class*="sidebar-light"] {
  817. .form-control-sidebar,
  818. .btn-sidebar {
  819. background-color: darken($sidebar-light-bg, 5%);
  820. border: 1px solid darken($sidebar-light-bg, 15%);
  821. color: color-yiq(darken($sidebar-light-bg, 5%));
  822. }
  823. .form-control-sidebar:focus,
  824. .btn-sidebar:focus {
  825. border: 1px solid darken($sidebar-light-bg, 30%);
  826. }
  827. .btn-sidebar:hover {
  828. background-color: darken($sidebar-light-bg, 7.5%);
  829. }
  830. .btn-sidebar:focus {
  831. background-color: darken($sidebar-light-bg, 10%);
  832. }
  833. .list-group-item {
  834. border-color: darken($sidebar-light-bg, 15%);
  835. &:hover {
  836. background-color: darken($sidebar-light-bg, 7.5%);
  837. }
  838. &:focus {
  839. background-color: darken($sidebar-light-bg, 10%);
  840. }
  841. .search-path {
  842. color: $gray-600;
  843. }
  844. }
  845. }
  846. // Sidebar inline input-group fix
  847. .sidebar .form-inline .input-group {
  848. width: 100%;
  849. flex-wrap: nowrap;
  850. }
  851. .sidebar nav .form-inline {
  852. margin-bottom: .2rem;
  853. }
  854. // Sidebar Collapse on Layout Boxed
  855. .layout-boxed:not(.sidebar-mini):not(.sidebar-mini-md):not(.sidebar-mini-xs) {
  856. &.sidebar-collapse .main-sidebar {
  857. margin-left: 0;
  858. }
  859. .content-wrapper,
  860. .main-header,
  861. .main-footer {
  862. z-index: 9999;
  863. position: relative;
  864. }
  865. .control-sidebar {
  866. z-index: 9999;
  867. }
  868. }
  869. // Sidebar Search
  870. .sidebar-collapse {
  871. .form-control-sidebar,
  872. .form-control-sidebar ~ .input-group-append,
  873. .sidebar-search-results {
  874. display: none;
  875. }
  876. }
  877. [data-widget="sidebar-search"] {
  878. input[type="search"] {
  879. &::-ms-clear,
  880. &::-ms-reveal {
  881. display: none;
  882. width: 0;
  883. height: 0;
  884. }
  885. &::-webkit-search-cancel-button,
  886. &::-webkit-search-decoration,
  887. &::-webkit-search-results-button,
  888. &::-webkit-search-results-decoration {
  889. display: none;
  890. }
  891. }
  892. }
  893. .sidebar-search-results {
  894. position: relative;
  895. display: none;
  896. width: 100%;
  897. .sidebar-search-open & {
  898. display: inline-block;
  899. }
  900. .search-title {
  901. margin-bottom: -.1rem;
  902. }
  903. .list-group {
  904. position: absolute;
  905. width: 100%;
  906. z-index: $zindex-main-sidebar + 1;
  907. > .list-group-item {
  908. padding: $input-padding-y $input-padding-x;
  909. &:-moz-focusring {
  910. margin-top: 0;
  911. border-left: 1px solid transparent;
  912. border-top: 0;
  913. border-bottom: 1px solid transparent;
  914. }
  915. &:first-child {
  916. margin-top: 0;
  917. border-top: 0;
  918. @include border-top-radius(0);
  919. }
  920. }
  921. }
  922. }
  923. .sidebar-search-results .search-path {
  924. font-size: $small-font-size;
  925. }
  926. .sidebar-search-open {
  927. .btn,
  928. .form-control {
  929. @include border-bottom-radius(0);
  930. }
  931. }
  932. // Custom Area
  933. .sidebar-custom {
  934. [class*="sidebar-dark"] & {
  935. border-top: 1px solid lighten($dark, 12%);
  936. }
  937. [class*="sidebar-light"] & {
  938. border-top: 1px solid $gray-300;
  939. }
  940. }
  941. .layout-fixed {
  942. &.sidebar-collapse {
  943. .hide-on-collapse {
  944. display: none;
  945. }
  946. }
  947. &.sidebar-collapse:hover {
  948. .hide-on-collapse {
  949. display: block;
  950. }
  951. }
  952. &.text-sm .main-sidebar-custom {
  953. .sidebar {
  954. height: calc(100% - ((#{$main-header-height-sm-inner} + #{$sidebar-custom-height * .95}) + #{$main-header-bottom-border-width}));
  955. }
  956. .sidebar-custom {
  957. height: $sidebar-custom-height * .95;
  958. padding: $sidebar-custom-padding-x $sidebar-custom-padding-y;
  959. }
  960. }
  961. .main-sidebar-custom {
  962. .sidebar {
  963. height: calc(100% - ((#{$main-header-height-inner} + #{$sidebar-custom-height}) + #{$main-header-bottom-border-width}));
  964. }
  965. .sidebar-custom {
  966. height: $sidebar-custom-height;
  967. padding: $sidebar-custom-padding-x $sidebar-custom-padding-y;
  968. }
  969. height: stretch;
  970. }
  971. .main-sidebar-custom-lg {
  972. .sidebar {
  973. height: calc(100% - ((#{$main-header-height-inner} + #{$sidebar-custom-height-lg}) + #{$main-header-bottom-border-width}));
  974. }
  975. .sidebar-custom {
  976. height: $sidebar-custom-height-lg;
  977. }
  978. }
  979. .main-sidebar-custom-xl {
  980. .sidebar {
  981. height: calc(100% - ((#{$main-header-height-inner} + #{$sidebar-custom-height-xl}) + #{$main-header-bottom-border-width}));
  982. }
  983. .sidebar-custom {
  984. height: $sidebar-custom-height-xl;
  985. }
  986. }
  987. .main-sidebar-custom,
  988. .main-sidebar-custom-lg,
  989. .main-sidebar-custom-xl {
  990. .pos-right {
  991. position: absolute;
  992. right: .5rem;
  993. }
  994. }
  995. }
  996. .sidebar-hidden,
  997. .sidebar-hidden.sidebar-mini.sidebar-collapse {
  998. .main-sidebar {
  999. display: none !important;
  1000. }
  1001. .content-wrapper,
  1002. .main-header {
  1003. margin-left: 0 !important;
  1004. }
  1005. }
  1006. @include dark-mode() {
  1007. @each $name, $color in $theme-colors-alt {
  1008. .sidebar-dark-#{$name},
  1009. .sidebar-light-#{$name} {
  1010. @include sidebar-color($color);
  1011. }
  1012. }
  1013. @each $name, $color in $colors-alt {
  1014. .sidebar-dark-#{$name},
  1015. .sidebar-light-#{$name} {
  1016. @include sidebar-color($color);
  1017. }
  1018. }
  1019. [class*="sidebar-light-"] {
  1020. .sidebar {
  1021. a {
  1022. color: $sidebar-light-color;
  1023. &:hover {
  1024. text-decoration: none;
  1025. }
  1026. }
  1027. }
  1028. }
  1029. }
  1030. //