_modules.scss 15.5 KB
Newer Older
1 2 3 4 5
// studio - elements - content modules
// ====================
// Patterns for pieces of content - modules - used throughout the app

// basic gray module with a strong top border and title, with related content box attached
6
// --------------------
7 8 9 10 11 12 13
%bar-module {
  margin-bottom: $baseline;
  border-top: 5px solid $gray-l1;
  background-color: $white;

  .bar-mod-title {
    @extend %t-title6;
14
    @extend %t-strong;
15

16
    display: block;
17
    padding: ($baseline/2) ($baseline*0.75);
18
    background-color: $gray-l4;
19 20 21 22
  }

  .bar-mod-content {
    @extend %t-copy-sub1;
23

24
    border-bottom: 1px solid $gray-l4;
25
    padding: ($baseline*0.75) ($baseline*0.75) $baseline ($baseline*0.75);
26 27

    .title {
28
      @extend %t-title8;
29
      @extend %t-strong;
30

31
      margin-bottom: ($baseline/4);
32
      color: $gray-d2;
33 34 35 36 37
      text-transform: uppercase;
    }

    .meta {
      @extend %t-copy-sub2;
38

39
      color: $gray-d2;
40 41 42 43 44
    }
  }
}

// blue bar and title bg version
45
// --------------------
46 47
%bar-module-blue {
  @extend %bar-module;
48

49 50 51 52 53 54 55 56
  border-top: 5px solid $blue;

  .bar-mod-title {
    background-color: $blue-t0;
  }
}

// green bar and title bg version
57
// --------------------
58 59
%bar-module-green {
  @extend %bar-module;
60

61 62 63 64 65 66 67 68
  border-top: 5px solid $green;

  .bar-mod-title {
    background-color: $green-l5;
  }
}

// yellow bar and title bg version
69
// --------------------
70 71
%bar-module-yellow {
  @extend %bar-module;
72

73 74 75 76 77 78 79 80
  border-top: 5px solid $orange-l2;

  .bar-mod-title {
    background-color: $orange-l5;
  }
}

// red bar and title bg version
81
// --------------------
82 83
%bar-module-red {
  @extend %bar-module;
84

85 86 87 88 89 90 91
  border-top: 5px solid $red-l2;

  .bar-mod-title {
    background-color: $red-l5;
  }
}

92 93 94
// black bar and title bg version
%bar-module-black {
  @extend %bar-module;
95

96 97 98 99 100 101 102
  border-top: 5px solid $black;

  .bar-mod-title {
    background-color: $gray-l4;
  }
}

