From a5be9fbc95f97a88d07b8b056adbdb9aa54f4f68 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?=
Date: Tue, 8 Feb 2022 12:06:48 +0100
Subject: [PATCH] MOBILE-3808 styles: Some style fixes
---
.../messages/pages/discussion/discussion.html | 2 +-
.../messages/pages/discussion/discussion.scss | 4 --
.../pages/course-storage/course-storage.html | 4 +-
.../core-download-refresh.html | 4 +-
.../download-refresh/download-refresh.ts | 5 +-
src/core/components/file/core-file.html | 4 +-
src/core/components/mod-icon/mod-icon.scss | 4 +-
src/core/components/tabs/tabs.scss | 1 +
src/core/directives/collapsible-header.ts | 1 -
.../core-course-module-completion.html | 7 ++-
.../components/module/core-course-module.html | 62 +++++++++++--------
.../course/components/module/module.ts | 5 +-
src/core/features/login/login.scss | 2 +-
.../login/pages/credentials/credentials.html | 4 +-
.../login/pages/reconnect/reconnect.html | 4 +-
src/core/features/login/pages/site/site.html | 4 +-
.../features/sitehome/pages/index/index.html | 8 +--
.../features/sitehome/pages/index/index.scss | 4 +-
src/theme/components/format-text.scss | 2 +-
src/theme/theme.base.scss | 19 +++++-
src/theme/theme.light.scss | 11 ++--
21 files changed, 96 insertions(+), 65 deletions(-)
diff --git a/src/addons/messages/pages/discussion/discussion.html b/src/addons/messages/pages/discussion/discussion.html
index fe42e7ac1..68417d729 100644
--- a/src/addons/messages/pages/discussion/discussion.html
+++ b/src/addons/messages/pages/discussion/discussion.html
@@ -128,7 +128,7 @@
[attr.aria-label]="'addon.messages.newmessages' | translate">
{{ 'addon.messages.newmessages' | translate }}
- {{ newMessages }}
+ {{ newMessages }}
diff --git a/src/addons/messages/pages/discussion/discussion.scss b/src/addons/messages/pages/discussion/discussion.scss
index 2f8f0935d..57320a0c6 100644
--- a/src/addons/messages/pages/discussion/discussion.scss
+++ b/src/addons/messages/pages/discussion/discussion.scss
@@ -27,13 +27,9 @@
.core-discussion-messages-badge {
position: absolute;
- border-radius: 50%;
color: var(--addon-messages-discussion-badge-text);
background-color: var(--addon-messages-discussion-badge);
display: block;
- line-height: 20px;
- height: 20px;
- width: 20px;
@include position(-6px, -6px, null, null);
}
}
diff --git a/src/addons/storagemanager/pages/course-storage/course-storage.html b/src/addons/storagemanager/pages/course-storage/course-storage.html
index 4db31b1e0..dab853fb1 100644
--- a/src/addons/storagemanager/pages/course-storage/course-storage.html
+++ b/src/addons/storagemanager/pages/course-storage/course-storage.html
@@ -55,7 +55,7 @@
+ [canTrustDownload]="true">
diff --git a/src/core/components/download-refresh/core-download-refresh.html b/src/core/components/download-refresh/core-download-refresh.html
index 9ba3490a9..f9580727f 100644
--- a/src/core/components/download-refresh/core-download-refresh.html
+++ b/src/core/components/download-refresh/core-download-refresh.html
@@ -1,14 +1,14 @@
+ [attr.aria-label]="(statusTranslatable || 'core.download') | translate">
+ [attr.aria-label]="(statusTranslatable || 'core.refresh') | translate">
diff --git a/src/core/components/download-refresh/download-refresh.ts b/src/core/components/download-refresh/download-refresh.ts
index 26487f98b..7dd013c02 100644
--- a/src/core/components/download-refresh/download-refresh.ts
+++ b/src/core/components/download-refresh/download-refresh.ts
@@ -35,7 +35,10 @@ export class CoreDownloadRefreshComponent {
@Input() statusTranslatable?: string; // Download status translatable string.
@Input() enabled = false; // Whether the download is enabled.
@Input() loading = true; // Force loading status when is not downloading.
- @Input() size: 'small' | 'default' | 'large' = 'default'; // Size of the buttons.
+ /**
+ * @deprecated since 4.0. It has no effect.
+ */
+ @Input() size = ''; // Size of the buttons.
@Input() canTrustDownload = false; // If false, refresh will be shown if downloaded.
@Output() action: EventEmitter; // Will emit an event when the item clicked.
diff --git a/src/core/components/file/core-file.html b/src/core/components/file/core-file.html
index a5e2fbc7c..ff3e41e9b 100644
--- a/src/core/components/file/core-file.html
+++ b/src/core/components/file/core-file.html
@@ -9,7 +9,7 @@
+ (action)="download()">
+ color="danger">
diff --git a/src/core/components/mod-icon/mod-icon.scss b/src/core/components/mod-icon/mod-icon.scss
index b0dcb46d0..45b236cb6 100644
--- a/src/core/components/mod-icon/mod-icon.scss
+++ b/src/core/components/mod-icon/mod-icon.scss
@@ -5,12 +5,13 @@
--size: var(--module-icon-size);
--margin-end: 0px;
--margin-vertical: 0px;
+ --icon-radius: var(--small-radius);
margin-top: var(--margin-vertical);
margin-bottom: var(--margin-vertical);
@include margin-horizontal(null, var(--margin-end));
- border-radius: var(--small-radius);
+ border-radius: var(--icon-radius);
padding: 0.7rem;
background-color: $gray-100;
line-height: var(--size);
@@ -50,4 +51,5 @@ img {
:host-context(ion-card ion-item) {
--margin-vertical: 12px;
--margin-end: 12px;
+ --icon-radius: var(--module-icon-radius);
}
diff --git a/src/core/components/tabs/tabs.scss b/src/core/components/tabs/tabs.scss
index dbc1f28e7..ff1c17bfe 100644
--- a/src/core/components/tabs/tabs.scss
+++ b/src/core/components/tabs/tabs.scss
@@ -7,6 +7,7 @@
height: 100%;
display: flex;
flex-direction: column;
+ --ion-safe-area-top: 0px;
ion-tabs {
background: transparent;
diff --git a/src/core/directives/collapsible-header.ts b/src/core/directives/collapsible-header.ts
index e0927de10..1981fd416 100644
--- a/src/core/directives/collapsible-header.ts
+++ b/src/core/directives/collapsible-header.ts
@@ -32,7 +32,6 @@ import { CoreMath } from '@singletons/math';
})
export class CoreCollapsibleHeaderDirective implements OnDestroy {
- protected scrollElement?: HTMLElement;
protected loadingObserver: CoreEventObserver;
protected content?: HTMLIonContentElement | null;
protected header: HTMLIonHeaderElement;
diff --git a/src/core/features/course/components/module-completion/core-course-module-completion.html b/src/core/features/course/components/module-completion/core-course-module-completion.html
index dbdc18616..a96265860 100644
--- a/src/core/features/course/components/module-completion/core-course-module-completion.html
+++ b/src/core/features/course/components/module-completion/core-course-module-completion.html
@@ -24,8 +24,11 @@
-
- {{ rule.rulevalue.description }}
+
+
+
+ {{ 'core.course.completion_automatic:todo' | translate }} {{ rule.rulevalue.description }}
+
diff --git a/src/core/features/course/components/module/core-course-module.html b/src/core/features/course/components/module/core-course-module.html
index adfa73f2a..5a85d4f1d 100644
--- a/src/core/features/course/components/module/core-course-module.html
+++ b/src/core/features/course/components/module/core-course-module.html
@@ -1,12 +1,12 @@
-
+ }" [button]="module.handlerData.action && module.uservisible">
@@ -19,8 +19,8 @@
+
-
{{ 'core.course.todo' | translate }}
@@ -50,7 +50,7 @@
-
@@ -58,11 +58,11 @@
-
+ }">
@@ -82,30 +82,38 @@
[showManualCompletion]="showManualCompletion" (completionChanged)="completionChanged.emit($event)">
-
-
- {{ 'core.course.manualcompletionnotsynced' | translate }}
-
+
+
+
+ {{ 'core.course.manualcompletionnotsynced' | translate }}
+
+
-
-
- {{ 'core.course.hiddenfromstudents' | translate }}
-
+
+
+
+ {{ 'core.course.hiddenfromstudents' | translate }}
+
+
-
-
- {{ 'core.course.hiddenoncoursepage' | translate }}
-
+
+
+
+ {{ 'core.course.hiddenoncoursepage' | translate }}
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -114,7 +122,7 @@
+ [ngClass]="['core-course-module-handler', 'core-module-loading', module.handlerData.class]" detail="false" lines="none">
diff --git a/src/core/features/course/components/module/module.ts b/src/core/features/course/components/module/module.ts
index 287c2a484..fa25f2e50 100644
--- a/src/core/features/course/components/module/module.ts
+++ b/src/core/features/course/components/module/module.ts
@@ -62,8 +62,9 @@ export class CoreCourseModuleComponent implements OnInit, OnDestroy {
}
this.module.handlerData.a11yTitle = this.module.handlerData.a11yTitle ?? this.module.handlerData.title;
- this.completionStatus = this.module.completiondata === undefined ||
- this.module.completiondata.tracking == CoreCourseModuleCompletionTracking.COMPLETION_TRACKING_NONE
+ this.completionStatus = this.module.completiondata === undefined ||
+ !this.module.completiondata?.istrackeduser ||
+ this.module.completiondata.tracking == CoreCourseModuleCompletionTracking.COMPLETION_TRACKING_NONE
? undefined
: this.module.completiondata.state;
diff --git a/src/core/features/login/login.scss b/src/core/features/login/login.scss
index 129a185de..053125e44 100644
--- a/src/core/features/login/login.scss
+++ b/src/core/features/login/login.scss
@@ -106,7 +106,7 @@
:host-context(body.dark) {
@if ($core-login-button-outline-dark) {
- form ion-button-dark {
+ form ion-button {
--background: white;
--color: var(--core-login-background-dark);
}
diff --git a/src/core/features/login/pages/credentials/credentials.html b/src/core/features/login/pages/credentials/credentials.html
index bd28dced2..11772f5e6 100644
--- a/src/core/features/login/pages/credentials/credentials.html
+++ b/src/core/features/login/pages/credentials/credentials.html
@@ -56,7 +56,7 @@
{{ 'core.login.or' | translate }}
- {{ 'core.scanqr' | translate }}
+ {{ 'core.scanqr' | translate }}
@@ -64,7 +64,7 @@
- {{ 'core.login.forgotten' | translate }}
+ {{ 'core.login.forgotten' | translate }}
diff --git a/src/core/features/login/pages/reconnect/reconnect.html b/src/core/features/login/pages/reconnect/reconnect.html
index 5d41ab921..d8fa966ff 100644
--- a/src/core/features/login/pages/reconnect/reconnect.html
+++ b/src/core/features/login/pages/reconnect/reconnect.html
@@ -67,7 +67,7 @@
{{ 'core.login.or' | translate }}
- {{ 'core.scanqr' | translate }}
+ {{ 'core.scanqr' | translate }}
@@ -75,7 +75,7 @@
- {{ 'core.login.forgotten' | translate }}
+ {{ 'core.login.forgotten' | translate }}
diff --git a/src/core/features/login/pages/site/site.html b/src/core/features/login/pages/site/site.html
index 6302070b4..c6a3f8071 100644
--- a/src/core/features/login/pages/site/site.html
+++ b/src/core/features/login/pages/site/site.html
@@ -104,14 +104,14 @@
- {{ 'core.scanqr' | translate }}
+ {{ 'core.scanqr' | translate }}
- {{ 'core.needhelp' | translate }}
+ {{ 'core.needhelp' | translate }}
diff --git a/src/core/features/sitehome/pages/index/index.html b/src/core/features/sitehome/pages/index/index.html
index 4f422475d..45bd97c06 100644
--- a/src/core/features/sitehome/pages/index/index.html
+++ b/src/core/features/sitehome/pages/index/index.html
@@ -55,7 +55,7 @@
-
+
{{ 'core.courses.availablecourses' | translate}}
@@ -69,7 +69,7 @@
-
+
{{ 'core.courses.categories' | translate}}
@@ -78,7 +78,7 @@
-
+
@@ -88,7 +88,7 @@
-
+
{{ 'core.courses.searchcourses' | translate}}
diff --git a/src/core/features/sitehome/pages/index/index.scss b/src/core/features/sitehome/pages/index/index.scss
index 9aec56ba2..7a2bbde1d 100644
--- a/src/core/features/sitehome/pages/index/index.scss
+++ b/src/core/features/sitehome/pages/index/index.scss
@@ -2,7 +2,7 @@
ion-item ion-icon {
display: inline-block;
- border-radius: var(--small-radius);
+ border-radius: var(--module-icon-radius);
padding: 0.7rem;
background-color: $gray-100;
line-height: var(--size);
@@ -10,7 +10,7 @@ ion-item ion-icon {
@include margin-horizontal(null, var(--margin-end));
}
-core-course-module.core-sitehome-news ::ng-deep ion-card {
+core-course-module.core-sitehome-news ::ng-deep ion-card {
--border-width: 0;
margin: 0;
padding: 0;
diff --git a/src/theme/components/format-text.scss b/src/theme/components/format-text.scss
index 8ffe17e5d..a5fe5391d 100644
--- a/src/theme/components/format-text.scss
+++ b/src/theme/components/format-text.scss
@@ -699,7 +699,7 @@ core-rich-text-editor .core-rte-editor {
padding: .25em .4em;
font-size: 75%;
font-weight: 700;
- line-height: 1;
+ line-height: 1.1;
text-align: center;
white-space: nowrap;
vertical-align: baseline;
diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss
index e6027e705..31aed6866 100644
--- a/src/theme/theme.base.scss
+++ b/src/theme/theme.base.scss
@@ -189,6 +189,7 @@ ion-button core-format-text .core-format-text-content {
overflow: hidden;
text-overflow: ellipsis;
display: block;
+ line-height: 1.2;
}
ion-button > * {
@@ -217,6 +218,10 @@ ion-button ion-spinner {
--color: inherit !important;
}
+ion-button:not(.button-has-icon-only) > ion-icon {
+ min-width: 20px;
+}
+
@each $color-name, $unused in $colors {
.text-#{$color-name},
p.text-#{$color-name} {
@@ -850,14 +855,22 @@ ion-select-popover ion-item.core-select-option-title {
}
}
+ion-badge {
+ line-height: 1.1;
+ padding: 4px 8px;
+ border-radius: var(--big-radius);
+}
+
ion-chip {
line-height: 1.1;
font-size: 12px;
padding: 4px 8px;
- height: 24px;
+ min-height: 24px;
+ height: auto;
ion-icon {
font-size: 16px;
+ min-width: 16px;
@include margin(0, 8px, 0, 0);
}
@@ -869,6 +882,10 @@ ion-chip {
color: var(--ion-color-base);
}
}
+
+ ion-label {
+ white-space: normal !important;
+ }
}
ion-searchbar {
diff --git a/src/theme/theme.light.scss b/src/theme/theme.light.scss
index 7eaa2bb89..1ad8d7b27 100644
--- a/src/theme/theme.light.scss
+++ b/src/theme/theme.light.scss
@@ -58,6 +58,11 @@
--brand-color: var(--brand);
+ --small-radius: 4px;
+ --medium-radius: 8px;
+ --big-radius: 16px;
+ --huge-radius: 24px;
+
// Accessibility vars.
--a11y-min-target-size: 44px;
--a11y-focus-color: var(--primary);
@@ -65,6 +70,7 @@
--zoom-level: 100%;
--module-icon-size: 24px;
+ --module-icon-radius: var(--medium-radius);
--ion-background-color: var(--background-color);
--ion-background-color-rgb: #{$background-color-rgb};
@@ -75,11 +81,6 @@
--ion-text-color-rgb: #{$text-color-rgb};
--subdued-text-color: var(--gray-700);
- --small-radius: 4px;
- --medium-radius: 8px;
- --big-radius: 16px;
- --huge-radius: 24px;
-
--ion-card-color: var(--text-color);
ion-card {
--border-width: 1px;