_layout.scss 6.5 KB

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