103 104
// Add new component menu with big green buttons
// outermost wrapper for add a new component menu
105
// --------------------
106 107 108 109 110 111 112 113 114 115 116 117 118 119
.add-xblock-component {
  margin: $baseline ($baseline/2);
  border: 1px solid $gray-l3;
  border-radius: ($baseline/4);
  box-shadow: 0 1px 3px $shadow inset;
  background-color: $gray-l5;
  padding: ($baseline/2);

  // add component menu inner wrapper
  .new-component {
    text-align: center;

    h5 {
      @extend %t-title5;
120
      @extend %t-strong;
121

122
      margin-bottom: ($baseline*0.75);
123
      color: $uxpl-green-base;
124 125 126 127
    }

    // add component - list of green buttons
    .new-component-type {
128
      @include clearfix();
129 130 131 132 133 134 135 136

      li {
        display: inline-block;
      }

      // green button
      .add-xblock-component-button {
        @extend %t-action3;
137

138
        @include margin-right($baseline*0.75);
139

140 141 142 143 144
        position: relative;
        display: inline-block;
        width: ($baseline*5);
        height: ($baseline*5);
        margin-bottom: ($baseline/2);
145
        box-shadow: 0 1px 1px $shadow, 0 1px 0 rgba(255, 255, 255, 0.4) inset;
146
        border-radius: ($baseline/4);
147
        padding: 0;
148
        text-align: center;
149

150
        @extend %btn-primary-green;
151 152 153

        .name {
          @include box-sizing(border-box);
154

155 156 157 158 159 160 161 162 163
          display: block;
          color: $white;
        }
      }
    }
  }

  // outer most wrapper div for scroll up component picker menus
  // swaps in when a green button is clicked
164
  // --------------------
165
  .new-component-templates {
166
    @include clearfix();
167

168 169 170 171 172
    display: none;
    margin: $baseline ($baseline*2);
    border-radius: 3px;
    border: 1px solid $mediumGrey;
    background-color: $white;
173
    box-shadow: 0 1px 1px $shadow, 0 1px 0 rgba(255, 255, 255, 0.4) inset;
174 175 176

    .cancel-button {
      @include white-button;
177
      @include margin($baseline, 0, ($baseline/2), ($baseline/2));
178 179 180 181 182 183 184 185 186 187 188 189
    }

    .problem-type-tabs {
      display: none;
    }

    // specific menu types
    &.new-component-problem {
      .problem-type-tabs {
        display: inline-block;
      }
    }
190 191 192

    .support-documentation {
      float: right;
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
      @include margin($baseline, 0, ($baseline/2), ($baseline/2));
      @include font-size(14);

      .support-documentation-level {
        padding-right: ($baseline/2);
      }

      .support-documentation-link {
        // Override JQuery ui-widget-content link color (black) with our usual link color and hover action.
        color: $uxpl-blue-base;
        text-decoration: none;
        padding-right: ($baseline/2);

        &:hover {
          color: $uxpl-blue-hover-active;
          text-decoration: underline;
        }
      }
    }

    .support-level {
      padding-right: ($baseline/2);
    }

    .icon {
      color: $uxpl-primary-accent;
    }
221 222 223
  }

  // individual menus
224
  // --------------------
225
  .new-component-template {
226
    @include clearfix();
227

228
    margin-bottom: 0;
229 230 231 232 233 234 235 236 237 238

    li {
      border: none;
      border-bottom: 1px dashed $lightGrey;

      &:first-child {
        border-radius: 3px 3px 0 0;
      }
    }

239
    .button-component {
240 241
      @include clearfix();
      @include transition(none);
242

243
      @extend %t-demi-strong;
244

245
      display: block;
246
      width: 100%;
247
      border: 0;
248 249 250
      padding: 7px $baseline;
      background: $white;
      color: $gray-d3;
251
      text-align: left;
252
      font-family: $f-sans-serif;
253 254 255

      &:hover {
        @include transition(background-color $tmg-f2 linear 0s);
256 257

        background: tint($green, 30%);
258
        color: $white;
259 260 261 262

        .icon {
          color: $white;
        }
263 264 265 266 267
      }
    }
  }

  // basic and advanced problem tabs - also handled by jquery-ui tabs
268
  // --------------------
269
  .problem-type-tabs {
270 271
    @include linear-gradient(top, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));

272 273 274 275 276 277 278
    list-style-type: none;
    width: 100%;
    border-radius: 0;
    background-color: $lightBluishGrey;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 -1px 0 $shadow inset;

    li:first-child {
279
      @include margin-left($baseline);
280 281 282
    }

    li {
283 284
      @include linear-gradient(top, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));

285
      opacity: 0.8;
286

287
      @include float(left);
288

289 290 291 292 293 294 295 296 297 298 299 300 301
      display: inline-block;
      width: auto;
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 -1px 0 $shadow inset;
      background-color: tint($lightBluishGrey, 10%);
      text-align: center;

      &:hover {
        opacity: 0.9;
        background-color: tint($lightBluishGrey, 20%);
      }

      &.ui-state-active {
        @include active;
302 303 304

        border: 0;
        opacity: 1;
305
      }
306

307
      // reset to remove jquery-ui float
308 309 310
      a.link-tab {
        float: none;
      }
311 312 313 314
    }

    a {
      @extend %t-action3;
315

316
      display: block;
317
      padding: ($baseline*0.75) ($baseline*1.25);
318 319 320 321 322 323 324
      text-align: center;
      color: $gray-d3;
      text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
    }
  }
}

325 326 327 328 329
// outline UI
// --------------------
// outline: utilities
$outline-indent-width: $baseline;

330 331
// UI: general outline
.outline-content {
332
  margin-top: ($baseline/4);
333 334 335 336 337 338 339 340 341 342 343

  .unit-content {
    margin-top: 0;
  }

  // add/new items
  .add-item {
    margin-top: ($baseline*0.75);

    .button-new {
      @extend %ui-btn-flat-outline;
344

345 346 347 348 349 350
      padding: ($baseline/2) $baseline;
      display: block;

      .icon {
        display: inline-block;
        vertical-align: middle;
351

352
        @include margin-right($baseline/2);
353 354 355 356 357 358
      }
    }
  }
}


359 360 361
%outline-item-status {
  @extend %t-copy-sub2;
  @extend %t-strong;
362

363
  color: $gray-d1;
364

365 366
  .icon {
    @extend %t-icon5;
367

368
    @include margin-right($baseline/4);
369 370 371
  }
}

