_layout.scss 12 KB

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