_layout.scss 7.1 KB

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