_layout.scss 6.9 KB
Newer Older
A
Abdullah Almsaeed 已提交
1
/*
2 3
 * Core: Layout
 * ------------
A
Abdullah Almsaeed 已提交
4
 */
5

6 7 8 9
html {
  scroll-behavior: smooth;
}

A
Abdullah Almsaeed 已提交
10 11 12
html,
body,
.wrapper {
A
Abdullah Almsaeed 已提交
13
  min-height: 100%;
A
Abdullah Almsaeed 已提交
14 15 16
}

.wrapper {
17 18
  position: relative;

R
REJack 已提交
19 20 21 22
  & .content-wrapper {
    min-height: calc(100vh - 112px);
  }

A
Abdullah Almsaeed 已提交
23
  .layout-boxed & {
24
    @include box-shadow(0 0 10px rgba($black, .3));
A
Abdullah Almsaeed 已提交
25

A
Abdullah Almsaeed 已提交
26
    &,
27
    &::before {
A
Abdullah Almsaeed 已提交
28 29 30
      margin: 0 auto;
      max-width: $boxed-layout-max-width;
    }
R
REJack 已提交
31 32 33 34 35 36

    & .main-sidebar {
      left: inherit;
    }
  }

R
REJack 已提交
37 38 39 40 41 42
  .layout-navbar-fixed.layout-fixed & {
    .sidebar {
      margin-top: $main-header-height;
    }
  }

R
REJack 已提交
43
  .layout-navbar-fixed & {
R
REJack 已提交
44 45 46 47 48 49
    a.anchor {
      display: block;
      position: relative;
      top: calc((#{$main-header-height-inner} + #{$main-header-bottom-border-width} + (#{$main-header-link-padding-y} * 2)) / -1);
    }

50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
    &.sidebar-collapse {
      .brand-link {
        height: $main-header-height;
        transition: width $transition-speed $transition-fn;
        width: $sidebar-mini-width;
      }

      .main-sidebar:hover {
        .brand-link {
          transition: width $transition-speed $transition-fn;
          width: $sidebar-width;
        }
      }
    }

    .brand-link {
      overflow: hidden;
      position: fixed;
      top: 0;
      transition: width $transition-speed $transition-fn;
      width: $sidebar-width;
      z-index: $zindex-main-sidebar + 1;
    }

    // Sidebar variants brand-link fix
    @each $name, $color in $theme-colors {
      .sidebar-dark-#{$name} .brand-link {
        background-color: $sidebar-dark-bg;
      }

      .sidebar-light-#{$name} .brand-link {
        background-color: $sidebar-light-bg;
      }
    }

R
REJack 已提交
85
    .content-wrapper {
86
      margin-top: $main-header-height;
R
REJack 已提交
87 88 89
    }

    .main-header {
90
      left: 0;
R
REJack 已提交
91 92
      position: fixed;
      right: 0;
93 94
      top: 0;
      z-index: $zindex-main-sidebar - 1;
R
REJack 已提交
95 96 97
    }
  }

98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
  .layout-navbar-not-fixed & {
    .brand-link {
      position: static;
    }

    .sidebar,
    .content-wrapper {
      margin-top: 0px;
    }

    .main-header {
      position: static;
    }
  }

  @each $breakpoint in map-keys($grid-breakpoints) {
    @include media-breakpoint-up($breakpoint) {
      $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

R
REJack 已提交
117 118 119 120 121 122
      .layout#{$infix}-navbar-fixed.layout-fixed & {
        .sidebar {
          margin-top: $main-header-height;
        }
      }

123
      .layout#{$infix}-navbar-fixed & {
R
REJack 已提交
124 125 126 127 128 129
        a.anchor {
          display: block;
          position: relative;
          top: calc((#{$main-header-height-inner} + #{$main-header-bottom-border-width} + (#{$main-header-link-padding-y} * 2)) / -1);
        }

130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
        &.sidebar-collapse {
          .brand-link {
            height: $main-header-height;
            transition: width $transition-speed $transition-fn;
            width: $sidebar-mini-width;
          }

          .main-sidebar:hover {
            .brand-link {
              transition: width $transition-speed $transition-fn;
              width: $sidebar-width;
            }
          }
        }

        .brand-link {
          overflow: hidden;
          position: fixed;
          top: 0;
          transition: width $transition-speed $transition-fn;
          width: $sidebar-width;
          z-index: $zindex-main-sidebar + 1;
        }

        // Sidebar variants brand-link fix
        @each $name, $color in $theme-colors {
          .sidebar-dark-#{$name} .brand-link {
            background-color: $sidebar-dark-bg;
          }

          .sidebar-light-#{$name} .brand-link {
            background-color: $sidebar-light-bg;
          }
        }

        .content-wrapper {
          margin-top: $main-header-height;
        }

        .main-header {
          left: 0;
          position: fixed;
          right: 0;
          top: 0;
          z-index: $zindex-main-sidebar - 1;
        }
      }

      .layout#{$infix}-navbar-not-fixed & {
        .brand-link {
          position: static;
        }

        .sidebar,
        .content-wrapper {
          margin-top: 0px;
        }

        .main-header {
          position: static;
        }
      }

    }
  }

R
REJack 已提交
196 197 198
  .layout-footer-fixed & {
    .main-footer {
      bottom: 0;
199
      left: 0;
200 201 202
      position: fixed;
      right: 0;
      z-index: $zindex-main-sidebar - 1;
R
REJack 已提交
203 204 205
    }
  }

