_layout.scss 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  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. & .text-sm {
  325. .brand-image {
  326. margin-top: -.5rem;
  327. }
  328. }
  329. & .main-sidebar {
  330. bottom: inherit;
  331. height: inherit;
  332. }
  333. .brand-image {
  334. height: 33px;
  335. }
  336. & .main-sidebar {
  337. display: none;
  338. }
  339. & .content-wrapper,
  340. & .main-header,
  341. & .main-footer {
  342. margin-left: 0;
  343. }
  344. }
  345. }
  346. body.sidebar-collapse:not(.sidebar-mini-md):not(.sidebar-mini) {
  347. .content-wrapper,
  348. .main-footer,
  349. .main-header {
  350. &,
  351. &::before {
  352. margin-left: 0;
  353. }
  354. }
  355. }
  356. body:not(.sidebar-mini-md) {
  357. .content-wrapper,
  358. .main-footer,
  359. .main-header {
  360. @include media-breakpoint-up(md) {
  361. @include transition(margin-left $transition-speed $transition-fn);
  362. margin-left: $sidebar-width;
  363. .sidebar-collapse & {
  364. margin-left: 0;
  365. }
  366. }
  367. @include media-breakpoint-down(md) {
  368. &,
  369. &::before {
  370. margin-left: 0;
  371. }
  372. }
  373. }
  374. }
  375. .sidebar-mini-md {
  376. .content-wrapper,
  377. .main-footer,
  378. .main-header {
  379. @include media-breakpoint-up(md) {
  380. @include transition(margin-left $transition-speed $transition-fn);
  381. margin-left: $sidebar-width;
  382. .sidebar-collapse & {
  383. margin-left: $sidebar-mini-width;
  384. }
  385. }
  386. @include media-breakpoint-down(md) {
  387. &,
  388. &::before {
  389. margin-left: $sidebar-mini-width;
  390. }
  391. }
  392. }
  393. }
  394. .content-wrapper {
  395. background: $main-bg;
  396. > .content {
  397. padding: $content-padding-y $content-padding-x;
  398. }
  399. }
  400. .main-sidebar {
  401. &,
  402. &::before {
  403. $local-sidebar-transition: margin-left $transition-speed $transition-fn, width $transition-speed $transition-fn;
  404. @include transition($local-sidebar-transition);
  405. width: $sidebar-width;
  406. }
  407. .sidebar-collapse:not(.sidebar-mini):not(.sidebar-mini-md) & {
  408. &,
  409. &::before {
  410. box-shadow: none !important;
  411. }
  412. }
  413. .sidebar-collapse & {
  414. &,
  415. &::before {
  416. margin-left: -$sidebar-width;
  417. }
  418. .nav-sidebar.nav-child-indent .nav-treeview {
  419. padding: 0;
  420. }
  421. }
  422. @include media-breakpoint-down(sm) {
  423. &,
  424. &::before {
  425. box-shadow: none !important;
  426. margin-left: -$sidebar-width;
  427. }
  428. .sidebar-open & {
  429. &,
  430. &::before {
  431. margin-left: 0;
  432. }
  433. }
  434. }
  435. }
  436. :not(.layout-fixed) {
  437. .main-sidebar {
  438. height: inherit;
  439. min-height: 100%;
  440. position: absolute;
  441. top: 0;
  442. }
  443. }
  444. .layout-fixed {
  445. .brand-link {
  446. width: $sidebar-width;
  447. }
  448. .main-sidebar {
  449. bottom: 0;
  450. float: none;
  451. height: 100vh;
  452. left: 0;
  453. position: fixed;
  454. top: 0;
  455. }
  456. .control-sidebar {
  457. bottom: 0;
  458. float: none;
  459. height: 100vh;
  460. position: fixed;
  461. top: 0;
  462. .control-sidebar-content {
  463. height: calc(100vh - #{$main-header-height});
  464. }
  465. }
  466. }
  467. .main-footer {
  468. background: $main-footer-bg;
  469. border-top: $main-footer-border-top;
  470. color: lighten($gray-700, 25%);
  471. padding: $main-footer-padding;
  472. .text-sm &,
  473. &.text-sm {
  474. padding: $main-footer-padding-sm;
  475. }
  476. }
  477. .content-header {
  478. padding: 15px $content-padding-x;
  479. .text-sm & {
  480. padding: 10px $content-padding-x;
  481. }
  482. h1 {
  483. font-size: 1.8rem;
  484. margin: 0;
  485. .text-sm & {
  486. font-size: 1.5rem;
  487. }
  488. }
  489. .breadcrumb {
  490. background: transparent;
  491. line-height: 1.8rem;
  492. margin-bottom: 0;
  493. padding: 0;
  494. .text-sm & {
  495. line-height: 1.5rem;
  496. }
  497. }
  498. }
  499. .hold-transition {
  500. .content-wrapper,
  501. .main-header,
  502. .main-sidebar,
  503. .main-sidebar *,
  504. .control-sidebar,
  505. .control-sidebar *,
  506. .main-footer {
  507. transition: none !important;
  508. }
  509. }