_layout.scss 6.5 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
    &.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;
        }
      }
    }

53 54 55 56
    &.fixed {
      .sidebar {
        margin-top: $main-header-height;
      }
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
    }

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

    .main-header {
84
      left: 0;
R
REJack 已提交
85 86
      position: fixed;
      right: 0;
87 88
      top: 0;
      z-index: $zindex-main-sidebar - 1;
R
REJack 已提交
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
  .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;
            }
          }
        }

127 128 129 130
        &.fixed {
          .sidebar {
            margin-top: $main-header-height;
          }
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
        }

        .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 已提交
184 185 186
  .layout-footer-fixed & {
    .main-footer {
      bottom: 0;
187
      left: 0;
188 189 190
      position: fixed;
      right: 0;
      z-index: $zindex-main-sidebar - 1;
R
REJack 已提交
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 225 226 227 228
  .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 已提交
229

R
REJack 已提交
230 231 232 233 234 235 236 237 238 239 240 241 242
  .layout-top-nav & {
    margin-left: 0;


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

    .brand-image {
      height: 33px;
    }

243
    & .main-sidebar {
R
REJack 已提交
244 245 246 247 248 249 250 251
      display: none;
    }

    & .content-wrapper,
    & .main-header,
    & .main-footer {
      margin-left: 0;
    }
A
Abdullah Almsaeed 已提交
252 253 254 255
  }
}

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

A
Abdullah Almsaeed 已提交
261 262
    margin-left: $sidebar-width;
    z-index: 3000;
263

A
Abdullah Almsaeed 已提交
264 265 266
    .sidebar-collapse & {
      margin-left: 0;
    }
A
Abdullah Almsaeed 已提交
267
  }
268

R
REJack 已提交
269
  @include media-breakpoint-down(sm) {
A
Abdullah Almsaeed 已提交
270
    &,
271
    &::before {
A
Abdullah Almsaeed 已提交
272 273 274
      margin-left: 0;
    }
  }
A
Abdullah Almsaeed 已提交
275 276
}

A
Abdullah Almsaeed 已提交
277 278
.content-wrapper {
  background: $main-bg;
A
Abdullah Almsaeed 已提交
279

A
Abdullah Almsaeed 已提交
280
  > .content {
A
Abdullah Almsaeed 已提交
281
    padding: $content-padding-y $content-padding-x;
A
Abdullah Almsaeed 已提交
282 283 284
  }
}

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

A
Abdullah Almsaeed 已提交
293 294
  .sidebar-collapse & {
    &,
295
    &::before {
A
Abdullah Almsaeed 已提交
296 297 298
      margin-left: -$sidebar-width;
    }
  }
A
Abdullah Almsaeed 已提交
299

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

    .sidebar-open & {
      &,
309
      &::before {
A
Abdullah Almsaeed 已提交
310 311 312
        margin-left: 0;
      }
    }
A
Abdullah Almsaeed 已提交
313
  }
A
Abdullah Almsaeed 已提交
314 315
}

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

.layout-fixed {
  .main-sidebar {
327 328
    bottom: 0;
    float: none;
R
REJack 已提交
329
    height: 100vh;
330
    left: 0;
R
REJack 已提交
331 332
    position: fixed;
    top: 0;
333
  }
R
REJack 已提交
334 335
}

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

A
Abdullah Almsaeed 已提交
343
.content-header {
A
Abdullah Almsaeed 已提交
344 345
  padding: 15px $content-padding-x;

A
Abdullah Almsaeed 已提交
346 347 348
  h1 {
    font-size: 1.8rem;
    margin: 0;
A
Abdullah Almsaeed 已提交
349
  }
350

A
Abdullah Almsaeed 已提交
351 352 353
  .breadcrumb {
    background: transparent;
    line-height: 1.8rem;
354 355
    margin-bottom: 0;
    padding: 0;
A
Abdullah Almsaeed 已提交
356
  }
A
Abdullah Almsaeed 已提交
357 358 359 360 361 362
}

.hold-transition {
  .content-wrapper,
  .main-header,
  .main-footer {
363
    transition: none !important;
A
Abdullah Almsaeed 已提交
364 365
  }
}