diff --git a/src/addons/calendar/pages/edit-event/edit-event.html b/src/addons/calendar/pages/edit-event/edit-event.html index 02609e8b4..fa306af65 100644 --- a/src/addons/calendar/pages/edit-event/edit-event.html +++ b/src/addons/calendar/pages/edit-event/edit-event.html @@ -16,7 +16,7 @@ -

{{ 'addon.calendar.eventname' | translate }}

+

{{ 'addon.calendar.eventname' | translate }}

@@ -25,7 +25,9 @@ -

{{ 'core.date' | translate }}

+ +

{{ 'core.date' | translate }}

+
@@ -35,7 +37,7 @@ -

{{ 'addon.calendar.eventkind' | translate }}

+

{{ 'addon.calendar.eventkind' | translate }}

{{eventTypes[0].name | translate }}

-

{{ 'core.category' | translate }}

+ +

{{ 'core.category' | translate }}

+
@@ -62,7 +66,9 @@ -

{{ 'core.course' | translate }}

+ +

{{ 'core.course' | translate }}

+
{{ course.fullname }} @@ -73,7 +79,9 @@ -

{{ 'core.course' | translate }}

+ +

{{ 'core.course' | translate }}

+
@@ -88,7 +96,9 @@
-

{{ 'core.group' | translate }}

+ +

{{ 'core.group' | translate }}

+
{{ group.name }} @@ -101,19 +111,21 @@
- + -

{{ 'core.showmore' | translate }}

-

{{ 'core.showless' | translate }}

+

{{ 'core.showmore' | translate }}

+

{{ 'core.showless' | translate }}

-

{{ 'core.description' | translate }}

+ +

{{ 'core.description' | translate }}

+
@@ -121,7 +133,9 @@ -

{{ 'core.location' | translate }}

+ +

{{ 'core.location' | translate }}

+
@@ -129,26 +143,37 @@
- + -

{{ 'addon.calendar.eventduration' | translate }}

+

{{ 'addon.calendar.eventduration' | translate }}

+
+ + +

{{ 'addon.calendar.durationnone' | translate }}

+
+ +
+ + +

{{ 'addon.calendar.durationuntil' | translate }}

+
+
- - {{ 'addon.calendar.durationnone' | translate }} - - - - {{ 'addon.calendar.durationuntil' | translate }} - + + +

{{ 'addon.calendar.durationminutes' | translate }}

+
- {{ 'addon.calendar.durationminutes' | translate }} +
+ + {{ 'addon.calendar.durationminutes' | translate }} @@ -158,33 +183,40 @@ - + -

{{ 'addon.calendar.repeatevent' | translate }}

+

{{ 'addon.calendar.repeatevent' | translate }}

- -

{{ 'addon.calendar.repeatweeksl' | translate }}

- + + +

{{ 'addon.calendar.repeatweeksl' | translate }}

+
+ +
- + -

{{ 'addon.calendar.repeatedevents' | translate }}

+

{{ 'addon.calendar.repeatedevents' | translate }}

+
+ + +

{{ 'addon.calendar.repeateditall' | translate:{$a: otherEventsCount} }}

+
+
- {{ 'addon.calendar.repeateditall' | translate:{$a: otherEventsCount} }} - - - - {{ 'addon.calendar.repeateditthis' | translate }} - + +

{{ 'addon.calendar.repeateditthis' | translate }}

