@@ -73,13 +74,12 @@
-
+
+ [layout]="layout">
diff --git a/src/addons/block/myoverview/components/myoverview/myoverview.ts b/src/addons/block/myoverview/components/myoverview/myoverview.ts
index 5b676a067..b7201c44c 100644
--- a/src/addons/block/myoverview/components/myoverview/myoverview.ts
+++ b/src/addons/block/myoverview/components/myoverview/myoverview.ts
@@ -76,10 +76,8 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
component: AddonBlockMyOverviewFilterOptionsComponent,
};
- layouts: AddonBlockMyOverviewLayoutOptions = {
- options: [],
- selected: 'card',
- };
+ isLayoutSwitcherAvailable = false;
+ layout: AddonBlockMyOverviewLayouts = 'list';
sort: AddonBlockMyOverviewSortOptions = {
shortnameEnabled: false,
@@ -142,9 +140,9 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
promises.push(this.currentSite.getLocalSiteConfig(
'AddonBlockMyOverviewLayout',
- this.layouts.selected,
+ this.layout,
).then((value) => {
- this.layouts.selected = value;
+ this.layout = value;
return;
}));
@@ -340,10 +338,10 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
* @param layouts Config available layouts.
*/
protected loadLayouts(layouts?: string[]): void {
- this.layouts.options = [];
+ const layoutsOptions: AddonBlockMyOverviewLayouts[] = [];
if (layouts === undefined) {
- this.layouts.options = ['card', 'list'];
+ this.isLayoutSwitcherAvailable = true;
return;
}
@@ -354,19 +352,21 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
}
const validLayout: AddonBlockMyOverviewLayouts = layout == 'summary' ? 'list' : layout as AddonBlockMyOverviewLayouts;
- if (!this.layouts.options.includes(validLayout)) {
- this.layouts.options.push(validLayout);
+ if (!layoutsOptions.includes(validLayout)) {
+ layoutsOptions.push(validLayout);
}
});
- // If no layout is available use card.
- if (this.layouts.options.length == 0) {
- this.layouts.options = ['card'];
+ // If no layout is available use list.
+ if (layoutsOptions.length == 0) {
+ layoutsOptions.push('list');
}
- if (!this.layouts.options.includes(this.layouts.selected)) {
- this.layouts.selected = this.layouts.options[0];
+ if (!layoutsOptions.includes(this.layout)) {
+ this.layout = layoutsOptions[0];
}
+
+ this.isLayoutSwitcherAvailable = layoutsOptions.length > 1;
}
/**
@@ -632,15 +632,15 @@ export class AddonBlockMyOverviewComponent extends CoreBlockBaseComponent implem
}
/**
- * Saves layout value.
+ * Toggle layout value.
*
* @param layout New layout.
* @return Promise resolved when done.
*/
- async saveLayout(layout: AddonBlockMyOverviewLayouts): Promise {
- this.layouts.selected = layout;
+ async toggleLayout(layout: AddonBlockMyOverviewLayouts): Promise {
+ this.layout = layout;
- await this.currentSite.setLocalSiteConfig('AddonBlockMyOverviewLayout', this.layouts.selected);
+ await this.currentSite.setLocalSiteConfig('AddonBlockMyOverviewLayout', this.layout);
}
/**
@@ -702,11 +702,6 @@ export type AddonBlockMyOverviewFilterOptions = {
count: number;
};
-type AddonBlockMyOverviewLayoutOptions = {
- options: AddonBlockMyOverviewLayouts[];
- selected: AddonBlockMyOverviewLayouts;
-};
-
type AddonBlockMyOverviewSortOptions = {
shortnameEnabled: boolean;
selected: string;
diff --git a/src/core/components/combobox/combobox.scss b/src/core/components/combobox/combobox.scss
index 037d35189..7bbd14a23 100644
--- a/src/core/components/combobox/combobox.scss
+++ b/src/core/components/combobox/combobox.scss
@@ -55,9 +55,8 @@ ion-button {
color: var(--color);
text-overflow: ellipsis;
white-space: nowrap;
- min-height: 26px;
+ min-height: var(--a11y-min-target-size);
overflow: hidden;
- margin: 8px;
box-shadow: var(--box-shadow);
&:focus,
@@ -71,6 +70,7 @@ ion-select {
border-style: var(--border-style);
border-width: var(--border-width);
border-radius: var(--core-combobox-radius);
+ margin: 8px;
&::part(icon) {
margin: var(--icon-margin);
@@ -103,9 +103,9 @@ ion-select {
ion-button {
border-radius: var(--core-combobox-radius);
+ margin: 4px 8px;
flex: 1;
- min-height: 45px;
&::part(native) {
text-transform: none;
diff --git a/src/core/components/combobox/combobox.ts b/src/core/components/combobox/combobox.ts
index c66579939..32e56a904 100644
--- a/src/core/components/combobox/combobox.ts
+++ b/src/core/components/combobox/combobox.ts
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-import { Component, EventEmitter, Input, Output, ViewChild, ViewEncapsulation } from '@angular/core';
+import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
import { Translate } from '@singletons';
import { ModalOptions } from '@ionic/core';
import { CoreDomUtils } from '@services/utils/dom';
@@ -40,7 +40,6 @@ import { IonSelect } from '@ionic/angular';
selector: 'core-combobox',
templateUrl: 'core-combobox.html',
styleUrls: ['combobox.scss'],
- encapsulation: ViewEncapsulation.ShadowDom,
})
export class CoreComboboxComponent {
diff --git a/src/core/components/combobox/core-combobox.html b/src/core/components/combobox/core-combobox.html
index 6b3d2ceb2..baa897fa3 100644
--- a/src/core/components/combobox/core-combobox.html
+++ b/src/core/components/combobox/core-combobox.html
@@ -1,4 +1,4 @@
-
+
0" slot="start">{{badge}}
diff --git a/src/core/features/search/components/search-box/search-box.scss b/src/core/features/search/components/search-box/search-box.scss
index 9649ae962..950c685b5 100644
--- a/src/core/features/search/components/search-box/search-box.scss
+++ b/src/core/features/search/components/search-box/search-box.scss
@@ -1,5 +1,5 @@
:host {
- min-height: 61px;
+ min-height: var(--a11y-min-target-size);
display: block;
position: relative;
@@ -10,6 +10,10 @@
z-index: 4;
margin-top: 8px;
margin-bottom: 8px;
+ --border-color: var(--core-search-box-border-color);
+ --border-radius: var(--core-search-box-border-radius);
+ --background: var(--core-search-box-background);
+ --color: var(--core-search-box-border-color);
}
ion-button.button {
@@ -19,6 +23,8 @@
.core-search-history {
max-height: calc(-120px + 80vh);
overflow-y: auto;
+ background: var(--core-search-box-background);
+ --ion-item-background: var(--core-search-box-background);
.item:hover {
--background: var(--light);
@@ -40,5 +46,7 @@
ion-item {
--min-height: var(--a11y-min-target-size);
+ --border-width: 0px;
+ --background: var(--core-search-box-background);
}
}
diff --git a/src/theme/theme.base.scss b/src/theme/theme.base.scss
index 01d92d330..36488a6a7 100644
--- a/src/theme/theme.base.scss
+++ b/src/theme/theme.base.scss
@@ -265,9 +265,15 @@ button,
min-width: var(--a11y-min-target-size);
}
+ion-button {
+ margin: 4px 8px;
+}
+
ion-button.button-outline {
- --border-width: 1px;
- --background: var(--contrast-background);
+ --border-width: var(--core-input-border-width);
+ --border-color: var(--core-input-stroke);
+ --background: var(--core-input-background);
+ --color: var(--text-color);
}
ion-button.button-solid {
@@ -314,12 +320,7 @@ ion-button.button.button-clear.button-has-icon-only {
ion-button.button.button-solid,
ion-button.button.button-outline {
- --border-radius: var(--small-radius);
-}
-
-// Clear buttons will be black.
-ion-button.button-clear {
- --primary: var(--primary);
+ --border-radius: var(--core-input-radius);
}
[role="button"],
diff --git a/src/theme/theme.dark.scss b/src/theme/theme.dark.scss
index 1d55e6631..9f06651c1 100644
--- a/src/theme/theme.dark.scss
+++ b/src/theme/theme.dark.scss
@@ -37,16 +37,19 @@
--ion-text-color: var(--text-color);
--ion-text-color-rgb: #{$text-color-dark-rgb};
--subdued-text-color: var(--gray-400);
+ --stroke: var(--gray-700);
+
+ --contrast-background: black;
--ion-card-color: var(--text-color);
--ion-card-background: var(--ion-item-background);
- --contrast-background: black;
-
- --stroke: var(--gray-700);
--ion-border-color: var(--stroke);
--ion-item-border-color: var(--stroke);
+ --core-input-stroke: var(--gray-700);
+ --core-input-background: var(--gray-900);
+
ion-content {
--background: var(--ion-background-color);
--background-alternative: var(--gray-900);
@@ -80,9 +83,18 @@
--item-divider-color: var(--text-color);
--spacer-background: var(--gray-700);
- --core-combobox-background: var(--ion-item-background);
- --core-combobox-color: var(--gray-100);
- --core-combobox-border-color: var(--stroke);
+ --ion-searchbar-background: var(--ion-background-color);
+ --ion-searchbar-border-color: var(--core-input-stroke);
+ --ion-searchbar-color: var(--text-color);
+ --ion-searchbar-icon-color: var(--core-input-stroke);
+
+ --core-search-box-background: var(--ion-background-color);
+ --core-search-box-border-color: var(--core-input-stroke);
+ --core-search-box-color: var(--text-color);
+
+ --core-combobox-background: var(--core-input-background);
+ --core-combobox-color: var(--text-color);
+ --core-combobox-border-color: var(--core-input-stroke);
--core-login-background: var(--gray-900);
--core-login-text-color: var(--white);
diff --git a/src/theme/theme.light.scss b/src/theme/theme.light.scss
index 9a0b55bc0..39eb96a05 100644
--- a/src/theme/theme.light.scss
+++ b/src/theme/theme.light.scss
@@ -43,40 +43,44 @@
--ion-color-step-950: var(--gray-900);
--ion-color-step-1000: var(--black);
- --text-color: #{$text-color};
- --background-color: #{$background-color};
-
- --core-online-color: #5cb85c;
-
- --stroke: var(--gray-300);
- --ion-border-color: var(--stroke);
- --ion-item-border-color: var(--stroke);
-
@each $color-name, $unused in $colors {
@include generate-color($color-name, $colors);
}
--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);
--a11y-focus-width: 2px;
--zoom-level: 100%;
+ --small-radius: 4px;
+ --medium-radius: 8px;
+ --big-radius: 16px;
+ --huge-radius: 24px;
+
+ --text-color: #{$text-color};
+ --background-color: #{$background-color};
+ --stroke: var(--gray-300);
+
+ --core-online-color: #5cb85c;
+
+ --ion-background-color: var(--background-color);
+ --ion-item-border-color: var(--stroke);
+ --ion-background-color-rgb: #{$background-color-rgb};
+ --ion-border-color: var(--stroke);
+
+ --core-input-stroke: var(--gray-400);
+ --core-input-background: var(--ion-background-color);
+ --core-input-radius: var(--small-radius);
+ --core-input-border-width: 1px;
+
--module-icon-size: 24px;
--module-icon-radius: var(--medium-radius);
--list-item--max-width: 768px;
- --ion-background-color: var(--background-color);
- --ion-background-color-rgb: #{$background-color-rgb};
-
--contrast-background: white;
--ion-text-color: var(--text-color);
@@ -155,16 +159,40 @@
--border-width: 0 0 var(--core-header-toolbar-border-width) 0;
}
+ --ion-searchbar-background: var(--ion-background-color);
+ --ion-searchbar-border-color: var(--core-input-stroke);
+ --ion-searchbar-border-radius: var(--core-input-radius);
+ --ion-searchbar-color: var(--text-color);
+ --ion-searchbar-icon-color: var(--core-input-stroke);
ion-searchbar {
- --background: var(--ion-item-background);
+ --background: var(--ion-searchbar-background);
+ --border-color: var(--ion-searchbar-border-color);
+ --icon-color: var(--ion-searchbar-icon-color);
+
+ .searchbar-input-container {
+ color: var(--ion-searchbar-color) !important;
+ }
.searchbar-input {
height: var(--a11y-min-target-size);
- border: 1px solid var(--stroke);
+ border: 1px solid var(--ion-searchbar-border-color);
box-shadow: none;
- border-radius: var(--medium-radius);
+ border-radius: var(--ion-searchbar-border-radius);
+ background: var(--ion-searchbar-background) !important;
}
}
+ --core-search-box-background: var(--ion-background-color);
+ --core-search-box-border-color: var(--core-input-stroke);
+ --core-search-box-border-radius: var(--core-input-radius);
+ --core-search-box-color: var(--text-color);
+
+ --core-combobox-background: var(--core-input-background);
+ --core-combobox-color: var(--text-color);
+ --core-combobox-border-color: var(--core-input-stroke);
+ --core-combobox-border-width: var(--core-input-border-width);
+ --core-combobox-radius: var(--core-input-radius);
+ --core-combobox-box-shadow: none;
+
ion-action-sheet {
--button-color: var(--ion-text-color);
--button-color-selected: var(--ion-text-color);
@@ -252,13 +280,6 @@
--min-width: var(--a11y-min-target-size);
}
- --core-combobox-background: var(--ion-item-background);
- --core-combobox-color: var(--gray-900);
- --core-combobox-border-color: var(--stroke);
- --core-combobox-border-width: 1px;
- --core-combobox-radius: var(--medium-radius);
- --core-combobox-box-shadow: none;
-
--selected-item-color: var(--primary);
--selected-item-border-width: 5px;