372 373 374
// outline UI - complex
// --------------------
%outline-complex-item {
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392

  // UI: item title
  .item-title {
    @include transition(color $tmg-f2 ease-in-out 0s);
  }

  // CASE: last-child in UI
  &:last-child {
    margin-bottom: 0;
  }

  // CASE: has staff-only content
  &.is-staff-only {

    // needed to make sure direct children only
    > .section-status,
    > .subsection-status,
    > .unit-status {
393
      .status-message .icon {
394 395 396 397 398
        color: $color-staff-only;
      }
    }
  }

399 400 401 402 403 404 405 406 407 408 409 410 411
  // CASE: has gated content
  &.is-gated {

    // needed to make sure direct children only
    > .section-status,
    > .subsection-status,
    > .unit-status {
      .status-message .icon {
        color: $color-gated;
      }
    }
  }

412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440
  // CASE: has unpublished content
  &.has-warnings {

    // needed to make sure direct children only
    > .section-status .status-message,
    > .subsection-status .status-message,
    > .unit-status .status-message {
      .icon {
        color: $color-warning;
      }
    }
  }

  // CASE: has errors
  &.has-errors {

    // needed to make sure direct children only
    > .section-status .status-message,
    > .subsection-status .status-message,
    > .unit-status .status-message,
    > .section-status .status-message-copy,
    > .subsection-status .status-message-copy,
    > .unit-status .status-message-copy {
      color: $color-error;
    }
  }
}


441 442 443 444 445 446 447 448
// outline UI - simple
// --------------------
%outline-simple-item {
  border: 1px solid $gray-l4;

  // CASE: last-child in UI
  &:last-child {
    margin-bottom: 0;
449 450
  }

451
  .item-title a {
452
    color: $color-heading-base;
453

454 455 456
    &:hover {
      color: $blue;
    }
457
  }
458
}
459 460


461 462
// CASE: complex outline
.outline-complex {
463

464 465 466
  // outline: sections
  .outline-section {
    @include transition(border-left-width $tmg-f2 linear 0s, border-left-color $tmg-f2 linear 0s, padding-left $tmg-f2 linear 0s);
467

468 469
    @extend %ui-window;
    @extend %outline-complex-item;
470

471 472 473
    border-left: 1px solid $color-draft;
    margin-bottom: $baseline;
    padding: ($baseline/4) ($baseline/2) ($baseline/2) ($baseline/2);
474

475 476 477 478
    // STATE: is-collapsed
    &.is-collapsed {
      border-left-width: ($baseline/4);
      padding-left: $baseline;
479

480 481 482 483 484 485 486 487 488 489 490 491 492 493
      // CASE: is ready to be live
      &.is-ready {
        border-left-color: $color-ready;
      }

      // CASE: is live
      &.is-live {
        border-left-color: $color-live;
      }

      // CASE: has staff-only content
      &.is-staff-only {
        border-left-color: $color-staff-only;
      }
494

495 496 497 498 499
      // CASE: has gated content
      &.is-gated {
        border-left-color: $color-gated;
      }

500 501 502 503
      // CASE: has unpublished content
      &.has-warnings {
        border-left-color: $color-warning;
      }
504

505 506 507 508
      // CASE: has errors
      &.has-errors {
        border-left-color: $color-error;
      }
509 510
    }

511 512 513 514
    // header - title
    .section-title {
      @extend %t-title5;
      @extend %t-strong;
515

516 517
      color: $color-heading-base;
    }
518

519 520 521 522
    // status
    .section-status {
      @extend %outline-item-status;
    }
523 524

    // status - release
525 526
    .status-release,
    .explanatory-message {
527
      @include transition(opacity $tmg-f2 ease-in-out 0s);
528

529
      opacity: 0.65;
530 531
    }

532
    // status - message
533
    .status-messages {
534 535 536
      margin-top: ($baseline/2);
      border-top: 1px solid $gray-l4;
      padding-top: ($baseline/4);
537

538
      .icon {
539
        @include margin-right($baseline/4);
540 541 542 543 544 545 546
      }
    }

    .status-message-copy {
      display: inline-block;
      color: $color-heading-base;
    }
547

548
    // STATE: hover/active
549 550
    &:hover,
    &:active {
551 552

      // status - release
553
      > .section-status .status-release,
554 555 556
      .section-status,
      .explanatory-message {
        opacity: 1;
557 558
      }
    }
559 560
  }

561 562 563
  // outline: subsections
  .outline-subsection {
    @include transition(border-left-color $tmg-f2 linear 0s);
564

565
    @extend %outline-complex-item;
566

567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589
    margin-bottom: ($baseline/2);
    border: 1px solid $gray-l4;
    border-left: ($baseline/4) solid $color-draft;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: ($baseline*0.75);


    // CASE: is ready to be live
    &.is-ready {
      border-left-color: $color-ready;
    }

    // CASE: is live
    &.is-live {
      border-left-color: $color-live;
    }

    // CASE: is presented for staff only
    &.is-staff-only {
      border-left-color: $color-staff-only;
    }

590 591 592 593 594
    // CASE: is presented for gated
    &.is-gated {
      border-left-color: $color-gated;
    }

595 596 597 598 599 600 601 602 603 604 605
    // CASE: has unpublished content
    &.has-warnings {
      border-left-color: $color-warning;
    }

    // CASE: has errors
    &.has-errors {
      border-left-color: $color-error;
    }

    // STATE: hover/active
606 607
    &:hover,
    &:active {
608 609 610 611 612 613
      box-shadow: 0 1px 1px $shadow-l2;
    }

    // header - title
    .subsection-title {
      @extend %t-title6;
614

615 616 617 618 619 620 621 622 623
      color: $color-heading-base;
    }

    // status
    .subsection-status {
      @extend %outline-item-status;
    }

    // STATE: hover/active
624 625
    &:hover,
    &:active {
626 627 628

      // status - release
      > .subsection-status .status-release {
629
        opacity: 1;
630 631 632 633
      }

      // status - grading
      > .subsection-status .status-grading {
634
        opacity: 1;
635
      }
636 637

      > .subsection-status .status-timed-proctored-exam {
638
        opacity: 1;
639
      }
640 641

      > .subsection-status .status-hide-after-due {
642
        opacity: 1;
643
      }
644 645 646
    }

    // status - grading
647 648 649
    .status-grading,
    .status-timed-proctored-exam,
    .status-hide-after-due {
650
      @include transition(opacity $tmg-f2 ease-in-out 0s);
651

652
      opacity: 0.75;
653 654
    }

655 656
    .status-grading-value,
    .status-proctored-exam-value {
657 658 659 660
      display: inline-block;
      vertical-align: middle;
    }

661 662
    .status-grading-date,
    .status-due-date {
663 664 665 666
      display: inline-block;
      vertical-align: middle;
      margin-left: ($baseline/4);
    }
667 668
  }

669 670 671
  // outline: units
  .outline-unit {
    @extend %outline-complex-item;
672

673 674 675 676 677 678 679
    margin-bottom: ($baseline/2);
    border: 1px solid $gray-l4;
    padding: ($baseline/4) ($baseline/2);

    // header - title
    .unit-title {
      @extend %t-title7;
680

681 682 683 684 685 686 687 688
      color: $color-heading-base;
    }

    .unit-status {
      @extend %outline-item-status;
    }

    // STATE: hover/active
689 690
    &:hover,
    &:active {
691 692 693 694
      box-shadow: 0 1px 1px $shadow-l2;

      // status - release
      .unit-status .status-release {
695
        opacity: 1;
696 697
      }
    }
698
  }
699
}
700