+
+
@@ -194,12 +226,14 @@ - + {{ 'core.save' | translate }} - {{ 'core.discard' | translate }} + + {{ 'core.discard' | translate }} + diff --git a/src/addons/messages/pages/group-conversations/group-conversations.html b/src/addons/messages/pages/group-conversations/group-conversations.html index 61639f1b4..8357d8d81 100644 --- a/src/addons/messages/pages/group-conversations/group-conversations.html +++ b/src/addons/messages/pages/group-conversations/group-conversations.html @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ - - + + @@ -39,8 +39,8 @@ - - + + diff --git a/src/addons/qtype/multichoice/component/multichoice.scss b/src/addons/qtype/multichoice/component/multichoice.scss index 17f1f2577..6923b59e0 100644 --- a/src/addons/qtype/multichoice/component/multichoice.scss +++ b/src/addons/qtype/multichoice/component/multichoice.scss @@ -1,8 +1,16 @@ -:host { +:host ::ng-deep { .specificfeedback { background-color: var(--core-question-feedback-color-bg); color: var(--core-question-feedback-color); display: inline; padding: 0 .7em; } + + .flex { + display: flex !important; + } + + .answer .answernumber { + min-width: 1.5em; + } } diff --git a/src/core/components/download-refresh/download-refresh.scss b/src/core/components/download-refresh/download-refresh.scss index 3ee2b9406..5c9d86ae3 100644 --- a/src/core/components/download-refresh/download-refresh.scss +++ b/src/core/components/download-refresh/download-refresh.scss @@ -7,4 +7,9 @@ align-content: center; min-height: var(--a11y-min-target-size); min-width: var(--a11y-min-target-size); + position: relative; + + > * { + position: absolute; + } } diff --git a/src/theme/components/format-text.scss b/src/theme/components/format-text.scss index 4c0daaee8..9046fa194 100644 --- a/src/theme/components/format-text.scss +++ b/src/theme/components/format-text.scss @@ -197,3 +197,492 @@ core-format-text { left: 100%; } } + + +/** Styles to match web platform */ + +// Those styles are omitted on RTE +core-format-text { + ul { + padding-left: 1rem; + } + ul, ol { + -webkit-padding-start: 15px; + } + + .atto_image_button_text-top, + .atto_image_button_middle, + .atto_image_button_text-bottom, + .atto_image_button_left, + .atto_image_button_right { + height: auto; + width: auto; + + &.img-responsive { + height: auto; + width: auto; + } + } + + // Embed video responsive classes. + // Taken from https://github.com/twbs/bootstrap/blob/v4-dev/scss/utilities/_embed.scss + .embed-responsive { + position: relative; + display: block; + width: 100%; + padding: 0; + overflow: hidden; + + &::before { + display: block; + content: ""; + } + + .embed-responsive-item, + iframe, + embed, + object, + video { + position: absolute; + @include position(0, null, 0, 0); + width: 100%; + height: 100%; + border: 0; + } + + iframe iframe { + width: 100%; + height: 100%; + } + } + + .embed-responsive-21by9 { + &::before { + padding-top: percentage(9 / 21); + } + } + + .embed-responsive-16by9 { + &::before { + padding-top: percentage(9 / 16); + } + } + + .embed-responsive-4by3 { + &::before { + padding-top: percentage(3 / 4); + } + } + + .embed-responsive-1by1 { + &::before { + padding-top: percentage(1 / 1); + } + } + +} + +core-format-text, +core-rich-text-editor .core-rte-editor { + @include core-headings(); + + p { + font-size: 1.4rem; + margin-bottom: 1rem; + } + + .no-overflow { + overflow: auto; + } + + // Fix lists styles in core-format-text. + ol { + list-style-type: decimal; + } + + ul, ol { + ol { + list-style-type: lower-latin; + } + ul, ol { + @include margin(null, null, null, 15px); + } + } + + .badge { + position: initial !important; + } + + .core-disable-media-adapt, + .core-disable-media-adapt .core-media-adapt-width { + max-width: none !important; + max-height: none !important; + width: initial !important; + height: initial !important; + display: inline-block !important; + } + + img.icon { + font-size: 16px; + width: 16px; + height: 16px; + margin: 0; + padding: 0; + -webkit-box-sizing: content-box; + box-sizing: content-box; + margin-right: .5rem; + } + + // Form controls + // ------------------------ + select, + input:not([type=checkbox]):not([type=radio]):not([type=hidden]) { + height: 30px; + line-height: 30px; + display: inline-block; + border: 1px solid var(--gray-dark); + background: var(--background-contrast); + padding: 6px 8px; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; + margin-bottom: 10px; + } + + input[type=radio], + input[type=checkbox] { + position: relative; + + --color: var(--brand-contrast-color); + --color-checked: var(--color); + + width: var(--size); + height: var(--size); + border-radius: var(--border-radius); + border-width: var(--outer-border-width); + border-style: var(--border-style); + border-color: var(--color); + appearance: none; + display: inline-block; + margin-left: 2px; + margin-right: 2px; + margin-top: 2px; + + &:checked { + background-color: var(--color-checked); + } + + & + label { + line-height: var(--size); + } + } + + input[type=radio]::after { + position: absolute; + content: ' '; + width: calc(50% + var(--outer-border-width)); + height: calc(50% + var(--outer-border-width)); + border-radius: var(--border-radius); + transform: scale3d(0, 0, 0) translate(-50%,-50%); + background: var(--contrast-background); + border: 0 !important; + top: 50%; + left: 50%; + } + + input[type=radio]:checked::after { + transform: scale3d(1, 1, 1) translate(-50%,-50%); + } + + input[type=checkbox]:checked::after { + position: absolute; + width: 33%; + height: 50%; + content: ' '; + transform: rotate(45deg); + border-width: 0px 2px 2px 0px; + border-style: solid; + border-color: var(--contrast-background); + left: 4px; + top: 2px; + } + + + // Atto styles + // ------------------------- + .atto_image_preview { + width: 100%; + height: 100%; + margin-left: auto; + margin-right: auto; + } + + .atto_image_preview_box { + max-height: 200px; + margin-bottom: 1em; + overflow: auto; + } + + .editor_atto_content img { + cursor: pointer; + } + + .atto_image_size { + display: inline-block; + } + + .atto_image_size input[type=checkbox] { + @include margin(null, 1em, null, 1em); + } + + .atto_image_size input[type=text] { + width: 3em; + } + + .atto_image_size label { + display: inline-block; + } + + .atto_image_button_text-top, + .atto_image_button_middle, + .atto_image_button_text-bottom, + .atto_image_button_left, + .atto_image_button_right { + vertical-align: middle; + max-width: 100%; + display: inline-block; + margin: 0 0.5em; + + &.img-responsive { + /* If the image is display: block then linking the image to URLs won't work. */ + /*display: inline-block;*/ + max-width: 100%; + } + } + + .atto_image_button_text-top { + vertical-align: text-top; + } + + .atto_image_button_middle { + vertical-align: middle; + } + + .atto_image_button_text-bottom { + vertical-align: text-bottom; + } + + .atto_image_button_left { + @include float(start); + @include margin(0, 0.5em, 0, 0); + } + + .atto_image_button_right { + @include float(end); + @include margin(0, 0, 0, 0.5em); + } + + // Bootstrap 4 Styles + // ------------------------- + + // _media.scss + .media { + display: flex; + align-items: flex-start; + } + + .media-body { + flex: 1; + } + + // _alert.scss + .alert { + position: relative; + padding: .75rem 1.25rem; + margin-bottom: 1rem; + border: 0 solid transparent; + } + + // Headings for larger alerts + .alert-heading { + // Specified to prevent conflicts of changing $headings-color + color: inherit; + } + + // Provide class for links that match alerts + .alert-link { + font-weight: 400; + } + + @each $color-name, $value in $colors { + $base: map-get($value, base); + + .alert-#{$color-name} { + color: $base; + border-color: $base; + background-color: mix($base, white, 20%); + + .alert-link { + color: darken($base, 10%); + } + } + .alert-#{$color-name} p { + color: $base; + } + } + + // utilities/_align.scss + .align-baseline { vertical-align: baseline !important; } // Browser default + .align-top { vertical-align: top !important; } + .align-middle { vertical-align: middle !important; } + .align-bottom { vertical-align: bottom !important; } + .align-text-bottom { vertical-align: text-bottom !important; } + .align-text-top { vertical-align: text-top !important; } + + // utilities/_border.scss + .border { border: 1px solid $gray-dark !important; } + .border-top { border-top: 1px solid $gray-dark !important; } + .border-right { border-right: 1px solid $gray-dark !important; } + .border-bottom { border-bottom: 1px solid $gray-dark !important; } + .border-left { border-left: 1px solid $gray-dark !important; } + + .border-0 { border: 0 !important; } + .border-top-0 { border-top: 0 !important; } + .border-right-0 { border-right: 0 !important; } + .border-bottom-0 { border-bottom: 0 !important; } + .border-left-0 { border-left: 0 !important; } + + @each $color-name, $value in $colors { + $base: map-get($value, base); + + .border-#{$color-name} { + border-color: $base !important; + } + } + + .border-white { + border-color: var(--white) !important; + } + + // utilities/_flex.scss + .flex-row { flex-direction: row !important; } + .flex-column { flex-direction: column !important; } + .flex-row-reverse { flex-direction: row-reverse !important; } + .flex-column-reverse { flex-direction: column-reverse !important; } + + .flex-wrap { flex-wrap: wrap !important; } + .flex-nowrap { flex-wrap: nowrap !important; } + .flex-wrap-reverse { flex-wrap: wrap-reverse !important; } + .flex-fill { flex: 1 1 auto !important; } + .flex-grow-0 { flex-grow: 0 !important; } + .flex-grow-1 { flex-grow: 1 !important; } + .flex-shrink-0 { flex-shrink: 0 !important; } + .flex-shrink-1 { flex-shrink: 1 !important; } + + .justify-content-start { justify-content: flex-start !important; } + .justify-content-end { justify-content: flex-end !important; } + .justify-content-center { justify-content: center !important; } + .justify-content-between { justify-content: space-between !important; } + .justify-content-around { justify-content: space-around !important; } + + .align-items-start { align-items: flex-start !important; } + .align-items-end { align-items: flex-end !important; } + .align-items-center { align-items: center !important; } + .align-items-baseline { align-items: baseline !important; } + .align-items-stretch { align-items: stretch !important; } + + .align-content-start { align-content: flex-start !important; } + .align-content-end { align-content: flex-end !important; } + .align-content-center { align-content: center !important; } + .align-content-between { align-content: space-between !important; } + .align-content-around { align-content: space-around !important; } + .align-content-stretch { align-content: stretch !important; } + + .align-self-auto { align-self: auto !important; } + .align-self-start { align-self: flex-start !important; } + .align-self-end { align-self: flex-end !important; } + .align-self-center { align-self: center !important; } + .align-self-baseline { align-self: baseline !important; } + .align-self-stretch { align-self: stretch !important; } + + // utilities/_visibility.scss + .visible { + visibility: visible !important; + } + + .invisible { + visibility: hidden !important; + } + + // utilities/_text.scss + .text-monospace { font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important; } + .text-justify { text-align: justify !important; } + .text-wrap { white-space: normal !important; } + .text-nowrap { white-space: nowrap !important; } + .text-truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .text-left { text-align: left !important; } + .text-right { text-align: right !important; } + .text-center { text-align: center !important; } + .text-lowercase { text-transform: lowercase !important; } + .text-uppercase { text-transform: uppercase !important; } + .text-capitalize { text-transform: capitalize !important; } + .font-weight-light { font-weight: 300 !important; } + .font-weight-lighter { font-weight: lighter !important; } + .font-weight-normal { font-weight: 400 !important; } + .font-weight-bold { font-weight: 700 !important; } + .font-weight-bolder { font-weight: bolder !important; } + .font-italic { font-style: italic !important; } + .text-white { color: var(--white) !important; } + + @each $color-name, $value in $colors { + $base: map-get($value, base); + $contrast: map-get($value, contrast); + .text-#{$color-name} { + color: $base; + } + } + + .text-body { color: var(--ion-text-color) !important; } + .text-muted { color: var(--subdued-text-color) !important; } + .text-black-50 { color: rgba($black, .5) !important; } + .text-white-50 { color: rgba($white, .5) !important; } + .text-decoration-none { text-decoration: none !important; } + .text-break { + word-break: break-word !important; // Deprecated, but avoids issues with flex containers + word-wrap: break-word !important; // Used instead of `overflow-wrap` for IE & Edge Legacy + } + .text-reset { color: inherit !important; } + + .label { + display: inline-block; + padding: .25em .4em; + font-size: 75%; + font-weight: 700; + line-height: 1; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out; + color: var(--white); + background-color: var(--gray-darker); + } + + .label-important { + color: var(--ion-color-danger-contrast); + background-color: var(--ion-color-danger); + } + + @each $color-name, $value in $colors { + $base: map-get($value, base); + $contrast: map-get($value, contrast); + + .label-#{$color-name} { + color: $contrast; + background-color: $base; + } + } +} diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss index 3f7715dd1..57b941d1e 100644 --- a/src/theme/theme.base.scss +++ b/src/theme/theme.base.scss @@ -144,14 +144,19 @@ ion-app.ios ion-header h2 { pointer-events: none; } + // Correctly inherit ion-text-wrap onto labels. -ion-item ion-label core-format-text .core-format-text-content > * { +.item ion-label core-format-text .core-format-text-content > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -ion-item.ion-text-wrap ion-label { +.item.ion-text-wrap ion-label core-format-text .core-format-text-content > * { + white-space: normal; +} + +.item.ion-text-wrap ion-label { white-space: normal !important; } @@ -180,7 +185,6 @@ ion-button.ion-text-wrap { } } - @each $color-name, $value in $colors { $value: map-get($colors, $color-name); $base: map-get($value, base); @@ -580,19 +584,74 @@ ion-toolbar h1 .core-bar-button-image img { } // Radio. -ion-radio { +ion-radio, +input[type=radio] { --color: var(--brand-contrast-color); --color-checked: var(--color); + --border-radius: 50%; + --border-width: 2px; + --outer-border-width: 2px; + --border-style: solid; + --inner-border-radius: 50%; + --size: 20px; +} + +.ios ion-radio, +.ios input[type=radio] { + --border-width: 1px; + --outer-border-width: 1px; +} + +.ios ion-radio { + width: var(--size); + height: var(--size); + + &::part(container) { + margin: 0px; + border-radius: var(--border-radius); + border-width: var(--outer-border-width); + border-style: var(--border-style); + border-color: var(--color); + } + + &::part(mark) { + border-radius: var(--inner-border-radius); + width: calc(50% + var(--outer-border-width)); + height: calc(50% + var(--outer-border-width)); + transform: scale3d(0, 0, 0); + transition: transform 280ms cubic-bezier(.4, 0, .2, 1); + background: var(--contrast-background); + border: 0 !important; + } + + &.radio-checked { + &::part(container) { + border-color: var(--color-checked); + background: var(--color-checked); + } + + &::part(mark) { + transform: scale3d(1, 1, 1); + } + } } // Checkbox. -ion-checkbox { +ion-checkbox, +input[type=checkbox] { --border-radius: 2px; --border-color-checked: var(--brand-contrast-color); --background-checked: var(--brand-contrast-color); --checkmark-color: var(--contrast-background); + --border-width: 2px; + --outer-border-width: 2px; + --border-style: solid; + --size: 20px; } +.ios input[type=checkbox] { + --outer-border-width: 1px; +} // Select. ion-select::part(text) { @@ -687,6 +746,11 @@ core-block ion-item-divider .core-button-spinner { } } +details summary { + pointer-events: auto; + cursor: pointer; +} + textarea { min-height: var(--a11y-min-target-size); } @@ -751,7 +815,7 @@ ion-item.ion-activatable:not(.only-links) { ion-anchor, a, ion-button, button, - audio, video { + audio, video, select, input { pointer-events: visible; } } diff --git a/tsconfig.app.json b/tsconfig.app.json index 530f84a16..67b984831 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -35,6 +35,7 @@ ], "exclude": [ "src/**/*.test.ts", - "src/testing/**" + "src/testing/**", + "src/**/tests/**" ] }