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

A
Abdullah Almsaeed 已提交
6 7 8
html,
body,
.wrapper {
A
Abdullah Almsaeed 已提交
9
  min-height: 100%;
A
Abdullah Almsaeed 已提交
10 11 12 13
  overflow-x: hidden;
}

.wrapper {
R
REJack 已提交
14
  overflow: hidden;
15 16
  position: relative;

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

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

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

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

R
REJack 已提交
35 36 37 38 39 40
  .layout-navbar-fixed & {
    .content-wrapper {
      margin-top: 57px;
    }

    .main-header {
41
      left: 0;
R
REJack 已提交
42 43
      position: fixed;
      right: 0;
44 45
      top: 0;
      z-index: $zindex-main-sidebar - 1;
R
REJack 已提交
46 47 48 49 50 51
    }
  }

  .layout-footer-fixed & {
    .main-footer {
      bottom: 0;
52
      left: 0;
53 54 55
      position: fixed;
      right: 0;
      z-index: $zindex-main-sidebar - 1;
R
REJack 已提交
56 57 58 59
    }
  }


R
REJack 已提交
60 61 62 63 64 65 66 67 68 69 70 71 72
  .layout-top-nav & {
    margin-left: 0;


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

    .brand-image {
      height: 33px;
    }

73
    & .main-sidebar {
R
REJack 已提交
74 75 76 77 78 79 80 81
      display: none;
    }

    & .content-wrapper,
    & .main-header,
    & .main-footer {
      margin-left: 0;
    }
A
Abdullah Almsaeed 已提交
82 83 84 85
  }
}

.content-wrapper,
A
Abdullah Almsaeed 已提交
86 87
.main-footer,
.main-header {
R
REJack 已提交
88
  @include media-breakpoint-up(sm) {
A
Abdullah Almsaeed 已提交
89 90
    @include transition(margin-left $transition-speed $transition-fn);

A
Abdullah Almsaeed 已提交
91 92
    margin-left: $sidebar-width;
    z-index: 3000;
93

A
Abdullah Almsaeed 已提交
94 95 96
    .sidebar-collapse & {
      margin-left: 0;
    }
A
Abdullah Almsaeed 已提交
97
  }
98

R
REJack 已提交
99
  @include media-breakpoint-down(sm) {
A
Abdullah Almsaeed 已提交
100
    &,
101
    &::before {
A
Abdullah Almsaeed 已提交
102 103 104
      margin-left: 0;
    }
  }
A
Abdullah Almsaeed 已提交
105 106
}

A
Abdullah Almsaeed 已提交
107 108
.content-wrapper {
  background: $main-bg;
A
Abdullah Almsaeed 已提交
109

A
Abdullah Almsaeed 已提交
110
  > .content {
A
Abdullah Almsaeed 已提交
111
    padding: $content-padding-y $content-padding-x;
A
Abdullah Almsaeed 已提交
112 113 114
  }
}

A
Abdullah Almsaeed 已提交
115
.main-sidebar {
A
Abdullah Almsaeed 已提交
116
  &,
117
  &::before {
118 119
    $local-sidebar-transition: margin-left $transition-speed $transition-fn, width $transition-speed $transition-fn;
    @include transition($local-sidebar-transition);
A
Abdullah Almsaeed 已提交
120 121 122
    width: $sidebar-width;
  }

A
Abdullah Almsaeed 已提交
123 124
  .sidebar-collapse & {
    &,
125
    &::before {
A
Abdullah Almsaeed 已提交
126 127 128
      margin-left: -$sidebar-width;
    }
  }
A
Abdullah Almsaeed 已提交
129

R
REJack 已提交
130
  @include media-breakpoint-down(sm) {
A
Abdullah Almsaeed 已提交
131
    &,
132 133
    &::before {
      box-shadow: none !important;
A
Abdullah Almsaeed 已提交
134 135
      margin-left: -$sidebar-width;
    }
A
Abdullah Almsaeed 已提交
136 137 138

    .sidebar-open & {
      &,
139
      &::before {
A
Abdullah Almsaeed 已提交
140 141 142
        margin-left: 0;
      }
    }
A
Abdullah Almsaeed 已提交
143
  }
A
Abdullah Almsaeed 已提交
144 145
}

R
REJack 已提交
146 147 148 149
:not(.layout-fixed) {
  .main-sidebar {
    height: inherit;
    min-height: 100%;
150 151
    position: absolute;
    top: 0;
R
REJack 已提交
152 153 154 155 156 157 158
  }
}

.layout-navbar-fixed {

  &.sidebar-collapse {
    .brand-link {
159
      height: 57px;
160
      transition: width $transition-speed $transition-fn;
R
REJack 已提交
161 162 163 164 165
      width: $sidebar-mini-width;
    }

    .main-sidebar:hover {
      .brand-link {
166
        transition: width $transition-speed $transition-fn;
R
REJack 已提交
167 168 169 170 171 172 173 174 175 176
        width: $sidebar-width;
      }
    }
  }

  .sidebar {
    margin-top: 57px;
  }

  .brand-link {
177
    overflow: hidden;
178
    position: fixed;
R
REJack 已提交
179
    top: 0;
180
    transition: width $transition-speed $transition-fn;
R
REJack 已提交
181
    width: $sidebar-width;
182
    z-index: $zindex-main-sidebar + 1;
R
REJack 已提交
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
  }

  // Sidebar variants
  @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;
    }
  }
}

.layout-fixed {
  .main-sidebar {
199 200
    bottom: 0;
    float: none;
R
REJack 已提交
201
    height: 100vh;
202
    left: 0;
R
REJack 已提交
203 204
    position: fixed;
    top: 0;
205
  }
R
REJack 已提交
206 207 208
}


A
Abdullah Almsaeed 已提交
209
.main-footer {
A
Abdullah Almsaeed 已提交
210
  background: $main-footer-bg;
211 212 213
  border-top: $main-footer-border-top;
  color: lighten($gray-700, 25%);
  padding: $main-footer-padding;
A
Abdullah Almsaeed 已提交
214 215
}

A
Abdullah Almsaeed 已提交
216
.content-header {
A
Abdullah Almsaeed 已提交
217 218
  padding: 15px $content-padding-x;

A
Abdullah Almsaeed 已提交
219 220 221
  h1 {
    font-size: 1.8rem;
    margin: 0;
A
Abdullah Almsaeed 已提交
222
  }
223

A
Abdullah Almsaeed 已提交
224 225 226
  .breadcrumb {
    background: transparent;
    line-height: 1.8rem;
227 228
    margin-bottom: 0;
    padding: 0;
A
Abdullah Almsaeed 已提交
229
  }
A
Abdullah Almsaeed 已提交
230 231 232 233 234 235
}

.hold-transition {
  .content-wrapper,
  .main-header,
  .main-footer {
236
    transition: none !important;
A
Abdullah Almsaeed 已提交
237 238
  }
}