701 702 703 704 705 706
// CASE: simple outline
.outline-simple {

  // outline: sections
  .outline-section {
    @extend %outline-simple-item;
707

708 709 710 711 712 713 714
    margin-bottom: $baseline;
    padding: ($baseline/2);

    // header - title
    .section-title {
      @extend %t-title5;
      @extend %t-strong;
715

716 717 718 719 720 721 722
      color: $color-heading-base;
    }

    // status
    .section-status {
      @extend %outline-item-status;
    }
723 724

    // status - release
725 726
    .status-release {
      @include transition(opacity $tmg-f2 ease-in-out 0s);
727

728
      opacity: 0.65;
729 730 731
    }

    // status - grading
732 733
    .status-grading {
      @include transition(opacity $tmg-f2 ease-in-out 0s);
734

735
      opacity: 0.65;
736 737
    }

738 739 740 741
    .status-grading-value {
      display: inline-block;
      vertical-align: middle;
    }
742

743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763
    .status-grading-date {
      display: inline-block;
      vertical-align: middle;
      margin-left: ($baseline/4);
    }

    // status - message
    .status-message {
      margin-top: ($baseline/2);
      border-top: 1px solid $gray-l4;
      padding-top: ($baseline/4);

      .icon {
        margin-right: ($baseline/4);
      }
    }

    .status-message-copy {
      display: inline-block;
      color: $color-heading-base;
    }
764 765
  }

766 767 768
  // outline: subsections
  .outline-subsection {
    @extend %outline-simple-item;
769

770 771 772 773 774 775
    margin-bottom: ($baseline/2);
    padding: ($baseline/2);

    // header - title
    .subsection-title {
      @extend %t-title6;
776

777 778 779 780 781 782 783
      color: $color-heading-base;
    }

    // status
    .subsection-status {
      @extend %outline-item-status;
    }
784
  }
785

786 787 788
  // outline: units
  .outline-unit {
    @extend %outline-simple-item;
789

790 791
    margin-bottom: ($baseline/4);
    padding: ($baseline/4) ($baseline/2);
792

793 794 795
    // header - title
    .unit-title {
      @extend %t-title7;
796

797 798 799 800 801
      color: $color-heading-base;
    }

    .unit-status {
      @extend %outline-item-status;
802 803
    }
  }
804
}