_layout.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690
  1. //
  2. // Core: Layout
  3. //
  4. html.scroll-smooth {
  5. scroll-behavior: smooth;
  6. }
  7. html,
  8. body,
  9. .wrapper {
  10. min-height: 100%;
  11. }
  12. .preloader {
  13. display: flex;
  14. align-items: center;
  15. justify-content: center;
  16. background-color: $main-bg;
  17. height: 100vh;
  18. width: 100%;
  19. transition: height 200ms linear;
  20. position: fixed;
  21. left: 0;
  22. top: 0;
  23. z-index: $zindex-preloader;
  24. }
  25. .wrapper {
  26. position: relative;
  27. .content-wrapper {
  28. min-height: calc(100vh - #{$main-header-height} - #{$main-footer-height});
  29. }
  30. .layout-boxed & {
  31. @include box-shadow(0 0 10 rgba($black, .3));
  32. &,
  33. &::before {
  34. margin: 0 auto;
  35. max-width: $boxed-layout-max-width;
  36. }
  37. .main-sidebar {
  38. left: inherit;
  39. }
  40. }
  41. @supports not (-webkit-touch-callout: none) {
  42. .layout-fixed & .sidebar {
  43. height: calc(100vh - (#{$main-header-height-inner} + #{$main-header-bottom-border-width}));
  44. }
  45. .layout-fixed.text-sm & .sidebar {
  46. height: calc(100vh - (#{$main-header-height-sm-inner} + #{$main-header-bottom-border-width}));
  47. }
  48. }
  49. .layout-navbar-fixed.layout-fixed & {
  50. .control-sidebar {
  51. top: $main-header-height;
  52. }
  53. .main-header.text-sm ~ .control-sidebar {
  54. top: $main-header-height-sm;
  55. }
  56. .sidebar {
  57. margin-top: $main-header-height;
  58. }
  59. .brand-link.text-sm ~ .sidebar {
  60. margin-top: $main-header-height-sm;
  61. }
  62. }
  63. .layout-navbar-fixed.layout-fixed.text-sm & {
  64. .control-sidebar {
  65. top: $main-header-height-sm;
  66. }
  67. .sidebar {
  68. margin-top: $main-header-height-sm;
  69. }
  70. }
  71. .layout-navbar-fixed.sidebar-mini.sidebar-collapse &,
  72. .layout-navbar-fixed.sidebar-mini-md.sidebar-collapse &,
  73. .layout-navbar-fixed.sidebar-mini-xs.sidebar-collapse & {
  74. .brand-link {
  75. height: $main-header-height;
  76. width: $sidebar-mini-width;
  77. &.text-sm {
  78. height: $main-header-height-sm;
  79. }
  80. }
  81. }
  82. .layout-navbar-fixed.sidebar-mini.sidebar-collapse.text-sm &,
  83. .layout-navbar-fixed.sidebar-mini-md.sidebar-collapse.text-sm &,
  84. .layout-navbar-fixed.sidebar-mini-xs.sidebar-collapse.text-sm & {
  85. .brand-link {
  86. height: $main-header-height-sm;
  87. }
  88. }
  89. body:not(.layout-fixed).layout-navbar-fixed & {
  90. .main-sidebar {
  91. // margin-top: calc(#{$main-header-height} / -1);
  92. // .sidebar {
  93. // margin-top: $main-header-height;
  94. // }
  95. }
  96. }
  97. body:not(.layout-fixed).layout-navbar-fixed.text-sm & {
  98. .main-sidebar {
  99. margin-top: calc(#{$main-header-height-sm} / -1);
  100. .sidebar {
  101. margin-top: $main-header-height-sm;
  102. }
  103. }
  104. }
  105. .layout-navbar-fixed & {
  106. .control-sidebar {
  107. top: 0;
  108. }
  109. a.anchor {
  110. display: block;
  111. position: relative;
  112. top: calc((#{$main-header-height-inner} + #{$main-header-bottom-border-width} + (#{$main-header-link-padding-y} * 2)) / -1);
  113. }
  114. .main-sidebar:hover {
  115. .brand-link {
  116. transition: width $transition-speed $transition-fn;
  117. width: $sidebar-width;
  118. }
  119. }
  120. .brand-link {
  121. overflow: hidden;
  122. position: fixed;
  123. top: 0;
  124. transition: width $transition-speed $transition-fn;
  125. width: $sidebar-width;
  126. z-index: $zindex-main-header + 1;
  127. }
  128. // Sidebar variants brand-link fix
  129. @each $name, $color in $theme-colors {
  130. .sidebar-dark-#{$name} .brand-link:not([class*="navbar"]) {
  131. background-color: $sidebar-dark-bg;
  132. }
  133. .sidebar-light-#{$name} .brand-link:not([class*="navbar"]) {
  134. background-color: $sidebar-light-bg;
  135. }
  136. }
  137. .content-wrapper {
  138. margin-top: $main-header-height;
  139. }
  140. .main-header.text-sm ~ .content-wrapper {
  141. margin-top: $main-header-height-sm;
  142. }
  143. .main-header {
  144. left: 0;
  145. position: fixed;
  146. right: 0;
  147. top: 0;
  148. z-index: $zindex-main-header - 1;
  149. }
  150. }
  151. .layout-navbar-fixed.text-sm & {
  152. .content-wrapper {
  153. margin-top: $main-header-height-sm;
  154. }
  155. }
  156. .layout-navbar-not-fixed & {
  157. .brand-link {
  158. position: static;
  159. }
  160. .sidebar,
  161. .content-wrapper {
  162. margin-top: 0;
  163. }
  164. .main-header {
  165. position: static;
  166. }
  167. }
  168. .layout-navbar-not-fixed.layout-fixed & {
  169. .sidebar {
  170. margin-top: 0;
  171. }
  172. }
  173. @each $breakpoint in map-keys($grid-breakpoints) {
  174. @include media-breakpoint-up($breakpoint) {
  175. $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
  176. .layout#{$infix}-navbar-fixed.layout-fixed & {
  177. .control-sidebar {
  178. top: $main-header-height;
  179. }
  180. .text-sm & .main-header ~ .control-sidebar,
  181. .main-header.text-sm ~ .control-sidebar {
  182. top: $main-header-height-sm;
  183. }
  184. .sidebar {
  185. margin-top: $main-header-height;
  186. }
  187. .text-sm & .brand-link ~ .sidebar,
  188. .brand-link.text-sm ~ .sidebar {
  189. margin-top: $main-header-height-sm;
  190. }
  191. }
  192. .layout#{$infix}-navbar-fixed.layout-fixed.text-sm & {
  193. .control-sidebar {
  194. top: $main-header-height-sm;
  195. }
  196. .sidebar {
  197. margin-top: $main-header-height-sm;
  198. }
  199. }
  200. .layout#{$infix}-navbar-fixed & {
  201. .control-sidebar {
  202. top: 0;
  203. }
  204. a.anchor {
  205. display: block;
  206. position: relative;
  207. top: calc((#{$main-header-height-inner} + #{$main-header-bottom-border-width} + (#{$main-header-link-padding-y} * 2)) / -1);
  208. }
  209. &.sidebar-collapse {
  210. .brand-link {
  211. height: $main-header-height;
  212. transition: width $transition-speed $transition-fn;
  213. width: $sidebar-mini-width;
  214. .text-sm &,
  215. &.text-sm {
  216. height: $main-header-height-sm;
  217. }
  218. }
  219. .main-sidebar:hover {
  220. .brand-link {
  221. transition: width $transition-speed $transition-fn;
  222. width: $sidebar-width;
  223. }
  224. }
  225. }
  226. .brand-link {
  227. overflow: hidden;
  228. position: fixed;
  229. top: 0;
  230. transition: width $transition-speed $transition-fn;
  231. width: $sidebar-width;
  232. z-index: $zindex-main-header + 1;
  233. }
  234. // Sidebar variants brand-link fix
  235. @each $name, $color in $theme-colors {
  236. .sidebar-dark-#{$name} .brand-link:not([class*="navbar"]) {
  237. background-color: $sidebar-dark-bg;
  238. }
  239. .sidebar-light-#{$name} .brand-link:not([class*="navbar"]) {
  240. background-color: $sidebar-light-bg;
  241. }
  242. }
  243. .content-wrapper {
  244. margin-top: $main-header-height;
  245. }
  246. .text-sm & .main-header ~ .content-wrapper,
  247. .main-header.text-sm ~ .content-wrapper {
  248. margin-top: $main-header-height-sm;
  249. }
  250. .main-header {
  251. left: 0;
  252. position: fixed;
  253. right: 0;
  254. top: 0;
  255. z-index: $zindex-main-sidebar - 1;
  256. }
  257. }
  258. .layout#{$infix}-navbar-fixed.text-sm & {
  259. .content-wrapper {
  260. margin-top: $main-header-height-sm;
  261. }
  262. }
  263. body:not(.layout-fixed).layout#{$infix}-navbar-fixed & {
  264. // .main-sidebar {
  265. // margin-top: calc(#{$main-header-height} / -1);
  266. // .sidebar {
  267. // margin-top: $main-header-height;
  268. // }
  269. // }
  270. }
  271. body:not(.layout-fixed).layout#{$infix}-navbar-fixed.text-sm & {
  272. .main-sidebar {
  273. margin-top: calc(#{$main-header-height-sm} / -1);
  274. .sidebar {
  275. margin-top: $main-header-height-sm;
  276. }
  277. }
  278. }
  279. .layout#{$infix}-navbar-not-fixed & {
  280. .brand-link {
  281. position: static;
  282. }
  283. .sidebar,
  284. .content-wrapper {
  285. margin-top: 0;
  286. }
  287. .main-header {
  288. position: static;
  289. }
  290. }
  291. .layout#{$infix}-navbar-not-fixed.layout-fixed & {
  292. .sidebar {
  293. margin-top: 0;
  294. }
  295. }
  296. }
  297. }
  298. .layout-footer-fixed & {
  299. .control-sidebar {
  300. bottom: 0;
  301. }
  302. .main-footer {
  303. bottom: 0;
  304. left: 0;
  305. position: fixed;
  306. right: 0;
  307. z-index: $zindex-main-footer;
  308. }
  309. }
  310. .layout-footer-not-fixed & {
  311. .main-footer {
  312. position: static;
  313. }
  314. .content-wrapper {
  315. margin-bottom: 0;
  316. }
  317. }
  318. @each $breakpoint in map-keys($grid-breakpoints) {
  319. @include media-breakpoint-up($breakpoint) {
  320. $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
  321. .layout#{$infix}-footer-fixed & {
  322. .control-sidebar {
  323. bottom: 0;
  324. }
  325. .main-footer {
  326. bottom: 0;
  327. left: 0;
  328. position: fixed;
  329. right: 0;
  330. z-index: $zindex-main-footer;
  331. }
  332. .content-wrapper {
  333. padding-bottom: $main-footer-height;
  334. }
  335. }
  336. .layout#{$infix}-footer-not-fixed & {
  337. .main-footer {
  338. position: static;
  339. }
  340. }
  341. }
  342. }
  343. .layout-top-nav & {
  344. margin-left: 0;
  345. .main-header {
  346. .brand-image {
  347. margin-top: -.5rem;
  348. margin-right: .2rem;
  349. height: 33px;
  350. }
  351. }
  352. .main-sidebar {
  353. bottom: inherit;
  354. height: inherit;
  355. }
  356. .content-wrapper,
  357. .main-header,
  358. .main-footer {
  359. margin-left: 0;
  360. }
  361. }
  362. }
  363. body.sidebar-collapse:not(.sidebar-mini-xs):not(.sidebar-mini-md):not(.sidebar-mini) {
  364. .content-wrapper,
  365. .main-footer,
  366. .main-header {
  367. &,
  368. &::before {
  369. margin-left: 0;
  370. }
  371. }
  372. }
  373. body:not(.sidebar-mini-md):not(.sidebar-mini-xs):not(.layout-top-nav) {
  374. .content-wrapper,
  375. .main-footer,
  376. .main-header {
  377. @include media-breakpoint-up(md) {
  378. @include transition(margin-left $transition-speed $transition-fn);
  379. margin-left: $sidebar-width;
  380. .sidebar-collapse & {
  381. margin-left: 0;
  382. }
  383. }
  384. @include media-breakpoint-down(md) {
  385. margin-left: 0;
  386. }
  387. }
  388. }
  389. .sidebar-mini-md {
  390. .content-wrapper,
  391. .main-footer,
  392. .main-header {
  393. @include media-breakpoint-up(md) {
  394. @include transition(margin-left $transition-speed $transition-fn);
  395. margin-left: $sidebar-width;
  396. .sidebar-collapse & {
  397. margin-left: $sidebar-mini-width;
  398. }
  399. }
  400. @include media-breakpoint-down(md) {
  401. margin-left: $sidebar-mini-width;
  402. }
  403. @include media-breakpoint-down(sm) {
  404. margin-left: 0;
  405. }
  406. }
  407. }
  408. .sidebar-mini-xs {
  409. .content-wrapper,
  410. .main-footer,
  411. .main-header {
  412. @include media-breakpoint-up(md) {
  413. @include transition(margin-left $transition-speed $transition-fn);
  414. margin-left: $sidebar-width;
  415. .sidebar-collapse & {
  416. margin-left: $sidebar-mini-width;
  417. }
  418. }
  419. @include media-breakpoint-down(md) {
  420. margin-left: $sidebar-mini-width;
  421. }
  422. }
  423. }
  424. .content-wrapper {
  425. background-color: $main-bg;
  426. > .content {
  427. padding: $content-padding-y $content-padding-x;
  428. }
  429. }
  430. .main-sidebar {
  431. &,
  432. &::before {
  433. $local-sidebar-transition: margin-left $transition-speed $transition-fn, width $transition-speed $transition-fn;
  434. @include transition($local-sidebar-transition);
  435. width: $sidebar-width;
  436. }
  437. .sidebar-collapse:not(.sidebar-mini):not(.sidebar-mini-md):not(.sidebar-mini-xs) & {
  438. &,
  439. &::before {
  440. box-shadow: none !important;
  441. }
  442. }
  443. .sidebar-collapse & {
  444. &,
  445. &::before {
  446. margin-left: -$sidebar-width;
  447. }
  448. .nav-sidebar.nav-child-indent .nav-treeview {
  449. padding: 0;
  450. }
  451. }
  452. @include media-breakpoint-down(sm) {
  453. &,
  454. &::before {
  455. box-shadow: none !important;
  456. margin-left: -$sidebar-width;
  457. }
  458. .sidebar-open & {
  459. &,
  460. &::before {
  461. margin-left: 0;
  462. }
  463. }
  464. }
  465. }
  466. body:not(.layout-fixed) {
  467. .main-sidebar {
  468. height: inherit;
  469. min-height: 100%;
  470. position: absolute;
  471. top: 0;
  472. .sidebar {
  473. overflow-y: auto;
  474. }
  475. }
  476. }
  477. .layout-fixed {
  478. .brand-link {
  479. width: $sidebar-width;
  480. }
  481. .main-sidebar {
  482. bottom: 0;
  483. float: none;
  484. left: 0;
  485. position: fixed;
  486. top: 0;
  487. }
  488. .control-sidebar {
  489. bottom: 0;
  490. float: none;
  491. position: fixed;
  492. top: 0;
  493. .control-sidebar-content {
  494. height: calc(100vh - #{$main-header-height});
  495. overflow-y: auto;
  496. @include scrollbar-width-thin();
  497. }
  498. }
  499. }
  500. @supports (-webkit-touch-callout: none) {
  501. .layout-fixed {
  502. .main-sidebar {
  503. height: inherit;
  504. }
  505. }
  506. }
  507. .main-footer {
  508. background-color: $main-footer-bg;
  509. border-top: $main-footer-border-top;
  510. color: lighten($gray-700, 25%);
  511. padding: $main-footer-padding;
  512. .text-sm &,
  513. &.text-sm {
  514. padding: $main-footer-padding-sm;
  515. }
  516. }
  517. .content-header {
  518. padding: 15px $content-padding-x;
  519. .text-sm & {
  520. padding: 10px $content-padding-x;
  521. }
  522. h1 {
  523. font-size: 1.8rem;
  524. margin: 0;
  525. .text-sm & {
  526. font-size: 1.5rem;
  527. }
  528. }
  529. .breadcrumb {
  530. background-color: transparent;
  531. line-height: 1.8rem;
  532. margin-bottom: 0;
  533. padding: 0;
  534. .text-sm & {
  535. line-height: 1.5rem;
  536. }
  537. }
  538. }
  539. .hold-transition {
  540. .content-wrapper,
  541. .main-header,
  542. .main-sidebar,
  543. .main-sidebar *,
  544. .control-sidebar,
  545. .control-sidebar *,
  546. .main-footer {
  547. transition: none !important;
  548. animation-duration: 0s !important;
  549. }
  550. }
  551. .dark-mode {
  552. background-color: lighten($dark, 7.5%) !important;
  553. color: $white;
  554. .breadcrumb-item {
  555. &.active,
  556. + .breadcrumb-item::before {
  557. color: $gray-500;
  558. }
  559. }
  560. .main-footer {
  561. background-color: $dark;
  562. border-color: lighten($dark, 10%);
  563. }
  564. .content-wrapper {
  565. background-color: lighten($dark, 7.5%);
  566. color: $white;
  567. .content-header {
  568. color: $white;
  569. }
  570. }
  571. .preloader {
  572. background-color: $dark;
  573. color: $white;
  574. }
  575. }