MDL-67735 theme_boost: remove bs2 and bs4alpha compatibility css

This commit is contained in:
Bas Brands 2020-01-27 15:06:29 +01:00
parent a0fc902eb1
commit 4394f9e358
113 changed files with 958 additions and 1403 deletions

View file

@ -1,13 +1,12 @@
$breadcrumb-divider: "" !default;
$breadcrumb-divider-rtl: "" !default;
// Making BS4 Stable compatible with BS4 Alpha for moodle core sass
@import "moodle/bs4alphacompat";
// Specific overrides to make Bootstrap RTL.
@import "moodle/bootstrap-rtl";
// Old Moodle stuff from base theme.
// Massive, needs broken up.
@import "moodle/variables";
@import "moodle/core";
@import "moodle/icons";
@import "moodle/admin";
@ -38,7 +37,6 @@ $breadcrumb-divider-rtl: "◀" !default;
@import "moodle/sticky-footer";
@import "moodle/popover-region";
@import "moodle/tool_usertours";
@import "moodle/bs2-compat";
@import "moodle/print";
@import "moodle/modal";
@import "moodle/layout";

View file

@ -17,17 +17,17 @@
.environmenttable {
.warn {
background-color: $state-warning-bg;
color: $state-warning-text;
color: $warning;
}
.error {
background-color: $state-danger-bg;
color: $state-danger-text;
color: $danger;
}
.ok {
background-color: $state-success-bg;
color: $state-success-text;
color: $success;
}
}
@ -105,7 +105,7 @@
text-align: left;
margin-left: auto;
margin-right: auto;
margin-top: $spacer-y;
margin-top: $spacer;
}
#page-admin-roles-define .topfields {
@ -113,7 +113,7 @@
}
#page-admin-roles-define .capdefault {
background-color: $table-bg-hover;
background-color: $table-hover-bg;
}
#page-filter-manage .backlink,
@ -484,7 +484,7 @@
.uninstall {
a {
color: $state-danger-text;
color: $danger;
}
}

View file

