_layouts.scss 6.32 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
// Open edX: Studio layout
// =======================
//
// Note: these styles replicate the Studio styles directly
// rather than benefiting from any Bootstrap classes. Ideally
// the layouts should be reimagined using Bootstrap and then
// these styles will no longer be necessary.

.content-wrapper {
  margin-top: $baseline;

  .course-tabs {
    padding-bottom: 0;

    .nav-item {
16 17
      &.active,
      &:hover {
18
        .nav-link {
19 20
          border-bottom-color: theme-color("primary");
          color: theme-color("primary");
21 22 23 24 25 26 27 28 29
        }
      }

      .nav-link {
        padding: $baseline/2 $baseline*3/4 $baseline*13/20;
        border-style: solid;
        border-width: 0 0 $baseline/5 0;
        border-bottom-color: transparent;

30
        @include media-breakpoint-down(md) {
31 32 33 34 35 36 37 38 39
          border: none;
          text-align: left;
          padding: 0 0 $baseline/2 0;
        }
      }
    }
  }

  .main-container {
40
    border: 1px solid $border-color;
41 42 43
    background-color: $body-bg;

    .page-header {
44
      border-bottom: 1px solid $border-color;
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
      padding: 20px;
    }

    .page-content {
      padding: 20px;
    }
  }

  &.container-fluid {
    max-width: $studio-max-width;
  }
}

// studio - elements - layouts
// ====================

// layout - basic page header
.wrapper-mast {
  margin: ($baseline*1.5) 0 0 0;
  padding: 0 $baseline;
  position: relative;

  .mast,
  .metadata {
    @include clearfix();
70

71 72 73 74
    position: relative;
    max-width: $studio-max-width;
    width: flex-grid(12);
    margin: 0 auto $baseline auto;
75
    color: $body-color;
76 77 78
  }

  .mast {
79
    border-bottom: 1px solid $border-color;
80 81 82 83
    padding-bottom: ($baseline/2);

    // layout without actions
    .page-header {
84 85 86 87 88 89 90
      display: flex;
      flex-direction: column;

      .subtitle {
        font-size: $font-size-base;
        margin-bottom: $baseline/4;
      }
91 92 93 94 95 96 97 98
    }

    // layout with actions
    &.has-actions {
      @include clearfix();

      .page-header {
        float: left;
99
        width: flex-grid(6, 12);
100 101 102 103 104 105 106
        margin-right: flex-gutter();
      }

      .nav-actions {
        position: relative;
        bottom: -($baseline*0.75);
        float: right;
107
        width: flex-grid(6, 12);
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
        text-align: right;

        .nav-item {
          display: inline-block;
          vertical-align: top;
          margin-right: ($baseline/2);

          &:last-child {
            margin-right: 0;
          }
        }

        // buttons
        .button {
          @extend %btn-primary-blue;
          @extend %sizing;

          .action-button-text {
            display: inline-block;
            vertical-align: baseline;
          }

          .icon {
            display: inline-block;
            vertical-align: baseline;
          }

          // CASE: new/create button
          &.new-button,
          &.button-new {
            @extend %btn-primary-green;
            @extend %sizing;
          }
        }
      }
    }

    // layout with actions
    &.has-subtitle {
      .nav-actions {
        bottom: -($baseline*1.5);
      }
    }

    // layout with breadcrumb navigation
    &.has-navigation {
      .nav-actions {
        bottom: -($baseline*1.5);
      }

      .navigation-item {
        @extend %cont-truncated;
160

161 162 163
        display: inline-block;
        vertical-align: bottom; // correct for extra padding in FF
        max-width: 250px;
164
        color: $body-color;
165 166 167

        &.navigation-current {
          @extend %ui-disabled;
168

169
          color: color("gray");
170 171
          max-width: 250px;

172
          &::before {
173
            color: color("gray");
174 175 176 177 178
          }
        }
      }

      .navigation-link:hover {
179
        color: theme-color("primary");
180 181
      }

182
      .navigation-item::before {
183 184
        content: " / ";
        margin: ($baseline/4);
185
        color: color("gray");
186 187

        &:hover {
188
          color: color("gray");
189 190 191
        }
      }

192
      .navigation .navigation-item:first-child::before {
193 194 195 196 197 198 199 200 201 202
        content: "";
        margin: 0;
      }
    }
  }

  // CASE: wizard-based mast
  .mast-wizard {
    .page-header-sub {
      @extend %t-title4;
203

204
      color: color("gray");
205 206 207 208 209
      font-weight: 300;
    }

    .page-header-super {
      @extend %t-title4;
210

211
      float: left;
212
      width: flex-grid(12, 12);
213
      margin-top: ($baseline/2);
214
      border-top: 1px solid $border-color;
215 216 217 218 219 220 221 222
      padding-top: ($baseline/2);
      font-weight: 600;
    }
  }
}

// layout - basic page content
.wrapper-content {
223 224
  @include make-container();
  @include make-container-max-widths();
225 226
}

227
// Specify a two column layout for content
228
.content {
229 230 231 232 233 234 235 236 237 238 239 240 241
  @include make-row();

  @media (min-width: 576px) {
    .content-primary {
      flex: 0 0 66.67%;
      max-width: 66.67%;
    }

    .content-supplementary {
      flex: 0 0 25%;
      max-width: 25%;
    }
  }
242 243 244 245

  header {
    position: relative;
    margin-bottom: $baseline;
246
    border-bottom: 1px solid $gray-300;
247 248 249 250
    padding-bottom: ($baseline/2);

    .title-sub {
      @extend %t-copy-sub1;
251

252 253
      display: block;
      margin: 0;
254
      color: $gray-500;
255 256 257 258 259
    }

    .title-1 {
      @extend %t-title3;
      @extend %t-strong;
260

261 262
      margin: 0;
      padding: 0;
263
      color: theme-color("primary");
264 265 266 267 268 269
    }
  }
}

// layout - primary content
.content-primary {
270 271 272 273
  border: 1px solid theme-color("dark");
  background-color: theme-color("inverse");
  padding: $baseline ($baseline*1.5);
  margin-right: $baseline;
274 275 276 277 278 279 280

  .title-1 {
    @extend %t-title3;
  }

  .title-2 {
    @extend %t-title4;
281

282 283 284 285 286
    margin: 0 0 ($baseline/2) 0;
  }

  .title-3 {
    @extend %t-title6;
287

288 289 290 291 292 293 294 295 296 297 298 299 300 301
    margin: 0 0 ($baseline/2) 0;
  }

  header {
    @include clearfix();

    .title-2 {
      width: flex-grid(5, 12);
      margin: 0 flex-gutter() 0 0;
      float: left;
    }

    .tip {
      @extend %t-copy-sub2;
302

303 304 305 306
      width: flex-grid(7, 12);
      float: right;
      margin-top: ($baseline/2);
      text-align: right;
307
      color: theme-color("primary");
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
    }
  }
}

// layout - supplemental content
.content-supplementary {
  > section {
    margin: 0 0 $baseline 0;
  }
}

// ====================

// layout - grandfathered
.main-wrapper {
  position: relative;
  margin: 0 ($baseline*2);
}

.inner-wrapper {
  @include clearfix();
329

330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
  position: relative;
  max-width: 1280px;
  margin: auto;

  > article {
    clear: both;
  }
}

.main-column {
  clear: both;
  float: left;
  width: 70%;
}

.sidebar {
  float: right;
  width: 28%;
}

.left {
  float: left;
}

.right {
  float: right;
}