_layout.scss 13 KB

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