@ -19,13 +19,13 @@
width: 50%;
display: inline-block;
float: left;
padding: $table-sm-cell-padding;
padding: $table-cell-padding-sm;
}
.normal_setting {
width: 50%;
display: inline-block;
float: left;
padding: $table-sm-cell-padding;
padding: $table-cell-padding-sm;
}
}
@ -48,7 +48,7 @@
.grouped_settings {
/* Striped rows like a table */
&:nth-of-type(odd) {
background-color: $table-bg-accent;
background-color: $table-accent-bg;
}
&:nth-of-type(even) {
background-color: $card-bg;
@ -114,13 +114,13 @@
}
.path-backup .notification.dependencies_enforced {
color: $state-danger-text;
color: $danger;
font-weight: bold;
}
.path-backup .backup_progress {
margin-top: $spacer-y;
margin-bottom: $spacer-y;
margin-top: $spacer;
margin-bottom: $spacer;
.backup_stage {
color: $text-muted;

View file

@ -1,59 +0,0 @@
// Some - backwards compatibility for BS2. We may have plugins and user content targeted for BS2.
// Well -> Panel -> Card. We skipped panel (BS3) so lets just support well and card.
.well {
border: $border-width solid $border-color;
padding: $card-spacer-x;
}
// Some things just got renamed.
.img-responsive {
@include img-fluid;
}
.text-error {
color: map-get($theme-colors, 'danger');
}
.btn-default {
@include button-variant(map-get($theme-colors, 'secondary'), map-get($theme-colors, 'secondary'));
}
.label {
display: inline-block;
padding: $badge-padding-y $badge-padding-x;
@include font-size($badge-font-size);
font-weight: $badge-font-weight;
line-height: 1;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
@include border-radius($badge-border-radius);
@include transition($badge-transition);
@include badge-variant($tag-default-bg);
}
.label-success {
@include badge-variant($tag-success-bg);
}
.label-info {
@include badge-variant($tag-info-bg);
}
.label-warning {
@include badge-variant($tag-warning-bg);
}
.label-important {
@include badge-variant($tag-danger-bg);
}
// Floats.
.pull-left {
@include pull-left();
}
.pull-right {
@include pull-right();
}

View file

@ -1,236 +0,0 @@
$font-size-xs: ($font-size-base * .75) !default;
$font-size-root: $font-size-base;
$zindex-navbar-fixed: 1030 !default;
$tag-padding-y: .25rem !default;
/* stylelint-disable function-url-scheme-blacklist */
$form-icon-success: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%235cb85c' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3E%3C/svg%3E") !default;
$form-icon-warning: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23f0ad4e' d='M4.4 5.324h-.8v-2.46h.8zm0 1.42h-.8V5.89h.8zM3.76.63L.04 7.075c-.115.2.016.425.26.426h7.397c.242 0 .372-.226.258-.426C6.726 4.924 5.47 2.79 4.253.63c-.113-.174-.39-.174-.494 0z'/%3E%3C/svg%3E") !default;
$form-icon-danger: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E") !default;
/* stylelint-enable function-url-scheme-blacklist */
$input-bg-disabled: $input-disabled-bg;
$table-sm-cell-padding: $table-cell-padding-sm;
$popover-arrow-outer-width: 11px !default;
$modal-title-padding: $modal-header-padding;
$pagination-hover-border: $pagination-hover-border-color;
$pagination-active-border: $pagination-active-border-color;
$primary: $blue !default;
$secondary: $gray-600 !default;
$success: $green !default;
$info: $cyan !default;
$warning: $yellow !default;
$danger: $red !default;
$light: $gray-100 !default;
$dark: $gray-800 !default;
$brand-primary: $primary;
$brand-success: $success;
$brand-info: $info;
$brand-warning: $warning;
$brand-danger: $danger;
$spacer: 1rem !default;
$spacer-x: $spacer !default;
$spacer-y: $spacer !default;
$gray-dark: $gray-900;
$gray: $gray-700;
$gray-light: $gray-600;
$gray-lighter: $gray-300;
$gray-lightest: $gray-100;
$table-bg-hover: $table-hover-bg;
$table-bg-accent: $table-accent-bg;
$tag-default-bg: $gray-light !default;
$tag-primary-bg: $brand-primary !default;
$tag-success-bg: $brand-success !default;
$tag-info-bg: $brand-info !default;
$tag-warning-bg: $brand-warning !default;
$tag-danger-bg: $brand-danger !default;
$state-success-text: $success;
$state-success-bg: theme-color-level("success", -10) !default;
$state-success-border: theme-color-level("success", -9) !default;
$state-info-text: $info;
$state-info-bg: theme-color-level("info", -10) !default;
$state-info-border: theme-color-level("info", -9) !default;
$state-warning-text: $warning;
$state-warning-bg: theme-color-level("warning", -10) !default;
$state-warning-border: theme-color-level("warning", -10) !default;
$state-danger-text: $danger;
$state-danger-bg: theme-color-level("danger", -10) !default;
$state-danger-border: theme-color-level("danger", -9) !default;
@mixin form-control-validation($color) {
// Color the label and help text
.form-control-feedback,
.form-control-label,
.form-check-label,
.form-check-inline,
.custom-control {
color: $color;
}
// Set the border and box shadow on specific inputs to match
.form-control {
border-color: $color;
}
// Set validation states also for addons
.input-group-addon {
color: $color;
border-color: $color;
background-color: lighten($color, 40%);
}
// Optional feedback icon
.form-control-feedback {
color: $color;
}
}
$tag-padding-x: .4em !default;
$tag-padding-y: .25em !default;
$tag-font-size: 75% !default;
$tag-color: #fff !default;
$tag-font-weight: bold !default;
.tag {
display: inline-block;
padding: $tag-padding-y $tag-padding-x;
font-size: $tag-font-size;
font-weight: $tag-font-weight;
line-height: 1;
color: $tag-color;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
@include border-radius();
// Empty tags collapse automatically
&:empty {
display: none;
}
}
.form-control-success,
.form-control-warning,
.form-control-danger {
padding-right: ($input-padding-x * 3);
background-repeat: no-repeat;
background-position: center right ($input-height / 4);
background-size: ($input-height / 2) ($input-height / 2);
}
// .form-check-input {
// position: static;
// }
@mixin tag-variant($color) {
background-color: $color;
&[href] {
@include hover-focus {
background-color: darken($color, 10%);
}
}
}
.tag-default {
@include tag-variant($tag-default-bg);
}
.tag-primary {
@include tag-variant($tag-primary-bg);
}
.tag-success {
@include tag-variant($tag-success-bg);
}
.tag-info {
@include tag-variant($tag-info-bg);
}
.tag-warning {
@include tag-variant($tag-warning-bg);
}
.tag-danger {
@include tag-variant($tag-danger-bg);
}
@mixin pull-left() {
float: left !important; /* stylelint-disable-line declaration-no-important */
}
@mixin pull-right() {
float: right !important; /* stylelint-disable-line declaration-no-important */
}
.custom-select {
width: auto;
}
.fade.in {
opacity: 1;
}
// Adding compatibility for m-side-* classes.
// stylelint-disable
$spacer: 1rem !default;
$bs4aspacers: () !default;
$bs4aspacers: map-merge((
0: 0,
1: ($spacer * 1),
2: ($spacer * 2),
3: ($spacer * 3)
), $bs4aspacers);
@each $prop, $abbrev in (margin: m, padding: p) {
@each $size, $length in $bs4aspacers {
.#{$abbrev}-a-#{$size} { #{$prop}: $length !important; }
.#{$abbrev}-t-#{$size},
.#{$abbrev}-y-#{$size} {
#{$prop}-top: $length !important;
}
.#{$abbrev}-r-#{$size},
.#{$abbrev}-x-#{$size} {
#{$prop}-right: $length !important;
}
.#{$abbrev}-b-#{$size},
.#{$abbrev}-y-#{$size} {
#{$prop}-bottom: $length !important;
}
.#{$abbrev}-l-#{$size},
.#{$abbrev}-x-#{$size} {
#{$prop}-left: $length !important;
}
}
}
input[disabled] {
cursor: not-allowed;
}
.row-fluid {
@include make-row();
}
// These have been removed in BS4 Stable. Adding in so RTL dropdowns will work.
/*rtl:raw:
.dropdown-menu-right {
right: 0;
left: auto;
}
.dropdown-menu-left {
right: auto;
left: 0;
}
*/

