_main-sidebar.scss 23 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211
  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. //