MDL-56004 theme: Add some BS2 compatibility to BS4.

This is for user-created texts (e.g. the people have used the generico filter to inject BS2 markup into user tests).

It is also for existing old HTML that we have not had time to upgrade yet.
This commit is contained in:
Damyon Wiese 2016-10-10 13:19:18 +08:00
parent fe4a6c3bdb
commit 0862719092
2 changed files with 75 additions and 0 deletions

View File

@ -39,3 +39,4 @@ $breadcrumb-divider-rtl: "◀" !default;
@import "moodle/sticky-footer";
@import "moodle/popover-region";
@import "moodle/tool_usertours";
@import "moodle/bs2-compat";

View File

@ -0,0 +1,74 @@
// 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 {
@extend .card;
@extend .card-block;
}
// Some things just got renamed.
.img-responsive {
@extend .img-fluid;
}
.text-error {
@extend .text-danger;
}
.btn-default {
@extend .btn-secondary;
}
// Labels and badges.
.label {
@extend .tag;
@include tag-variant($tag-default-bg);
}
.label-success {
@include tag-variant($tag-success-bg);
}
.label-info {
@include tag-variant($tag-info-bg);
}
.label-warning {
@include tag-variant($tag-warning-bg);
}
.label-important {
@include tag-variant($tag-danger-bg);
}
.badge {
@extend .tag;
@include tag-variant($tag-default-bg);
@include border-radius($font-size-root / 2);
}
.badge-success {
@include tag-variant($tag-success-bg);
}
.badge-info {
@include tag-variant($tag-info-bg);
}
.badge-warning {
@include tag-variant($tag-warning-bg);
}
.badge-important {
@include tag-variant($tag-danger-bg);
}
// Floats.
.pull-left {
@include pull-left();
}
.pull-right {
@include pull-right();
}