MOBILE-4442 course: Update styles on module cards and sections

main
Pau Ferrer Ocaña 2024-09-17 13:12:46 +02:00
parent 1527e31cd6
commit aad989982d
8 changed files with 94 additions and 58 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,14 +1,14 @@
:host { :host {
.course-section { .course-section {
--inner-padding-end: 12px; --inner-padding-end: var(--mdl-spacing-3);
} }
&.collapsible { &.collapsible {
.core-course-module-list-wrapper { .core-course-module-list-wrapper {
border: var(--ion-card-border-width) solid var(--ion-card-border-color); border: var(--ion-card-border-width) solid var(--ion-card-border-color);
border-radius: var(--ion-card-radius); border-radius: var(--ion-card-radius);
margin: 8px 4px; margin: var(--mdl-spacing-4);
width: calc(100% - 8px); width: calc(100% - var(--mdl-spacing-8));
ion-card { ion-card {
--ion-card-background: transparent; --ion-card-background: transparent;
@ -19,4 +19,18 @@
} }
} }
} }
core-course-module:has( + core-course-section) {
--activity-border: 0px;
--card-padding-bottom: 0px;
}
core-course-module:last-child {
--activity-border: 0px;
--card-padding-bottom: 0px;
}
core-course-module:first-child ::ng-deep ion-card {
margin-top: 0px;
}
} }

View File

@ -81,7 +81,7 @@
contextLevel="module" [contextInstanceId]="module.id" [courseId]="module.course" /> contextLevel="module" [contextInstanceId]="module.id" [courseId]="module.course" />
<!-- Availability info --> <!-- Availability info -->
<div *ngIf="showAvailability && module.availabilityinfo" class="core-module-availabilityinfo"> <div *ngIf="showAvailability && module.availabilityinfo" class="core-module-availabilityinfo colored-box-with-icon">
<ion-icon name="fas-lock" [attr.aria-label]="'core.restricted' | translate" /> <ion-icon name="fas-lock" [attr.aria-label]="'core.restricted' | translate" />
<core-format-text [text]="module.availabilityinfo" contextLevel="module" [contextInstanceId]="module.id" <core-format-text [text]="module.availabilityinfo" contextLevel="module" [contextInstanceId]="module.id"
[courseId]="module.course" /> [courseId]="module.course" />
@ -94,7 +94,7 @@
</ion-item> </ion-item>
<div class="core-course-last-module-viewed" *ngIf="isLastViewed"> <div class="core-course-last-module-viewed colored-box-with-icon" *ngIf="isLastViewed">
<ion-icon name="fas-eye" aria-hidden="true" /> <ion-icon name="fas-eye" aria-hidden="true" />
{{ 'core.course.lastaccessedactivity' | translate }} {{ 'core.course.lastaccessedactivity' | translate }}
</div> </div>

View File

