diff --git a/cms/static/sass/_variables.scss b/cms/static/sass/_variables.scss index d9739ab081..b68e0399f7 100644 --- a/cms/static/sass/_variables.scss +++ b/cms/static/sass/_variables.scss @@ -183,6 +183,7 @@ $color-ready: $green; $color-warning: $orange-l2; $color-error: $red-l2; $color-staff-only: $black; +$color-visibility-set: $black; $color-heading-base: $gray-d2; $color-copy-base: $gray-l1; diff --git a/cms/static/sass/elements/_forms.scss b/cms/static/sass/elements/_forms.scss index c6425b1144..790c5b61f9 100644 --- a/cms/static/sass/elements/_forms.scss +++ b/cms/static/sass/elements/_forms.scss @@ -1,7 +1,7 @@ // studio - elements - forms // ==================== -// Table of Contents +// Table of Contents // * +Forms - General // * +Field - Is Editable // * +Field - With Error @@ -12,7 +12,23 @@ // * +Form - Grandfathered // +Forms - General -// ==================== +// ==================== +// element-specific utilities +// -------------------- +// UI: checkbox/radio inputs +%input-tickable { + + ~ label { + color: $color-copy-base; + } + + // STATE: checked/selected + &:checked ~ label { + @extend %t-strong; + color: $ui-action-primary-color-focus; + } +} + input[type="text"], input[type="email"], input[type="password"], @@ -107,8 +123,18 @@ form { } } + // CASE: checkbox input + .field-checkbox .input-checkbox { + @extend %input-tickable; + } + + // CASE: radio input + .field-radio .input-radio { + @extend %input-tickable; + } + // CASE: file input - input[type=file] { + input[type="file"] { @extend %t-copy-sub1; } diff --git a/cms/static/sass/elements/_modal-window.scss b/cms/static/sass/elements/_modal-window.scss index 978b5e1437..1cba74c0f1 100644 --- a/cms/static/sass/elements/_modal-window.scss +++ b/cms/static/sass/elements/_modal-window.scss @@ -52,6 +52,45 @@ } } + // UI: summary messages + .summary-message { + margin-bottom: $baseline; + padding: ($baseline*0.75); + background: $gray-d3; + + .icon, .copy { + display: inline-block; + vertical-align: top; + } + + .icon { + @extend %t-icon4; + @include margin-right($baseline/2); + color: $white; + } + + .copy { + @extend %t-copy-sub1; + max-width: 85%; + color: $white; + } + } + + // CASE: Warning summary message + .summary-message-warning { + border-top: ($baseline/5) solid $color-warning; + + .icon { + color: $color-warning; + } + } + + // visual dividers + .divider-visual { + margin: ($baseline*0.75) 0; + border: ($baseline/20) solid $gray-l4; + } + // sections within a modal .modal-section { margin-bottom: ($baseline*0.75); @@ -64,11 +103,20 @@ .modal-section-title { @extend %t-title6; margin: 0 0 ($baseline/2) 0; - border-bottom: 1px solid $gray-l4; + border-bottom: ($baseline/10) solid $gray-l4; padding-bottom: ($baseline/4); color: $gray-d2; } + .modal-subsection-title { + @extend %t-title8; + @extend %t-strong; + margin-bottom: ($baseline/4); + text-transform: uppercase; + letter-spacing: 0.1; + color: $gray-l2; + } + .modal-section-content { .list-fields, .list-actions { @@ -238,143 +286,6 @@ } } - // outline: edit item settings - .wrapper-modal-window-bulkpublish-section, - .wrapper-modal-window-bulkpublish-subsection, - .wrapper-modal-window-bulkpublish-unit, - .course-outline-modal { - - .list-fields { - - .field { - display: inline-block; - vertical-align: top; - margin-right: ($baseline/2); - margin-bottom: ($baseline/4); - - label { - @extend %t-copy-sub1; - @extend %t-strong; - @include transition(color $tmg-f3 ease-in-out 0s); - margin: 0 0 ($baseline/4) 0; - - &.is-focused { - color: $blue; - } - } - - - input, textarea { - @extend %t-copy-base; - @include transition(all $tmg-f2 ease-in-out 0s); - height: 100%; - width: 100%; - padding: ($baseline/2); - - // CASE: long length - &.long { - width: 100%; - } - - // CASE: short length - &.short { - width: 25%; - } - } - - // CASE: specific release + due times/dates - .start-date, - .start-time, - .due-date, - .due-time { - width: ($baseline*7); - } - - .tip { - @extend %t-copy-sub1; - @include transition(color, 0.15s, ease-in-out); - display: block; - margin-top: ($baseline/4); - color: $gray-l2; - } - - .tip-warning { - color: $gray-d2; - } - } - - // CASE: type-based input - .field-text { - - // TODO: refactor the _forms.scss partial to allow for this area to inherit from it - label, input, textarea { - display: block; - } - } - - // CASE: select input - .field-select { - - .label, .input { - display: inline-block; - vertical-align: middle; - } - - .label { - margin-right: ($baseline/2); - } - - .input { - width: 100%; - } - - // CASE: checkbox input - .field-checkbox { - - .label, label { - margin-bottom: 0; - } - } - } - } - - - - // UI: grading section - .edit-settings-grading { - - .grading-type { - margin-bottom: $baseline; - } - } - - // UI: staff lock section - .edit-staff-lock { - - .checkbox-cosmetic .input-checkbox { - @extend %cont-text-sr; - - // CASE: unchecked - ~ .tip-warning { - display: block; - } - - // CASE: checked - &:checked { - - ~ .tip-warning { - display: none; - } - } - } - - // needed to override poorly scoped margin-bottom on any label element in a view (from _forms.scss) - .checkbox-cosmetic .label { - margin-bottom: 0; - } - } - } - // xblock custom actions .modal-window .editor-with-buttons { margin-bottom: ($baseline*3); @@ -394,7 +305,7 @@ } - // special overrides for video module editor/hidden tab editors + // MODAL TYPE: component - video modal (includes special overrides for xblock-related editing view) .modal-lg.modal-type-video { .modal-content { @@ -517,4 +428,225 @@ opacity: 0.5; filter: alpha(opacity=50); } + + // MODAL TYPE: component - visibility modal + .xblock-visibility_view { + + .visibility-controls-secondary { + max-height: 100%; + overflow-y: scroll; + @include margin(($baseline*0.75), 0, 0, $baseline); + } + + .visibility-controls-group { + @extend %wipe-last-child; + margin-bottom: $baseline; + } + + // UI: form fields + .list-fields { + + .field { + @extend %wipe-last-child; + margin-bottom: ($baseline/4); + + label { + @extend %t-copy-sub1; + } + } + + // UI: radio and checkbox inputs + .field-radio, .field-checkbox { + + label { + @include margin-left($baseline/4); + } + } + } + + // CASE: content group has been removed + .field-visibility-content-group.was-removed { + + .input-checkbox:checked ~ label { + color: $color-error; + } + + .note { + @extend %t-copy-sub2; + @extend %t-regular; + display: block; + color: $color-error; + } + } + + // CASE: no groups configured for visibility + .is-not-configured { + @extend %no-content; + padding: ($baseline); + @include text-align(left); // reset for %no-content's default styling + + .title { + @extend %t-title6; + font-weight: 600; // needed for poorly scoped .title rule in modals + margin: 0 0 ($baseline/2) 0; // needed for poorly scoped .title rule in modals + } + + .copy { + @extend %t-copy-sub1; + + p { + @extend %wipe-last-child; + margin-bottom: $baseline; + } + } + + &.has-actions { + + .actions { + margin-top: $baseline; + } + + .action { + @include margin-left(0); // reset for %no-content's default styling + } + } + } + } + + // MODAL TYPE: outline - edit item settings + .wrapper-modal-window-bulkpublish-section, + .wrapper-modal-window-bulkpublish-subsection, + .wrapper-modal-window-bulkpublish-unit, + .course-outline-modal { + + .list-fields { + + .field { + display: inline-block; + vertical-align: top; + @include margin-right($baseline/2); + margin-bottom: ($baseline/4); + + label { + @extend %t-copy-sub1; + @extend %t-strong; + @include transition(color $tmg-f3 ease-in-out 0s); + margin: 0 0 ($baseline/4) 0; + + &.is-focused { + color: $blue; + } + } + + + input, textarea { + @extend %t-copy-base; + @include transition(all $tmg-f2 ease-in-out 0s); + height: 100%; + width: 100%; + padding: ($baseline/2); + + // CASE: long length + &.long { + width: 100%; + } + + // CASE: short length + &.short { + width: 25%; + } + } + + // CASE: specific release + due times/dates + .start-date, + .start-time, + .due-date, + .due-time { + width: ($baseline*7); + } + + .tip { + @extend %t-copy-sub1; + @include transition(color, 0.15s, ease-in-out); + display: block; + margin-top: ($baseline/4); + color: $gray-l2; + } + + .tip-warning { + color: $gray-d2; + } + } + + // CASE: type-based input + .field-text { + + // TODO: refactor the _forms.scss partial to allow for this area to inherit from it + label, input, textarea { + display: block; + } + } + + // CASE: select input + .field-select { + + .label, .input { + display: inline-block; + vertical-align: middle; + } + + .label { + @include margin-right($baseline/2); + } + + .input { + width: 100%; + } + + // CASE: checkbox input + .field-checkbox { + + .label, label { + margin-bottom: 0; + } + } + } + } + + + + // UI: grading section + .edit-settings-grading { + + .grading-type { + margin-bottom: $baseline; + } + } + + // UI: staff lock section + .edit-staff-lock { + + .checkbox-cosmetic .input-checkbox { + @extend %cont-text-sr; + + // CASE: unchecked + ~ .tip-warning { + display: block; + } + + // CASE: checked + &:checked { + + ~ .tip-warning { + display: none; + } + } + } + + // needed to override poorly scoped margin-bottom on any label element in a view (from _forms.scss) + .checkbox-cosmetic .label { + margin-bottom: 0; + } + } + } } diff --git a/cms/static/sass/elements/_xblocks.scss b/cms/static/sass/elements/_xblocks.scss index 33d4646f0d..823694201c 100644 --- a/cms/static/sass/elements/_xblocks.scss +++ b/cms/static/sass/elements/_xblocks.scss @@ -150,42 +150,50 @@ // ==================== - // UI: xblocks - calls-to-action - .wrapper-xblock .header-actions { + .wrapper-xblock { - .actions-list { + // UI: xblocks - calls-to-action + .header-actions .actions-list { @extend %actions-list; } - } - // UI: xblock is collapsible - .wrapper-xblock.is-collapsible, - .wrapper-xblock.xblock-type-container { + // CASE: xblock is collapsible + &.is-collapsible, + &.xblock-type-container { - .icon { - font-style: normal; - } + .icon { + font-style: normal; + } - .expand-collapse { - @extend %expand-collapse; - margin: 0 ($baseline/4); - height: ($baseline*1.25); - width: $baseline; + .expand-collapse { + @extend %expand-collapse; + margin: 0 ($baseline/4); + height: ($baseline*1.25); + width: $baseline; - &:focus { - outline: 0; + &:focus { + outline: 0; + } + } + + .action-view { + + .action-button { + transition: none; + } + + .action-button-text { + padding-right: ($baseline/5); + padding-left: 0; + } } } - .action-view { + // CASE: xblock has specific visibility set + &.has-visibility-set { - .action-button { - transition: none; - } - - .action-button-text { - padding-right: ($baseline/5); - padding-left: 0; + .action-visibility .visibility-button.visibility-button { // needed to cascade in front of overscoped header-actions CSS rule + color: $color-visibility-set; } } } diff --git a/cms/static/sass/views/_container.scss b/cms/static/sass/views/_container.scss index af9539c7b7..58176beb59 100644 --- a/cms/static/sass/views/_container.scss +++ b/cms/static/sass/views/_container.scss @@ -6,7 +6,20 @@ // ==================== +// view-specific utilities +// -------------------- +%status-value-base { + @extend %t-title7; + @extend %t-strong; +} + +%status-value-sub1 { + @extend %t-title8; + display: block; +} + // UI: container page view +// -------------------- .view-container { @extend %two-col-1; @@ -102,6 +115,7 @@ @extend %t-title8; } + // UI: publishing details/summary .bit-publishing { @extend %bar-module; @@ -159,19 +173,18 @@ .wrapper-release { .release-date { - @extend %t-strong; + @extend %status-value-base; } .release-with { - @extend %t-title8; - display: block; + @extend %status-value-sub1; } } .wrapper-visibility { .copy { - @extend %t-strong; + @extend %status-value-base; margin-bottom: ($baseline/10); } @@ -181,15 +194,23 @@ } .inherited-from { - @extend %t-title8; - display: block; + @extend %status-value-sub1; } + // UI: note about specific access + .note-visibility { + @extend %status-value-sub1; + .icon { + @include margin-right($baseline/4); + } + } } .wrapper-pub-actions { - padding: ($baseline*0.75); + border-top: 1px solid $gray-l4; + margin-top: ($baseline/2); + padding: $baseline ($baseline*0.75) ($baseline*0.75) ($baseline*0.75); .action-publish { @extend %btn-primary-blue; @@ -209,7 +230,6 @@ } } } - } // versioning widget @@ -244,8 +264,7 @@ .wrapper-unit-id, .wrapper-library-id { .unit-id-value, .library-id-value { - @extend %cont-text-wrap; - @extend %t-copy-sub1; + @extend %status-value-base; display: inline-block; width: 100%; } @@ -308,5 +327,3 @@ } } } - - diff --git a/cms/templates/base.html b/cms/templates/base.html index 4397cfedde..176f9599a1 100644 --- a/cms/templates/base.html +++ b/cms/templates/base.html @@ -86,6 +86,9 @@ import json
+ + <%block name="modal_placeholder">%block> + <%block name="jsextra">%block>