View file

@ -73,7 +73,7 @@ $calendarEventOtherColor: #ced4da !default; // Pale gray.
.drop-target {
box-sizing: border-box;
border: 1px dashed $brand-primary;
border: 1px dashed $primary;
}
}

View file

@ -5,6 +5,8 @@
// want white default colour.
$bg-inverse-link-color: #fff !default;
$font-size-xs: ($font-size-base * .75) !default;
#region-main {
overflow-x: auto;
overflow-y: visible;
@ -577,7 +579,7 @@ a.skip:active {
// My Moodle
.path-my .coursebox {
margin: $spacer-y 0;
margin: $spacer 0;
padding: 0;
.overview {
@ -1215,7 +1217,7 @@ body#page-lib-editor-tinymce-plugins-moodlemedia-preview {
/* Moodle Dialogue Settings (moodle-core-dialogue) */
.moodle-dialogue-base .moodle-dialogue-lightbox {
background-color: $gray;
background-color: $gray-700;
}
// Prevent adding backdrops to popups in popups.
@ -2345,7 +2347,7 @@ $footer-link-color: $bg-inverse-link-color !default;
.sr-only-focusable {
&:active,
&:focus {
z-index: $zindex-navbar-fixed + 1;
z-index: 1031;
position: fixed;
background: #fff;
padding: 7px;
@ -2477,10 +2479,27 @@ body.h5p-embed {
.float-left {
float: left !important; /* stylelint-disable-line declaration-no-important */
}
.float-right {
float: right !important; /* stylelint-disable-line declaration-no-important */
}
.img-responsive {
@include img-fluid();
}
input[disabled] {
cursor: not-allowed;
}
.custom-select {
width: auto;
}
.fade.in {
opacity: 1;
}
.clamp-2 {
display: -webkit-box;
-webkit-box-orient: vertical;

View file

@ -225,7 +225,7 @@ body:not(.editing) .sitetopic ul.section {
.editing .section .activity:hover,
.editing .section .activity.action-menu-shown {
background-color: $table-bg-accent;
background-color: $table-accent-bg;
}
.course-content .current {
@ -234,7 +234,7 @@ body:not(.editing) .sitetopic ul.section {
.course-content .current::before {
content: "";
border-left: $brand-primary 2px solid;
border-left: $primary 2px solid;
position: absolute;
left: -$card-spacer-x;
top: 0;
@ -538,7 +538,7 @@ span.editinstructions {
font-size: $font-size-sm;
padding: .1em .4em;
background-color: $state-info-bg;
color: $state-info-text;
color: $info;
text-decoration: none;
z-index: 9999;
@ -556,7 +556,7 @@ span.editinstructions {
border: 1px solid $state-info-border;
text-align: center;
background: $state-info-bg;
color: $state-info-text;
color: $info;
z-index: 1; // Required in order to have this above relatively positioned course content@mixin
@include box-shadow(2px 2px 5px 1px #ccc);
@ -712,12 +712,12 @@ span.editinstructions {
.courses .coursebox {
&.collapsed {
padding-top: $spacer-y / 2;
padding-bottom: $spacer-y / 2;
padding-top: $spacer / 2;
padding-bottom: $spacer / 2;
}
&.even {
background-color: $table-bg-accent;
background-color: $table-accent-bg;
}
}
@ -948,7 +948,7 @@ span.editinstructions {
> div,
> div:hover,
&[data-selected='1'] > div {
background-color: $table-bg-hover;
background-color: $table-hover-bg;
}
}
}

View file

@ -69,7 +69,7 @@
}
#adminsettings .error {
color: $state-danger-text;
color: $danger;
}
.mform ul.file-list {
@ -290,7 +290,7 @@ fieldset.coursesearchbox label {
.form-autocomplete-suggestions {
position: absolute;
background-color: white;
border: 2px solid $gray-lighter;
border: 2px solid $gray-300;
border-radius: 3px;
min-width: 206px;
max-height: 20em;
@ -316,7 +316,7 @@ fieldset.coursesearchbox label {
.form-autocomplete-suggestions li[aria-selected=true] {
background-color: darken($dropdown-bg, 5%);
color: $gray;
color: $gray-700;
}
.form-autocomplete-downarrow {
@ -411,9 +411,11 @@ textarea[data-auto-rows] {
/** Atto fields do not have form-control because that would break the layout of the editor.
So they need these extra styles to highlight the editor when there is a validation error. */
/* stylelint-disable function-url-scheme-blacklist */
$form-icon-danger: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23d9534f' viewBox='-2 -2 7 7'%3E%3Cpath stroke='%23d9534f' d='M0 0l3 3m0-3L0 3'/%3E%3Ccircle r='.5'/%3E%3Ccircle cx='3' r='.5'/%3E%3Ccircle cy='3' r='.5'/%3E%3Ccircle cx='3' cy='3' r='.5'/%3E%3C/svg%3E") !default;
/* stylelint-enable function-url-scheme-blacklist */
.has-danger .editor_atto_content.form-control,
.has-danger .editor_atto_content.form-control-danger {
@include form-control-validation($brand-danger);
background-image: $form-icon-danger;
padding-right: ($input-padding-x * 3);
background-repeat: no-repeat;

View file

@ -368,7 +368,7 @@
&.generaltable {
.levelodd {
background-color: $table-bg-accent;
background-color: $table-accent-bg;
}
.leveleven {
@ -401,7 +401,7 @@
.heading .cell,
.cell.category,
.avg .cell {
background-color: $gray-lightest;
background-color: $gray-100;
}
table .clickable {
@ -418,7 +418,7 @@
&.generaltable {
.levelodd {
background-color: $table-bg-accent;
background-color: $table-accent-bg;
}
.leveleven {

View file

@ -967,10 +967,6 @@ $grading-content-show-content-button-padding-left: calc(#{map-get($spacers, 2) *
margin-left: 4px;
}
.ie .row-fluid .desktop-first-column {
margin-left: 0;
}
.langmenu form {
margin: 0;
}
@ -1049,7 +1045,7 @@ div#dock {
}
> tbody > tr:nth-of-type(even) {
background-color: $table-bg-accent;
background-color: $table-accent-bg;
}
.rblock label {
@ -1187,8 +1183,8 @@ div#dock {
span.qnbutton {
cursor: default;
background-color: $input-bg-disabled;
color: $gray;
background-color: $input-disabled-bg;
color: $gray-700;
}
a.qnbutton:hover,
@ -1234,28 +1230,28 @@ div#dock {
.qnbutton.correct .trafficlight {
background-image: url([[pix:theme|mod/quiz/checkmark]]);
background-color: $state-success-text;
background-color: $success;
}
.qnbutton.blocked .trafficlight {
background-image: url([[pix:core|t/locked]]);
background-color: $input-bg-disabled;
background-color: $input-disabled-bg;
}
.qnbutton.notanswered .trafficlight,
.qnbutton.incorrect .trafficlight {
background-color: $state-danger-text;
background-color: $danger;
}
.qnbutton.partiallycorrect .trafficlight {
background-image: url([[pix:theme|mod/quiz/whitecircle]]);
background-color: $state-warning-text;
background-color: $warning;
}
.qnbutton.complete .trafficlight,
.qnbutton.answersaved .trafficlight,
.qnbutton.requiresgrading .trafficlight {
background-color: $gray-light;
background-color: $gray-600;
}
}

View file

@ -245,8 +245,8 @@ body.path-question-type {
width: 7em;
padding: 0.5em;
margin-bottom: 1.8em;
background-color: $gray-lighter;
border: 1px solid darken($gray-lighter, 7%);
background-color: $gray-300;
border: 1px solid darken($gray-300, 7%);
@include border-radius(2px);
}
@ -350,14 +350,14 @@ body.path-question-type {
.que .correctness {
&.correct {
background-color: $state-success-text;
background-color: $success;
}
&.partiallycorrect {
background-color: $state-warning-text;
background-color: $warning;
}
&.notanswered,
&.incorrect {
background-color: $state-danger-text;
background-color: $danger;
}
}

View file

@ -46,7 +46,7 @@ span[data-flexitour="container"] {
}
div[data-role="arrow"] {
border-width: #{$popover-arrow-outer-width};
border-width: $popover-arrow-width;
}
div[data-role="arrow"],
@ -87,9 +87,9 @@ span[data-flexitour="container"] {
&[x-placement="#{$direction}-start"] {
margin-#{$opposite}: #{$popover-arrow-width};
div[data-role="arrow"] {
#{$opposite}: -#{$popover-arrow-outer-width};
#{$opposite}: -$popover-arrow-width;
#{$side}: 50%;
margin-#{$side}: -#{$popover-arrow-outer-width};
margin-#{$side}: -$popover-arrow-width;
border-#{$opposite}-width: 0;
border-#{$direction}-color: #{$popover-arrow-outer-color};
}

View file

@ -0,0 +1,20 @@
/**
* Moodle variables
*
* Variables written for Moodle specific components
*
* Please do not override any Bootstrap variables here, custom Bootstrap variable should go in
* preset files instead.
*/
$state-success-bg: theme-color-level("success", -10) !default;
$state-success-border: theme-color-level("success", -9) !default;
$state-info-bg: theme-color-level("info", -10) !default;
$state-info-border: theme-color-level("info", -9) !default;
$state-warning-bg: theme-color-level("warning", -10) !default;
$state-warning-border: theme-color-level("warning", -10) !default;
$state-danger-bg: theme-color-level("danger", -10) !default;
$state-danger-border: theme-color-level("danger", -9) !default;

View file

@ -82,6 +82,17 @@ $theme-colors: map-merge((
), $theme-colors);
// stylelint-enable
$spacer: 1rem !default;
$spacers: (
0: 0,
1: ($spacer * .25),
2: ($spacer * .5),
3: $spacer,
4: ($spacer * 1.5),
5: ($spacer * 2),
6: ($spacer * 3)
) !default;
// Import FontAwesome.
@import "fontawesome";

File diff suppressed because it is too large Load diff

View file

@ -76,6 +76,17 @@ $theme-colors: map-merge((
), $theme-colors);
// stylelint-enable
$spacer: 1rem !default;
$spacers: (
0: 0,
1: ($spacer * .25),
2: ($spacer * .5),
3: $spacer,
4: ($spacer * 1.5),
5: ($spacer * 2),
6: ($spacer * 3)
) !default;
// Import FontAwesome.
@import "fontawesome";

File diff suppressed because it is too large Load diff

View file

@ -115,7 +115,7 @@ if (!empty($CFG->enabledevicedetection) && empty($device)) {
$screenshoturl = new moodle_url('/theme/image.php',
array('theme' => $themename, 'image' => 'screenshot', 'component' => 'theme'));
// Contents of the screenshot/preview cell.
$screenshotcell = html_writer::empty_tag('img', array('class' => 'img-responsive img-fluid',
$screenshotcell = html_writer::empty_tag('img', array('class' => 'img-fluid',
'src' => $screenshoturl, 'alt' => $strthemename));
// Show the name of the picked theme.
$headingthemename = $OUTPUT->heading($strthemename, 3);
@ -209,7 +209,7 @@ if (!empty($CFG->enabledevicedetection) && empty($device)) {
$screenshotpath = new moodle_url('/theme/image.php',
array('theme' => $themename, 'image' => 'screenshot', 'component' => 'theme'));
// Contents of the first screenshot/preview cell.
$row[] = html_writer::empty_tag('img', array('class' => 'img-responsive img-fluid',
$row[] = html_writer::empty_tag('img', array('class' => 'img-fluid',
'src' => $screenshotpath, 'alt' => $strthemename));
// Contents of the second cell.
$infocell = $OUTPUT->heading($strthemename, 3);

View file

@ -1,6 +1,28 @@
This files describes API changes in /theme/* themes,
information provided here is intended especially for theme designer.
=== 4.0 ===
* The Bootstrap legacy css utilities from Bootstrap 2 and 4alpha have been removed.
The syntax for the new Bootstrap 4.5 utility classes is {property}{sides}-{breakpoint}-{size} for sm, md, lg, and xl.
The size values are:
1: 0.25rem
2: 0.5rem
3: 1rem
4: 1.5rem
5: 2rem
6: 3rem
In Bootstrap 4alpa a spacing utility class '.m-l-1' would mean margin-left 1rem. With the new spacing classes it should now be '.ml-3'
These class names have changed:
.row-fluid is now .row
.text-error is now .text-danger
These classes should no longer be used:
.label .label-{type}, use .badge .badge-{type} instead
.tag .tag-{type}, use .badge .badge-{type} instead
.well, just set a border with .border and a background with .bg-light
=== 3.9 ===
* Add class .d-print-block to #page, #page-wrapper and #page content to fix Firefox printing problems