@ -1,29 +1,32 @@
@use "theme/globals" as *; @use "theme/globals" as *;
:host { :host {
--horizontal-margin: 12px; --horizontal-spacing: var(--mdl-spacing-4);
--vertical-margin: 12px; --vertical-spacing: var(--mdl-spacing-2);
--card-padding: 16px; --colored-box-padding: var(--mdl-spacing-2);
--card-border-width: 0px; --card-border-width: 0px;
--card-radius: 0px; --card-radius: 0px;
--card-background: transparent; --card-background: transparent;
--activity-border: 2px solid var(--stroke);
--card-padding-bottom: var(--vertical-spacing);
ion-card { ion-card {
margin: var(--vertical-margin) var(--horizontal-margin); margin: var(--vertical-spacing) var(--horizontal-spacing);
padding: 0px;
--ion-card-border-width: var(--card-border-width); --ion-card-border-width: var(--card-border-width);
--ion-card-radius: var(--card-radius); --ion-card-radius: var(--card-radius);
--ion-card-background: var(--card-background); --ion-card-background: var(--card-background);
padding-bottom: var(--card-padding-bottom);
border-bottom: var(--activity-border);
} }
ion-item { ion-item {
--padding-start: var(--card-padding); --padding-start: 0px;
--inner-padding-end: var(--card-padding); --inner-padding-end: 0px;
--background: transparent;
ion-label { ion-label {
margin-top: var(--card-padding); margin-top: 0px;
margin-bottom: var(--card-padding); margin-bottom: 0px;
&>:last-child {
margin-bottom: 0px;
}
} }
} }
@ -33,8 +36,6 @@
flex-direction: row; flex-direction: row;
core-mod-icon { core-mod-icon {
margin-top: 0px;
margin-bottom: 0px;
--module-icon-padding: 0px; --module-icon-padding: 0px;
--module-legacy-icon-padding: 4px; --module-legacy-icon-padding: 4px;
--module-icon-radius: var(--mdl-shape-borderRadius-xs); --module-icon-radius: var(--mdl-shape-borderRadius-xs);
@ -46,7 +47,7 @@
.activity-title { .activity-title {
flex-grow: 1; flex-grow: 1;
align-self: center; align-self: center;
@include margin-horizontal(null, var(--card-padding)); @include margin-horizontal(null, var(--horizontal-spacing));
.item-heading ion-icon { .item-heading ion-icon {
@include margin-horizontal(8px, null); @include margin-horizontal(8px, null);
@ -56,7 +57,6 @@
.core-module-buttons { .core-module-buttons {
align-self: self-start; align-self: self-start;
margin: 0;
display: flex; display: flex;
flex-flow: row; flex-flow: row;
@ -86,6 +86,13 @@
} }
} }
core-mod-icon,
.activity-title,
.core-module-buttons {
margin-top: var(--vertical-spacing);
margin-bottom: var(--vertical-spacing);
}
.core-module-additional-info { .core-module-additional-info {
display: flex; display: flex;
align-items: center; align-items: center;
@ -106,7 +113,7 @@
} }
core-course-module-completion { core-course-module-completion {
--margin: 8px 0px; --margin: var(--vertical-spacing) 0px;
} }
.activity-dates { .activity-dates {
@ -121,9 +128,14 @@
.activity-description-availabilityinfo, .activity-description-availabilityinfo,
.activity-extrabadges { .activity-extrabadges {
margin-top: 8px; margin-top: var(--vertical-spacing);
padding-top: 8px; margin-bottom: var(--vertical-spacing);
}
.activity-extrabadges,
.core-module-description {
border-top: 1px solid var(--stroke); border-top: 1px solid var(--stroke);
display: block;
} }
.activity-extrabadges { .activity-extrabadges {
@ -131,26 +143,16 @@
color: var(--medium); color: var(--medium);
} }
.activity-description-availabilityinfo { .activity-description-availabilityinfo .core-module-availabilityinfo {
.core-module-availabilityinfo { background: var(--gray-300);
background: var(--gray-300); font: var(--mdl-typography-label-font-lg);
border-radius: var(--mdl-shape-borderRadius-sm);
::ng-deep ul {
margin-top: 8px; margin-top: 8px;
padding: 8px; margin-bottom: 0px;
font-size: var(--mdl-typography-body-fontSize-md);
line-height: 120%;
::ng-deep ul { li {
margin-top: 8px; margin-bottom: 4px;
margin-bottom: 0px;
li {
margin-bottom: 4px;
}
}
ion-icon {
@include margin-horizontal(null, 8px);
} }
} }
} }
@ -162,13 +164,25 @@
clear: both; clear: both;
} }
.core-course-last-module-viewed { .colored-box-with-icon {
padding: 8px 12px; margin-top: var(--vertical-spacing);
color: var(--subdued-text-color); margin-bottom: var(--vertical-spacing);
border-top: 1px solid var(--stroke);
border: 0px;
padding: var(--colored-box-padding);
border-radius: var(--mdl-shape-borderRadius-sm);
ion-icon { ion-icon {
margin-right: 4px; @include margin-horizontal(null, var(--mdl-spacing-2));
margin-top: auto;
margin-bottom: auto;
}
&.core-course-last-module-viewed {
display: flex;
background-color: var(--info-tint);
color: var(--info-shade);
font: var(--mdl-typography-label-font-md);
} }
} }
@ -185,17 +199,14 @@
} }
&.indented ion-card { &.indented ion-card {
@include margin-horizontal(calc(var(--horizontal-margin) + 1rem), null); @include margin-horizontal(calc(var(--horizontal-spacing) + 1rem), null);
}
& + ::ng-deep core-course-module ion-card {
border-top: 1px solid var(--ion-card-border-color);
} }
// Hide download folder icon meanwhile MOBILE-4147 is not solved // Hide download folder icon meanwhile MOBILE-4147 is not solved
core-format-text.core-module-description ::ng-deep .description-inner .navitem { core-format-text.core-module-description ::ng-deep .description-inner .navitem {
display: none; display: none;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -1,5 +1,16 @@
ion-accordion { ion-accordion {
.ion-accordion-toggle-icon[slot="start"] { .ion-accordion-toggle-icon[slot="start"] {
@include margin-horizontal(null, var(--mdl-spacing-4)); @include margin-horizontal(null, var(--mdl-spacing-2));
background-color: var(--gray-100);
border-radius: 50%;
padding: var(--mdl-spacing-1);
}
}
:root.dark {
ion-accordion {
.ion-accordion-toggle-icon[slot="start"] {
background-color: var(--gray-800);
}
} }
} }

View File

@ -310,15 +310,15 @@
display: block; display: block;
ion-card { ion-card {
--vertical-margin: 10px; --vertical-spacing: 10px;
--horizontal-margin: 10px; --horizontal-spacing: 10px;
width: calc(100% - var(--horizontal-margin) - var(--horizontal-margin)); width: calc(100% - var(--horizontal-spacing) - var(--horizontal-spacing));
height: calc(100% - var(--vertical-margin) - var(--vertical-margin)); height: calc(100% - var(--vertical-spacing) - var(--vertical-spacing));
margin: var(--vertical-margin) var(--horizontal-margin); margin: var(--vertical-spacing) var(--horizontal-spacing);
@media (max-width: 360px) { @media (max-width: 360px) {
--horizontal-margin: 6px; --horizontal-spacing: 6px;
} }
} }
} }