_layout.scss 6.4 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
  .layout-navbar-fixed & {
38 39 40 41 42 43 44 45 46 47 48 49 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
    &.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;
        }
      }
    }

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

    .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 已提交
77
    .content-wrapper {
78
      margin-top: $main-header-height;
R
REJack 已提交
79 80 81
    }

    .main-header {
82
      left: 0;
R
REJack 已提交
83 84
      position: fixed;
      right: 0;
85 86
      top: 0;
      z-index: $zindex-main-sidebar - 1;
R
REJack 已提交
87 88 89
    }
  }

90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 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
  .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);

      .layout#{$infix}-navbar-fixed & {
        &.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;
            }
          }
        }

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

        .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 已提交
180 181 182
  .layout-footer-fixed & {
    .main-footer {
      bottom: 0;
183
      left: 0;
184 185 186
      position: fixed;
      right: 0;
      z-index: $zindex-main-sidebar - 1;
R
REJack 已提交
187 188 189
    }
  }

190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
  .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 已提交
225

R
REJack 已提交
226 227 228 229 230 231 232 233 234 235 236 237 238
  .layout-top-nav & {
    margin-left: 0;


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

    .brand-image {
      height: 33px;
    }

239
    & .main-sidebar {
R
REJack 已提交
240 241 242 243 244 245 246 247
      display: none;
    }

    & .content-wrapper,
    & .main-header,
    & .main-footer {
      margin-left: 0;
    }
A
Abdullah Almsaeed 已提交
248 249 250 251
  }
}

.content-wrapper,
A
Abdullah Almsaeed 已提交
252 253
.main-footer,
.main-header {
R
REJack 已提交
254
  @include media-breakpoint-up(sm) {
A
Abdullah Almsaeed 已提交
255 256
    @include transition(margin-left $transition-speed $transition-fn);

A
Abdullah Almsaeed 已提交
257 258
    margin-left: $sidebar-width;
    z-index: 3000;
259

A
Abdullah Almsaeed 已提交
260 261 262
    .sidebar-collapse & {
      margin-left: 0;
    }
A
Abdullah Almsaeed 已提交
263
  }
264

R
REJack 已提交
265
  @include media-breakpoint-down(sm) {
A
Abdullah Almsaeed 已提交
266
    &,
267
    &::before {
A
Abdullah Almsaeed 已提交
268 269 270
      margin-left: 0;
    }
  }
A
Abdullah Almsaeed 已提交
271 272
}

A
Abdullah Almsaeed 已提交
273 274
.content-wrapper {
  background: $main-bg;
A
Abdullah Almsaeed 已提交
275

A
Abdullah Almsaeed 已提交
276
  > .content {
A
Abdullah Almsaeed 已提交
277
    padding: $content-padding-y $content-padding-x;
A
Abdullah Almsaeed 已提交
278 279 280
  }
}

A
Abdullah Almsaeed 已提交
281
.main-sidebar {
A
Abdullah Almsaeed 已提交
282
  &,
283
  &::before {
284 285
    $local-sidebar-transition: margin-left $transition-speed $transition-fn, width $transition-speed $transition-fn;
    @include transition($local-sidebar-transition);
A
Abdullah Almsaeed 已提交
286 287 288
    width: $sidebar-width;
  }

A
Abdullah Almsaeed 已提交
289 290
  .sidebar-collapse & {
    &,
291
    &::before {
A
Abdullah Almsaeed 已提交
292 293 294
      margin-left: -$sidebar-width;
    }
  }
A
Abdullah Almsaeed 已提交
295

R
REJack 已提交
296
  @include media-breakpoint-down(sm) {
A
Abdullah Almsaeed 已提交
297
    &,
298 299
    &::before {
      box-shadow: none !important;
A
Abdullah Almsaeed 已提交
300 301
      margin-left: -$sidebar-width;
    }
A
Abdullah Almsaeed 已提交
302 303 304

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

R
REJack 已提交
312 313 314 315
:not(.layout-fixed) {
  .main-sidebar {
    height: inherit;
    min-height: 100%;
316 317
    position: absolute;
    top: 0;
R
REJack 已提交
318 319 320 321 322
  }
}

.layout-fixed {
  .main-sidebar {
323 324
    bottom: 0;
    float: none;
R
REJack 已提交
325
    height: 100vh;
326
    left: 0;
R
REJack 已提交
327 328
    position: fixed;
    top: 0;
329
  }
R
REJack 已提交
330 331
}

A
Abdullah Almsaeed 已提交
332
.main-footer {
A
Abdullah Almsaeed 已提交
333
  background: $main-footer-bg;
334 335 336
  border-top: $main-footer-border-top;
  color: lighten($gray-700, 25%);
  padding: $main-footer-padding;
A
Abdullah Almsaeed 已提交
337 338
}

A
Abdullah Almsaeed 已提交
339
.content-header {
A
Abdullah Almsaeed 已提交
340 341
  padding: 15px $content-padding-x;

A
Abdullah Almsaeed 已提交
342 343 344
  h1 {
    font-size: 1.8rem;
    margin: 0;
A
Abdullah Almsaeed 已提交
345
  }
346

A
Abdullah Almsaeed 已提交
347 348 349
  .breadcrumb {
    background: transparent;
    line-height: 1.8rem;
350 351
    margin-bottom: 0;
    padding: 0;
A
Abdullah Almsaeed 已提交
352
  }
A
Abdullah Almsaeed 已提交
353 354 355 356 357 358
}

.hold-transition {
  .content-wrapper,
  .main-header,
  .main-footer {
359
    transition: none !important;
A
Abdullah Almsaeed 已提交
360 361
  }
}