_layout.scss 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  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.sidebar-collapse & {
  43. .brand-link {
  44. height: $main-header-height;
  45. width: $sidebar-mini-width;
  46. &.text-sm {
  47. height: $main-header-height-sm;
  48. }
  49. }
  50. }
  51. .layout-navbar-fixed & {
  52. .control-sidebar {
  53. top: 0;
  54. }
  55. a.anchor {
  56. display: block;
  57. position: relative;
  58. top: calc((#{$main-header-height-inner} + #{$main-header-bottom-border-width} + (#{$main-header-link-padding-y} * 2)) / -1);
  59. }
  60. .main-sidebar:hover {
  61. .brand-link {
  62. transition: width $transition-speed $transition-fn;
  63. width: $sidebar-width;
  64. }
  65. }
  66. .brand-link {
  67. overflow: hidden;
  68. position: fixed;
  69. top: 0;
  70. transition: width $transition-speed $transition-fn;
  71. width: $sidebar-width;
  72. z-index: $zindex-main-header + 1;
  73. }
  74. // Sidebar variants brand-link fix
  75. @each $name, $color in $theme-colors {
  76. .sidebar-dark-#{$name} .brand-link:not([class*="navbar"]) {
  77. background-color: $sidebar-dark-bg;
  78. }
  79. .sidebar-light-#{$name} .brand-link:not([class*="navbar"]) {
  80. background-color: $sidebar-light-bg;
  81. }
  82. }
  83. .content-wrapper {
  84. margin-top: $main-header-height;
  85. }
  86. .main-header.text-sm ~ .content-wrapper {
  87. margin-top: $main-header-height-sm;
  88. }
  89. .main-header {
  90. left: 0;
  91. position: fixed;
  92. right: 0;
  93. top: 0;
  94. z-index: $zindex-main-header - 1;
  95. }
  96. }
  97. .layout-navbar-not-fixed & {
  98. .brand-link {
  99. position: static;
  100. }
  101. .sidebar,
  102. .content-wrapper {
  103. margin-top: 0;
  104. }
  105. .main-header {
  106. position: static;
  107. }
  108. }
  109. .layout-navbar-not-fixed.layout-fixed & {
  110. .sidebar {
  111. margin-top: 0;
  112. }
  113. }
  114. @each $breakpoint in map-keys($grid-breakpoints) {
  115. @include media-breakpoint-up($breakpoint) {
  116. $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
  117. .layout#{$infix}-navbar-fixed.layout-fixed & {
  118. .control-sidebar {
  119. top: $main-header-height;
  120. }
  121. .main-header.text-sm ~ .control-sidebar {
  122. top: $main-header-height-sm;
  123. }
  124. .sidebar {
  125. margin-top: $main-header-height;
  126. }
  127. .brand-link.text-sm ~ .sidebar {
  128. margin-top: $main-header-height-sm;
  129. }
  130. }
  131. .layout#{$infix}-navbar-fixed & {
  132. .control-sidebar {
  133. top: 0;
  134. }
  135. a.anchor {
  136. display: block;
  137. position: relative;
  138. top: calc((#{$main-header-height-inner} + #{$main-header-bottom-border-width} + (#{$main-header-link-padding-y} * 2)) / -1);
  139. }
  140. &.sidebar-collapse {
  141. .brand-link {
  142. height: $main-header-height;
  143. transition: width $transition-speed $transition-fn;
  144. width: $sidebar-mini-width;
  145. &.text-sm {
  146. height: $main-header-height-sm;
  147. }
  148. }
  149. .main-sidebar:hover {
  150. .brand-link {
  151. transition: width $transition-speed $transition-fn;
  152. width: $sidebar-width;
  153. }
  154. }
  155. }
  156. .brand-link {
  157. overflow: hidden;
  158. position: fixed;
  159. top: 0;
  160. transition: width $transition-speed $transition-fn;
  161. width: $sidebar-width;
  162. z-index: $zindex-main-header + 1;
  163. }
  164. // Sidebar variants brand-link fix
  165. @each $name, $color in $theme-colors {
  166. .sidebar-dark-#{$name} .brand-link:not([class*="navbar"]) {
  167. background-color: $sidebar-dark-bg;
  168. }
  169. .sidebar-light-#{$name} .brand-link:not([class*="navbar"]) {
  170. background-color: $sidebar-light-bg;
  171. }
  172. }
  173. .content-wrapper {
  174. margin-top: $main-header-height;
  175. }
  176. .main-header.text-sm ~ .content-wrapper {
  177. margin-top: $main-header-height-sm;
  178. }
  179. .main-header {
  180. left: 0;
  181. position: fixed;
  182. right: 0;
  183. top: 0;
  184. z-index: $zindex-main-sidebar - 1;
  185. }
  186. }
  187. .layout#{$infix}-navbar-not-fixed & {
  188. .brand-link {
  189. position: static;
  190. }
  191. .sidebar,
  192. .content-wrapper {
  193. margin-top: 0;
  194. }
  195. .main-header {
  196. position: static;
  197. }
  198. }
  199. .layout#{$infix}-navbar-not-fixed.layout-fixed & {
  200. .sidebar {
  201. margin-top: 0;
  202. }
  203. }
  204. }
  205. }
  206. .layout-footer-fixed & {
  207. .control-sidebar {
  208. bottom: 0;
  209. }
  210. }
  211. .layout-footer-fixed & {
  212. .main-footer {
  213. bottom: 0;
  214. left: 0;
  215. position: fixed;
  216. right: 0;
  217. z-index: $zindex-main-footer;
  218. }
  219. }
  220. .layout-footer-not-fixed & {
  221. .main-footer {
  222. position: static;
  223. }
  224. .content-wrapper {
  225. margin-bottom: 0;
  226. }
  227. }
  228. @each $breakpoint in map-keys($grid-breakpoints) {
  229. @include media-breakpoint-up($breakpoint) {
  230. $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
  231. .layout#{$infix}-footer-fixed & {
  232. .control-sidebar {
  233. bottom: 0;
  234. }
  235. }
  236. .layout#{$infix}-footer-fixed & {
  237. .main-footer {
  238. bottom: 0;
  239. left: 0;
  240. position: fixed;
  241. right: 0;
  242. z-index: $zindex-main-footer;
  243. }
  244. .content-wrapper {
  245. margin-bottom: $main-footer-height;
  246. }
  247. }
  248. .layout#{$infix}-footer-not-fixed & {
  249. .main-footer {
  250. position: static;
  251. }
  252. }
  253. }
  254. }
  255. .layout-top-nav & {
  256. margin-left: 0;
  257. & .main-sidebar {
  258. bottom: inherit;
  259. height: inherit;
  260. }
  261. .brand-image {
  262. height: 33px;
  263. }
  264. & .main-sidebar {
  265. display: none;
  266. }
  267. & .content-wrapper,
  268. & .main-header,
  269. & .main-footer {
  270. margin-left: 0;
  271. }
  272. }
  273. }
  274. .content-wrapper,
  275. .main-footer,
  276. .main-header {
  277. @include media-breakpoint-up(sm) {
  278. @include transition(margin-left $transition-speed $transition-fn);
  279. margin-left: $sidebar-width;
  280. z-index: 3000;
  281. .sidebar-collapse & {
  282. margin-left: 0;
  283. }
  284. }
  285. @include media-breakpoint-down(sm) {
  286. &,
  287. &::before {
  288. margin-left: 0;
  289. }
  290. }
  291. }
  292. .content-wrapper {
  293. background: $main-bg;
  294. > .content {
  295. padding: $content-padding-y $content-padding-x;
  296. }
  297. }
  298. .main-sidebar {
  299. &,
  300. &::before {
  301. $local-sidebar-transition: margin-left $transition-speed $transition-fn, width $transition-speed $transition-fn;
  302. @include transition($local-sidebar-transition);
  303. width: $sidebar-width;
  304. }
  305. .sidebar-collapse & {
  306. &,
  307. &::before {
  308. margin-left: -$sidebar-width;
  309. }
  310. .nav-sidebar.nav-child-indent .nav-treeview {
  311. padding: 0;
  312. }
  313. }
  314. @include media-breakpoint-down(sm) {
  315. &,
  316. &::before {
  317. box-shadow: none !important;
  318. margin-left: -$sidebar-width;
  319. }
  320. .sidebar-open & {
  321. &,
  322. &::before {
  323. margin-left: 0;
  324. }
  325. }
  326. }
  327. }
  328. :not(.layout-fixed) {
  329. .main-sidebar {
  330. height: inherit;
  331. min-height: 100%;
  332. position: absolute;
  333. top: 0;
  334. }
  335. }
  336. .layout-fixed {
  337. .brand-link {
  338. width: $sidebar-width;
  339. }
  340. .main-sidebar {
  341. bottom: 0;
  342. float: none;
  343. height: 100vh;
  344. left: 0;
  345. position: fixed;
  346. top: 0;
  347. }
  348. .control-sidebar {
  349. bottom: 0;
  350. float: none;
  351. height: 100vh;
  352. position: fixed;
  353. top: 0;
  354. .control-sidebar-content {
  355. height: calc(100vh - #{$main-header-height});
  356. }
  357. }
  358. }
  359. .main-footer {
  360. background: $main-footer-bg;
  361. border-top: $main-footer-border-top;
  362. color: lighten($gray-700, 25%);
  363. padding: $main-footer-padding;
  364. &.text-sm {
  365. padding: $main-footer-padding * .812;
  366. }
  367. }
  368. .content-header {
  369. padding: 15px $content-padding-x;
  370. h1 {
  371. font-size: 1.8rem;
  372. margin: 0;
  373. }
  374. .breadcrumb {
  375. background: transparent;
  376. line-height: 1.8rem;
  377. margin-bottom: 0;
  378. padding: 0;
  379. }
  380. }
  381. .hold-transition {
  382. .content-wrapper,
  383. .main-header,
  384. .main-sidebar,
  385. .main-sidebar *,
  386. .control-sidebar,
  387. .control-sidebar *,
  388. .main-footer {
  389. transition: none !important;
  390. }
  391. }