Skip to content

Commit

Permalink
feat(select-modal): add ionic theme styling (#30007)
Browse files Browse the repository at this point in the history
  • Loading branch information
thetaPC authored Nov 8, 2024
1 parent 9e30629 commit a1f3fcc
Show file tree
Hide file tree
Showing 45 changed files with 84 additions and 19 deletions.
11 changes: 4 additions & 7 deletions core/src/components/item/item.ionic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,6 @@ slot[name="end"]::slotted(*) {
// Item: Focused
// --------------------------------------------------

:host(.ion-focused) .item-native {
// This prevents the focus ring from clipping.
overflow: visible;
}

:host(.ion-focused) .item-native::after {
@include globals.border-radius(inherit);
@include globals.position(0, 0, 0, 0);
Expand All @@ -100,11 +95,13 @@ slot[name="end"]::slotted(*) {
// Full lines - apply the border to the item
// Inset lines - apply the border to the item inner
: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) {
--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)
Expand Down
11 changes: 11 additions & 0 deletions core/src/components/radio/radio.common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,17 @@ input {
display: block;
}

// Radio Label
// ----------------------------------------------------------------

.label-text-wrapper {
text-overflow: ellipsis;

white-space: nowrap;

overflow: hidden;
}

// Radio Label Placement - Start
// ----------------------------------------------------------------

Expand Down
8 changes: 0 additions & 8 deletions core/src/components/radio/radio.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
// Radio Label
// ----------------------------------------------------------------

.label-text-wrapper {
text-overflow: ellipsis;

white-space: nowrap;

overflow: hidden;
}

:host(.in-item) .label-text-wrapper {
@include margin($radio-item-label-margin-top, null, $radio-item-label-margin-bottom, null);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions core/src/components/select-modal/select-modal.ionic.scss
Original file line number Diff line number Diff line change
@@ -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;
}
2 changes: 1 addition & 1 deletion core/src/components/select-modal/select-modal.ios.scss
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@import "./select-modal";
@import "./select-modal.common";
2 changes: 1 addition & 1 deletion core/src/components/select-modal/select-modal.md.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "./select-modal";
@import "./select-modal.common";
@import "../../themes/mixins.scss";
@import "../item/item.md.vars";

Expand Down
2 changes: 1 addition & 1 deletion core/src/components/select-modal/select-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { SelectModalOption } from './select-modal-interface';
styleUrls: {
ios: 'select-modal.ios.scss',
md: 'select-modal.md.scss',
ionic: 'select-modal.md.scss',
ionic: 'select-modal.ionic.scss',
},
scoped: true,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
* do have RTL logic, but those are tested in their
* 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'), () => {
let selectModalPage: SelectModalPage;

Expand Down

0 comments on commit a1f3fcc

Please sign in to comment.