feat(select-modal): add ionic theme styling (#30007)

This commit is contained in:
Maria Hutt
2024-11-08 13:51:32 -08:00
committed by GitHub
parent 9e3062963f
commit a1f3fcc23b
45 changed files with 84 additions and 19 deletions

View File

@ -76,11 +76,6 @@ slot[name="end"]::slotted(*) {
// Item: Focused // Item: Focused
// -------------------------------------------------- // --------------------------------------------------
:host(.ion-focused) .item-native {
// This prevents the focus ring from clipping.
overflow: visible;
}
:host(.ion-focused) .item-native::after { :host(.ion-focused) .item-native::after {
@include globals.border-radius(inherit); @include globals.border-radius(inherit);
@include globals.position(0, 0, 0, 0); @include globals.position(0, 0, 0, 0);
@ -100,11 +95,13 @@ slot[name="end"]::slotted(*) {
// Full lines - apply the border to the item // Full lines - apply the border to the item
// Inset lines - apply the border to the item inner // Inset lines - apply the border to the item inner
:host(.item-lines-full) { :host(.item-lines-full) {
--border-width: #{globals.$ion-border-size-0} #{globals.$ion-border-size-0} #{globals.$ion-border-size-025} #{globals.$ion-border-size-0}; --border-width: #{globals.$ion-border-size-0 globals.$ion-border-size-0 globals.$ion-border-size-025
globals.$ion-border-size-0};
} }
:host(.item-lines-inset) { :host(.item-lines-inset) {
--inner-border-width: #{globals.$ion-border-size-0} #{globals.$ion-border-size-0} #{globals.$ion-border-size-025} #{globals.$ion-border-size-0}; --inner-border-width: #{globals.$ion-border-size-0 globals.$ion-border-size-0 globals.$ion-border-size-025
globals.$ion-border-size-0};
} }
// Full lines - remove the border from the item inner (inset list items) // Full lines - remove the border from the item inner (inset list items)

View File

@ -156,6 +156,17 @@ input {
display: block; display: block;
} }
// Radio Label
// ----------------------------------------------------------------
.label-text-wrapper {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
// Radio Label Placement - Start // Radio Label Placement - Start
// ---------------------------------------------------------------- // ----------------------------------------------------------------

View File

@ -12,14 +12,6 @@
// Radio Label // Radio Label
// ---------------------------------------------------------------- // ----------------------------------------------------------------
.label-text-wrapper {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
:host(.in-item) .label-text-wrapper { :host(.in-item) .label-text-wrapper {
@include margin($radio-item-label-margin-top, null, $radio-item-label-margin-bottom, null); @include margin($radio-item-label-margin-top, null, $radio-item-label-margin-bottom, null);
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -0,0 +1,65 @@
@use "../../themes/ionic/ionic.globals.scss" as globals;
@use "./select-modal.common";
// Ionic Select Modal
// --------------------------------------------------
// Item
// ----------------------------------------------------------------
ion-item {
--border-width: 0;
}
// Toolbar
// ----------------------------------------------------------------
ion-toolbar {
@include globals.typography(globals.$ion-heading-h6-medium);
}
// Radio
// ----------------------------------------------------------------
ion-list ion-radio::part(container) {
display: none;
}
ion-list ion-radio::part(label) {
@include globals.margin(0);
}
// Radio and Checkbox: Label
// ----------------------------------------------------------------
ion-list ion-radio::part(label),
ion-list ion-checkbox::part(label) {
@include globals.typography(globals.$ion-body-lg-medium);
}
// Radio and Checkbox: Checked
// ----------------------------------------------------------------
.item-radio-checked,
.item-checkbox-checked {
--background: #{globals.$ion-semantics-primary-100};
--border-radius: #{globals.$ion-border-radius-400};
}
// Content
// ----------------------------------------------------------------
ion-content {
/**
* The important is needed to override the padding set
* for modal sheet by the `core.ionic.scss` file.
* The modal sheet within the select does not match the
* padding of the modal sheet in the core.
*/
/* stylelint-disable-next-line declaration-no-important */
--padding-start: #{globals.$ion-space-400} !important;
/* stylelint-disable-next-line declaration-no-important */
--padding-end: #{globals.$ion-space-400} !important;
/* stylelint-disable-next-line declaration-no-important */
--padding-bottom: #{globals.$ion-space-1200} !important;
}

View File

@ -1 +1 @@
@import "./select-modal"; @import "./select-modal.common";

View File

@ -1,4 +1,4 @@
@import "./select-modal"; @import "./select-modal.common";
@import "../../themes/mixins.scss"; @import "../../themes/mixins.scss";
@import "../item/item.md.vars"; @import "../item/item.md.vars";

View File

@ -14,7 +14,7 @@ import type { SelectModalOption } from './select-modal-interface';
styleUrls: { styleUrls: {
ios: 'select-modal.ios.scss', ios: 'select-modal.ios.scss',
md: 'select-modal.md.scss', md: 'select-modal.md.scss',
ionic: 'select-modal.md.scss', ionic: 'select-modal.ionic.scss',
}, },
scoped: true, scoped: true,
}) })

View File

@ -82,7 +82,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
* do have RTL logic, but those are tested in their * do have RTL logic, but those are tested in their
* respective component test files. * respective component test files.
*/ */
configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
test.describe(title('select-modal: rendering'), () => { test.describe(title('select-modal: rendering'), () => {
let selectModalPage: SelectModalPage; let selectModalPage: SelectModalPage;