206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
  .layout-footer-not-fixed & {
    .main-footer {
      position: static;
    }

    .content-wrapper {
      margin-bottom: 0px;
    }
  }

  @each $breakpoint in map-keys($grid-breakpoints) {
    @include media-breakpoint-up($breakpoint) {
      $infix: breakpoint-infix($breakpoint, $grid-breakpoints);

      .layout#{$infix}-footer-fixed & {
        .main-footer {
          bottom: 0;
          left: 0;
          position: fixed;
          right: 0;
          z-index: $zindex-main-sidebar - 1;
        }

        .content-wrapper {
          margin-bottom: $main-footer-height;
        }
      }

      .layout#{$infix}-footer-not-fixed & {
        .main-footer {
          position: static;
        }
      }
    }
  }
R
REJack 已提交
241

R
REJack 已提交
242 243 244 245 246 247 248 249 250 251 252 253 254
  .layout-top-nav & {
    margin-left: 0;


    & .main-sidebar {
      bottom: inherit;
      height: inherit;
    }

    .brand-image {
      height: 33px;
    }

255
    & .main-sidebar {
R
REJack 已提交
256 257 258 259 260 261 262 263
      display: none;
    }

    & .content-wrapper,
    & .main-header,
    & .main-footer {
      margin-left: 0;
    }
A
Abdullah Almsaeed 已提交
264 265 266 267
  }
}

.content-wrapper,
A
Abdullah Almsaeed 已提交
268 269
.main-footer,
.main-header {
R
REJack 已提交
270
  @include media-breakpoint-up(sm) {
A
Abdullah Almsaeed 已提交
271 272
    @include transition(margin-left $transition-speed $transition-fn);

A
Abdullah Almsaeed 已提交
273 274
    margin-left: $sidebar-width;
    z-index: 3000;
275

A
Abdullah Almsaeed 已提交
276 277 278
    .sidebar-collapse & {
      margin-left: 0;
    }
A
Abdullah Almsaeed 已提交
279
  }
280

R
REJack 已提交
281
  @include media-breakpoint-down(sm) {
A
Abdullah Almsaeed 已提交
282
    &,
283
    &::before {
A
Abdullah Almsaeed 已提交
284 285 286
      margin-left: 0;
    }
  }
A
Abdullah Almsaeed 已提交
287 288
}

A
Abdullah Almsaeed 已提交
289 290
.content-wrapper {
  background: $main-bg;
A
Abdullah Almsaeed 已提交
291

A
Abdullah Almsaeed 已提交
292
  > .content {
A
Abdullah Almsaeed 已提交
293
    padding: $content-padding-y $content-padding-x;
A
Abdullah Almsaeed 已提交
294 295 296
  }
}

A
Abdullah Almsaeed 已提交
297
.main-sidebar {
A
Abdullah Almsaeed 已提交
298
  &,
299
  &::before {
300 301
    $local-sidebar-transition: margin-left $transition-speed $transition-fn, width $transition-speed $transition-fn;
    @include transition($local-sidebar-transition);
A
Abdullah Almsaeed 已提交
302 303 304
    width: $sidebar-width;
  }

A
Abdullah Almsaeed 已提交
305 306
  .sidebar-collapse & {
    &,
307
    &::before {
A
Abdullah Almsaeed 已提交
308 309 310
      margin-left: -$sidebar-width;
    }
  }
A
Abdullah Almsaeed 已提交
311

R
REJack 已提交
312
  @include media-breakpoint-down(sm) {
A
Abdullah Almsaeed 已提交
313
    &,
314 315
    &::before {
      box-shadow: none !important;
A
Abdullah Almsaeed 已提交
316 317
      margin-left: -$sidebar-width;
    }
A
Abdullah Almsaeed 已提交
318 319 320

    .sidebar-open & {
      &,
321
      &::before {
A
Abdullah Almsaeed 已提交
322 323 324
        margin-left: 0;
      }
    }
A
Abdullah Almsaeed 已提交
325
  }
A
Abdullah Almsaeed 已提交
326 327
}

R
REJack 已提交
328 329 330 331
:not(.layout-fixed) {
  .main-sidebar {
    height: inherit;
    min-height: 100%;
332 333
    position: absolute;
    top: 0;
R
REJack 已提交
334 335 336 337 338
  }
}

.layout-fixed {
  .main-sidebar {
339 340
    bottom: 0;
    float: none;
R
REJack 已提交
341
    height: 100vh;
342
    left: 0;
R
REJack 已提交
343 344
    position: fixed;
    top: 0;
345
  }
R
REJack 已提交
346 347
}

A
Abdullah Almsaeed 已提交
348
.main-footer {
A
Abdullah Almsaeed 已提交
349
  background: $main-footer-bg;
350 351 352
  border-top: $main-footer-border-top;
  color: lighten($gray-700, 25%);
  padding: $main-footer-padding;
A
Abdullah Almsaeed 已提交
353 354
}

A
Abdullah Almsaeed 已提交
355
.content-header {
A
Abdullah Almsaeed 已提交
356 357
  padding: 15px $content-padding-x;

A
Abdullah Almsaeed 已提交
358 359 360
  h1 {
    font-size: 1.8rem;
    margin: 0;
A
Abdullah Almsaeed 已提交
361
  }
362

A
Abdullah Almsaeed 已提交
363 364 365
  .breadcrumb {
    background: transparent;
    line-height: 1.8rem;
366 367
    margin-bottom: 0;
    padding: 0;
A
Abdullah Almsaeed 已提交
368
  }
A
Abdullah Almsaeed 已提交
369 370 371 372 373 374
}

.hold-transition {
  .content-wrapper,
  .main-header,
  .main-footer {
375
    transition: none !important;
A
Abdullah Almsaeed 已提交
376 377
  }
}