_layout.scss 12 KB

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