Skip to content

Commit 399f285

Browse files
committed
MOBILE-4196 boostrap: Adapt BS5 and add compatibility to BS4
1 parent 388bf8c commit 399f285

File tree

16 files changed

+1038
-101
lines changed

16 files changed

+1038
-101
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
# In order to support Chrome 93 and iOS 15 we need to find Static initialization blocks are not present in the code.
8080
# See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Static_initialization_blocks
8181
# acorn is used by es-check but cannot check for this feature only, so we need to check it manually.
82-
if grep -qE 'static[ ]*\{' www/*.js cordova-plugin-moodleapp/www/*.js; then
82+
if grep -qE '(^|[^-])\bstatic[ ]*\{' www/*.js cordova-plugin-moodleapp/www/*.js; then
8383
echo "::error::Static initialization blocks are not supported in Chrome 93 and iOS 15."
8484
exit 1
8585
fi
272 Bytes
Loading

src/addons/mod/data/data.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ $grid-column-paddings: (
2323
padding: 16px;
2424

2525
::ng-deep {
26-
@import "theme/components/moodle";
2726
@import "theme/components/bootstrap/bootstrap";
2827

2928
table {

src/theme/components/bootstrap/_root.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
:root,
2-
[data-bs-theme="light"] {
1+
& {
32
// Note: Custom variable values only support SassScript inside `#{}`.
43

54
// Colors
65
//
76
// Generate palettes for full colors, grays, and theme colors.
87

9-
@each $color, $value in $colors {
8+
@each $color, $value in $bs-colors {
109
--#{$prefix}#{$color}: #{$value};
1110
}
1211

src/theme/components/bootstrap/_variables-dark.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ $body-emphasis-color-dark: $white !default;
5050
$border-color-dark: $gray-700 !default;
5151
$border-color-translucent-dark: rgba($white, .15) !default;
5252
$headings-color-dark: inherit !default;
53-
$link-color-dark: tint-color($primary, 40%) !default;
53+
$link-color-dark: tint-color($blue, 40%) !default;
5454
$link-hover-color-dark: shift-color($link-color-dark, -$link-shade-percentage) !default;
5555
$code-color-dark: tint-color($code-color, 40%) !default;
5656
$mark-color-dark: $body-color-dark !default;

src/theme/components/bootstrap/_variables.scss

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
// Color system
77

88
// scss-docs-start gray-color-variables
9-
$white: #fff !default;
10-
$gray-100: #f8f9fa !default;
11-
$gray-200: #e9ecef !default;
12-
$gray-300: #dee2e6 !default;
13-
$gray-400: #ced4da !default;
14-
$gray-500: #adb5bd !default;
15-
$gray-600: #6c757d !default;
16-
$gray-700: #495057 !default;
17-
$gray-800: #343a40 !default;
18-
$gray-900: #212529 !default;
19-
$black: #000 !default;
9+
$white: global.$white;
10+
$gray-100: global.$gray-100;
11+
$gray-200: global.$gray-200;
12+
$gray-300: global.$gray-300;
13+
$gray-400: global.$gray-400;
14+
$gray-500: global.$gray-500;
15+
$gray-600: global.$gray-600;
16+
$gray-700: global.$gray-700;
17+
$gray-800: global.$gray-800;
18+
$gray-900: global.$gray-900;
19+
$black: global.$black;
2020
// scss-docs-end gray-color-variables
2121

2222
// fusv-disable
@@ -36,20 +36,20 @@ $grays: (
3636
// fusv-enable
3737

3838
// scss-docs-start color-variables
39-
$blue: #0d6efd !default;
39+
$blue: global.$blue !default;
4040
$indigo: #6610f2 !default;
4141
$purple: #6f42c1 !default;
4242
$pink: #d63384 !default;
43-
$red: #dc3545 !default;
44-
$orange: #fd7e14 !default;
45-
$yellow: #ffc107 !default;
46-
$green: #198754 !default;
43+
$red: global.$red !default;
44+
$orange: #f98012 !default;
45+
$yellow: global.$yellow !default;
46+
$green: global.$green !default;
4747
$teal: #20c997 !default;
48-
$cyan: #0dcaf0 !default;
48+
$cyan: global.$cyan !default;
4949
// scss-docs-end color-variables
5050

5151
// scss-docs-start colors-map
52-
$colors: (
52+
$bs-colors: (
5353
"blue": $blue,
5454
"indigo": $indigo,
5555
"purple": $purple,
@@ -298,14 +298,14 @@ $cyans: (
298298
// fusv-enable
299299

300300
// scss-docs-start theme-color-variables
301-
$primary: $blue !default;
302-
$secondary: $gray-600 !default;
303-
$success: $green !default;
304-
$info: $cyan !default;
305-
$warning: $yellow !default;
306-
$danger: $red !default;
307-
$light: $gray-100 !default;
308-
$dark: $gray-900 !default;
301+
$primary: global.$primary;
302+
$secondary: global.$secondary;
303+
$success: global.$success;
304+
$info: global.$cyan;
305+
$warning: global.$warning;
306+
$danger: global.$danger;
307+
$light: global.$light;
308+
$dark: global.$dark;
309309
// scss-docs-end theme-color-variables
310310

311311
// scss-docs-start theme-colors-map
@@ -435,8 +435,8 @@ $position-values: (
435435
// Settings for the `<body>` element.
436436

437437
$body-text-align: null !default;
438-
$body-color: $gray-900 !default;
439-
$body-bg: $white !default;
438+
$body-color: global.$text-color !default;
439+
$body-bg: global.$background-color !default;
440440

441441
$body-secondary-color: rgba($body-color, .75) !default;
442442
$body-secondary-bg: $gray-200 !default;
@@ -450,7 +450,7 @@ $body-emphasis-color: $black !default;
450450
//
451451
// Style anchor elements.
452452

453-
$link-color: $primary !default;
453+
$link-color: $blue !default;
454454
$link-decoration: underline !default;
455455
$link-shade-percentage: 20% !default;
456456
$link-hover-color: shift-color($link-color, $link-shade-percentage) !default;
@@ -603,10 +603,10 @@ $aspect-ratios: (
603603

604604
// scss-docs-start font-variables
605605
// stylelint-disable value-keyword-case
606-
$font-family-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !default;
606+
$font-family-sans-serif: var(--ion-font-family);
607607
$font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default;
608608
// stylelint-enable value-keyword-case
609-
$font-family-base: var(--#{$prefix}font-sans-serif) !default;
609+
$font-family-base: var(--ion-font-family) !default;
610610
$font-family-code: var(--#{$prefix}font-monospace) !default;
611611

612612
// $font-size-root affects the value of `rem`, which is used for as well font sizes, paddings, and margins

src/theme/components/bootstrap/bootstrap.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "../../globals" as global;
2+
13
@import "mixins/banner";
24
@include bsBanner("");
35

@@ -50,3 +52,5 @@
5052
// Utilities
5153
@import "utilities/api";
5254
// scss-docs-end import-stack
55+
56+
@import "bs4-compat";

0 commit comments

Comments
 (0)