diff --git a/BREAKING.md b/BREAKING.md index 10824c6fc08..f9251a3648f 100644 --- a/BREAKING.md +++ b/BREAKING.md @@ -360,7 +360,7 @@ The `default` value of the `fill` property is deprecated. It logs a warning and - `IonChip.hue.bold.outline.activated.background` to `rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08)` - `IonChip.hue.bold.solid.semantic.activated.background` and `IonChip.hue.bold.outline.semantic.activated.background` to `rgba(var(--ion-color-base-rgb), 0.16)` - In the `md` theme, a disabled chip now has an opacity of `0.38` instead of `0.4`, in accordance with the Material Design 2 guidelines. To revert to the previous appearance, set `IonChip.state.disabled.opacity` to `0.4` for global styles, or `--ion-chip-state-disabled-opacity` for component-specific styles. -- In the `ios` theme, the chip is now `28px` tall instead of `32px`, with `4px` `10px` padding instead of `6px` `12px`, and its label is `15px` with a `20px` line height and `-0.016em` letter spacing instead of `14px` with inherited line height and letter spacing, in accordance with the iOS guidelines for small bezeled buttons. To revert to the previous appearance, set `IonChip.size.large.min.height` to `32px`, `IonChip.size.large.padding` to `6px` on the top and bottom and `12px` on the start and end, `IonChip.size.large.font.size` to `clamp(13px, 0.875rem, 22px)`, `IonChip.size.large.line.height` and `IonChip.size.large.letterSpacing` to `inherit`, `IonChip.icon.font.size` to `1.43em`, and `IonChip.avatar.width` and `IonChip.avatar.height` to `1.71em` for global styles, or the matching `--ion-chip-size-large-*`, `--ion-chip-icon-font-size` and `--ion-chip-avatar-*` variables for component-specific styles. +- In the `ios` theme, the chip is now `28px` tall instead of `32px`, with `4px` `10px` padding instead of `6px` `12px`, and its label is `15px` with a `20px` line height and `-0.016em` letter spacing instead of `14px` with inherited line height and letter spacing, in accordance with the iOS guidelines for small bezeled buttons. To revert to the previous appearance, set `IonChip.size.large.min.height` to `32px`, `IonChip.size.large.padding` to `6px` on the top and bottom and `12px` on the start and end, `IonChip.size.large.font.size` to `clamp(13px, 0.875rem, 22px)`, `IonChip.size.large.line.height` and `IonChip.size.large.letterSpacing` to `inherit`, `IonChip.size.large.icon.font.size` to `1.43em`, and `IonChip.avatar.width` and `IonChip.avatar.height` to `1.71em` for global styles, or the matching `--ion-chip-size-large-*` and `--ion-chip-avatar-*` variables for component-specific styles. - In the `ios` theme, a slotted `ion-icon` now has `4px` of space between it and the label instead of `8px`, in accordance with the iOS guidelines for buttons with an icon and a label. To revert to the previous appearance, set `IonChip.icon.leading.margin.end` and `IonChip.icon.trailing.margin.start` to `8px` for global styles, or `--ion-chip-icon-leading-margin-end` and `--ion-chip-icon-trailing-margin-start` for component-specific styles. - In the `ios` theme, a chip with a `color` now has a background of `15%` of the color instead of `8%`, in accordance with the iOS guidelines for bezeled buttons. Its hover and focus backgrounds are now `19%` instead of `12%`, and its pressed background `23%` instead of `16%`. To revert to the previous appearance, set `IonChip.hue.bold.solid.semantic.default.background`, `IonChip.hue.bold.solid.semantic.hover.background`, `IonChip.hue.bold.solid.semantic.focus.background` and `IonChip.hue.bold.solid.semantic.activated.background` for global styles, or the matching `--ion-chip-hue-bold-solid-semantic-*-background` variables for component-specific styles. - In the `ios` theme, a disabled chip now has an opacity of `0.5` instead of `0.4`, to match the disabled `ios` button. To revert to the previous appearance, set `IonChip.state.disabled.opacity` to `0.4` for global styles, or `--ion-chip-state-disabled-opacity` for component-specific styles. diff --git a/core/api.txt b/core/api.txt index 65c15e43e54..a6c3e6d3d45 100644 --- a/core/api.txt +++ b/core/api.txt @@ -1072,7 +1072,6 @@ ion-chip,css-prop,--ion-chip-hue-subtle-solid-semantic-default-color ion-chip,css-prop,--ion-chip-hue-subtle-solid-semantic-focus-background ion-chip,css-prop,--ion-chip-hue-subtle-solid-semantic-hover-background ion-chip,css-prop,--ion-chip-icon-color -ion-chip,css-prop,--ion-chip-icon-font-size ion-chip,css-prop,--ion-chip-icon-leading-margin-bottom ion-chip,css-prop,--ion-chip-icon-leading-margin-end ion-chip,css-prop,--ion-chip-icon-leading-margin-start @@ -1097,6 +1096,7 @@ ion-chip,css-prop,--ion-chip-size-large-avatar-trailing-margin-end ion-chip,css-prop,--ion-chip-size-large-avatar-trailing-margin-start ion-chip,css-prop,--ion-chip-size-large-avatar-trailing-margin-top ion-chip,css-prop,--ion-chip-size-large-font-size +ion-chip,css-prop,--ion-chip-size-large-icon-font-size ion-chip,css-prop,--ion-chip-size-large-letter-spacing ion-chip,css-prop,--ion-chip-size-large-line-height ion-chip,css-prop,--ion-chip-size-large-min-height @@ -1113,6 +1113,7 @@ ion-chip,css-prop,--ion-chip-size-small-avatar-trailing-margin-end ion-chip,css-prop,--ion-chip-size-small-avatar-trailing-margin-start ion-chip,css-prop,--ion-chip-size-small-avatar-trailing-margin-top ion-chip,css-prop,--ion-chip-size-small-font-size +ion-chip,css-prop,--ion-chip-size-small-icon-font-size ion-chip,css-prop,--ion-chip-size-small-letter-spacing ion-chip,css-prop,--ion-chip-size-small-line-height ion-chip,css-prop,--ion-chip-size-small-min-height diff --git a/core/src/components/chip/chip.interface.ts b/core/src/components/chip/chip.interface.ts index a707987556f..12178121aba 100644 --- a/core/src/components/chip/chip.interface.ts +++ b/core/src/components/chip/chip.interface.ts @@ -83,6 +83,12 @@ type IonChipSizeDefinition = { height?: string | number; }; + icon?: { + font?: { + size?: string | number; + }; + }; + avatar?: IonChipMediaDefinition; }; @@ -106,10 +112,6 @@ type IonChipMediaDefinition = { type IonChipIconDefinition = IonChipMediaDefinition & { color?: string; - - font?: { - size?: string | number; - }; }; type IonChipAvatarDefinition = { diff --git a/core/src/components/chip/chip.scss b/core/src/components/chip/chip.scss index fd96be6d2da..7b106e22947 100644 --- a/core/src/components/chip/chip.scss +++ b/core/src/components/chip/chip.scss @@ -22,6 +22,7 @@ * @prop --ion-chip-size-small-min-height: Minimum height of the `small` chip size * @prop --ion-chip-size-small-font-size: Font size of the `small` chip size * @prop --ion-chip-size-small-line-height: Line height of the `small` chip size + * @prop --ion-chip-size-small-icon-font-size: Font size of the slotted `ion-icon` of the `small` chip size * @prop --ion-chip-size-small-avatar-leading-margin-top: Top margin of the slotted `ion-avatar` when it is the first child of the `small` chip size * @prop --ion-chip-size-small-avatar-leading-margin-end: Right margin if direction is left-to-right, and left margin if direction is right-to-left of the slotted `ion-avatar` when it is the first child of the `small` chip size * @prop --ion-chip-size-small-avatar-leading-margin-bottom: Bottom margin of the slotted `ion-avatar` when it is the first child of the `small` chip size @@ -38,6 +39,7 @@ * @prop --ion-chip-size-large-min-height: Minimum height of the `large` chip size * @prop --ion-chip-size-large-font-size: Font size of the `large` chip size * @prop --ion-chip-size-large-line-height: Line height of the `large` chip size + * @prop --ion-chip-size-large-icon-font-size: Font size of the slotted `ion-icon` of the `large` chip size * @prop --ion-chip-size-large-avatar-leading-margin-top: Top margin of the slotted `ion-avatar` when it is the first child of the `large` chip size * @prop --ion-chip-size-large-avatar-leading-margin-end: Right margin if direction is left-to-right, and left margin if direction is right-to-left of the slotted `ion-avatar` when it is the first child of the `large` chip size * @prop --ion-chip-size-large-avatar-leading-margin-bottom: Bottom margin of the slotted `ion-avatar` when it is the first child of the `large` chip size @@ -120,7 +122,6 @@ * * Slotted Icon * @prop --ion-chip-icon-color: Color of the slotted `ion-icon` - * @prop --ion-chip-icon-font-size: Font size of the slotted `ion-icon` * @prop --ion-chip-icon-leading-margin-top: Top margin of the slotted `ion-icon` when it is the first child * @prop --ion-chip-icon-leading-margin-end: Right margin if direction is left-to-right, and left margin if direction is right-to-left of the slotted `ion-icon` when it is the first child * @prop --ion-chip-icon-leading-margin-bottom: Bottom margin of the slotted `ion-icon` when it is the first child @@ -551,8 +552,10 @@ // --------------------------------------------- // Icon -::slotted(ion-icon) { - font-size: var(--ion-chip-icon-font-size); +@each $size in (small, large) { + :host(.chip-size-#{$size}) ::slotted(ion-icon) { + font-size: var(--ion-chip-size-#{$size}-icon-font-size); + } } :host(:not(.ion-color)) ::slotted(ion-icon) { diff --git a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Chrome-linux.png index 0e3025a0f79..fe6b7766dc1 100644 Binary files a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Firefox-linux.png index ccd7040918b..19b930910d0 100644 Binary files a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Safari-linux.png index 7b5ce9b2722..fc1e3bd760b 100644 Binary files a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-color-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Chrome-linux.png index ad04f41112e..55662fa83d6 100644 Binary files a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Firefox-linux.png index 7cd37a23021..d3ef267580b 100644 Binary files a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Safari-linux.png index 73297d4f354..fb001d5ed38 100644 Binary files a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-outline-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Chrome-linux.png index 5549cef1aea..851de41f613 100644 Binary files a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Firefox-linux.png index c1916ef28bb..262f1860da1 100644 Binary files a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Safari-linux.png index f8c3f90b2c7..6e56425f555 100644 Binary files a/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/basic/chip.e2e.ts-snapshots/chip-solid-color-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Chrome-linux.png index 96ba51c486f..1d982b6167b 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Firefox-linux.png index 9f286feef3c..8042581dd7e 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Safari-linux.png index 3602d52a0d0..6c404006746 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Chrome-linux.png index a7b9a077943..f5ca7685113 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Firefox-linux.png index cb62d574b64..6a52759f38a 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Safari-linux.png index 1c39a09fa84..4438d1af944 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Chrome-linux.png index 5ab06734bfd..27a2c6d3278 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Firefox-linux.png index 9503a3fd01c..6de45131933 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Safari-linux.png index ac37637568b..b7f0e9a0118 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Chrome-linux.png index cedc53f2aa1..9b7c7d6e0e1 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Firefox-linux.png index 8c3f2160828..61fdd2548b3 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Safari-linux.png index 2e63a6a4065..f6b3b5869f5 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Chrome-linux.png index ffe326457fd..63e04164b61 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Firefox-linux.png index 250a59195ba..e586a7157d9 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Safari-linux.png index bd9a83242fd..6017b4658b5 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts b/core/src/components/chip/test/size/chip.e2e.ts index 2a7ddc16e03..66db157e63f 100644 --- a/core/src/components/chip/test/size/chip.e2e.ts +++ b/core/src/components/chip/test/size/chip.e2e.ts @@ -1,8 +1,21 @@ import { expect } from '@playwright/test'; import { configs, test } from '@utils/test/playwright'; +import type { IonChipSize } from '../../chip.interface'; import { ION_CHIP_SIZES } from '../../chip.interface'; +const AVATAR_SRC = + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48cGF0aCBmaWxsPSIjYzVkYmZmIiBkPSJNMCAwaDUxMnY1MTJIMHoiLz48cGF0aCBkPSJNMjU2IDMwNGM2MS42IDAgMTEyLTUwLjQgMTEyLTExMlMzMTcuNiA4MCAyNTYgODBzLTExMiA1MC40LTExMiAxMTIgNTAuNCAxMTIgMTEyIDExMnptMCA0MGMtNzQuMiAwLTIyNCAzNy44LTIyNCAxMTJ2NTZoNDQ4di01NmMwLTc0LjItMTQ5LjgtMTEyLTIyNC0xMTJ6IiBmaWxsPSIjODJhZWZmIi8+PC9zdmc+'; + +/** + * The avatar size that fits each chip size. Only the ionic theme + * lets the avatar's `size` prop set its size inside a chip. + */ +const AVATAR_SIZES: Record = { + small: 'xxsmall', + large: 'xsmall', +}; + /** * This behavior does not vary across directions. */ @@ -21,6 +34,36 @@ configs({ modes: ['ionic-md', 'md', 'ios'], directions: ['ltr'] }).forEach(({ ti await expect(chip).toHaveScreenshot(screenshot(`chip-size-${size}`)); }); + + test(`should render ${size} chip with an icon`, async ({ page }) => { + await page.setContent( + ` + + Icon + `, + config + ); + + const chip = page.locator('ion-chip'); + + await expect(chip).toHaveScreenshot(screenshot(`chip-size-${size}-icon`)); + }); + + test(`should render ${size} chip with an avatar`, async ({ page }) => { + await page.setContent( + ` + + + + Avatar + `, + config + ); + + const chip = page.locator('ion-chip'); + + await expect(chip).toHaveScreenshot(screenshot(`chip-size-${size}-avatar`)); + }); }); }); }); diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ionic-md-ltr-light-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..1e28334825d Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ionic-md-ltr-light-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..b8636909278 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ionic-md-ltr-light-Mobile-Safari-linux.png new file mode 100644 index 00000000000..3add5625976 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..f457b09b357 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..7b4a53d4d6a Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ios-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 00000000000..83536dce7d8 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..01be1d1ec42 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..5792ebada8d Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 00000000000..e301378989c Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-avatar-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ionic-md-ltr-light-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..5aa3d32eb74 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ionic-md-ltr-light-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..ff1029e8691 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ionic-md-ltr-light-Mobile-Safari-linux.png new file mode 100644 index 00000000000..fc0989adc56 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..23de42784fb Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..2c5bbed1a38 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ios-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 00000000000..55b06685020 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..434c7ef0469 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..6afea0784dd Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 00000000000..1461299a61a Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-icon-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Chrome-linux.png index c11a5c1170b..d5512843fb0 100644 Binary files a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Firefox-linux.png index b76cdb2a9ad..3628847fc51 100644 Binary files a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Safari-linux.png index 447f709bcf4..7fb9c76cd5e 100644 Binary files a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ionic-md-ltr-light-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..cef1303bc56 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ionic-md-ltr-light-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..3772aefd104 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ionic-md-ltr-light-Mobile-Safari-linux.png new file mode 100644 index 00000000000..b2113abb0e5 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..832273129cd Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..96f65305d5b Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ios-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 00000000000..db3570d160f Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..b469015fb78 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..145e8d7978c Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 00000000000..f5082a3f456 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-avatar-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ionic-md-ltr-light-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..6baa4bc5cc9 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ionic-md-ltr-light-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..a79eabcbc8b Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ionic-md-ltr-light-Mobile-Safari-linux.png new file mode 100644 index 00000000000..4b08c15c170 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ios-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ios-ltr-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..674b394e037 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ios-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ios-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ios-ltr-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..097ce114332 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ios-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ios-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ios-ltr-Mobile-Safari-linux.png new file mode 100644 index 00000000000..958b7f125f8 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-ios-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..e6604ffc013 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..beff3e73f89 Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 00000000000..11eeb60479c Binary files /dev/null and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-icon-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-ionic-md-ltr-light-Mobile-Chrome-linux.png index c1f7267560c..9c4f5a0f8ef 100644 Binary files a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Chrome-linux.png index 4ee98535129..4916a36d1e7 100644 Binary files a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Firefox-linux.png index 8146229036b..7cd492b9690 100644 Binary files a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Safari-linux.png index 9b752a9e9cb..b78539d0029 100644 Binary files a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Chrome-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Chrome-linux.png index ac591ac20a7..24e736e1e73 100644 Binary files a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Chrome-linux.png and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Firefox-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Firefox-linux.png index 1f6c9dfbee6..549e1e67390 100644 Binary files a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Firefox-linux.png and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Safari-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Safari-linux.png index 6fbcfaa202b..f3f0b4c1648 100644 Binary files a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Safari-linux.png and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-ionic-md-ltr-light-Mobile-Safari-linux.png differ diff --git a/core/src/themes/ionic/default.tokens.ts b/core/src/themes/ionic/default.tokens.ts index bc13305e9d4..53257c8f4b7 100644 --- a/core/src/themes/ionic/default.tokens.ts +++ b/core/src/themes/ionic/default.tokens.ts @@ -1319,9 +1319,9 @@ export const defaultTheme: DefaultTheme = { size: { small: { padding: { - top: 'var(--ion-spacing-xs)', + top: 'var(--ion-spacing-0)', end: 'var(--ion-spacing-sm)', - bottom: 'var(--ion-spacing-xs)', + bottom: 'var(--ion-spacing-0)', start: 'var(--ion-spacing-sm)', }, @@ -1334,14 +1334,40 @@ export const defaultTheme: DefaultTheme = { size: 'var(--ion-font-size-xs)', }, line: { - height: '100%', + height: dynamicFont(global.root, 20), + }, + + icon: { + font: { + size: 'var(--ion-scaling-xxxxs)', + }, + }, + + avatar: { + leading: { + margin: { + top: 'var(--ion-spacing-0)', + end: 'var(--ion-spacing-0)', + bottom: 'var(--ion-spacing-0)', + start: '-4px', + }, + }, + + trailing: { + margin: { + top: 'var(--ion-spacing-0)', + end: '-4px', + bottom: 'var(--ion-spacing-0)', + start: 'var(--ion-spacing-0)', + }, + }, }, }, large: { padding: { - top: 'var(--ion-spacing-xs)', + top: 'var(--ion-spacing-0)', end: 'var(--ion-spacing-sm)', - bottom: 'var(--ion-spacing-xs)', + bottom: 'var(--ion-spacing-0)', start: 'var(--ion-spacing-sm)', }, @@ -1351,10 +1377,36 @@ export const defaultTheme: DefaultTheme = { height: 'var(--ion-scaling-md)', }, font: { - size: 'var(--ion-font-size-sm)', + size: 'var(--ion-font-size-xs)', }, line: { - height: '100%', + height: dynamicFont(global.root, 20), + }, + + icon: { + font: { + size: 'var(--ion-scaling-xxxs)', + }, + }, + + avatar: { + leading: { + margin: { + top: 'var(--ion-spacing-0)', + end: 'var(--ion-spacing-0)', + bottom: 'var(--ion-spacing-0)', + start: '-4px', + }, + }, + + trailing: { + margin: { + top: 'var(--ion-spacing-0)', + end: '-4px', + bottom: 'var(--ion-spacing-0)', + start: 'var(--ion-spacing-0)', + }, + }, }, }, }, @@ -1398,44 +1450,60 @@ export const defaultTheme: DefaultTheme = { solid: { // Default non-semantic states default: { - background: '#3b3b3b', + background: '#383e45', color: '#ffffff', }, + hover: { + background: '#31373d', + }, + // Any of the semantic colors like primary, secondary, etc. semantic: { default: { background: currentColor('base'), color: currentColor('contrast'), }, + + hover: { + background: currentColor('shade'), + }, }, }, outline: { // Default non-semantic states default: { - background: '#3b3b3b', - color: '#ffffff', + background: 'transparent', + color: '#383e45', border: { - color: '#242424', + color: '#383e45', style: 'solid', width: '1px', }, }, + hover: { + background: '#f6f7fa', + }, + // Any of the semantic colors like primary, secondary, etc. semantic: { default: { - background: currentColor('base'), - color: currentColor('contrast'), + background: 'transparent', + color: currentColor('foreground'), border: { - color: currentColor('shade'), + color: currentColor('base'), style: 'solid', width: '1px', }, }, + + hover: { + background: currentColor('shade', { subtle: true }), + }, }, }, }, @@ -1444,8 +1512,12 @@ export const defaultTheme: DefaultTheme = { solid: { // Default non-semantic states default: { - background: '#f3f3f3', - color: '#626262', + background: '#f6f7fa', + color: '#6c727a', + }, + + hover: { + background: '#e6eaee', }, // Any of the semantic colors like primary, secondary, etc. @@ -1454,14 +1526,18 @@ export const defaultTheme: DefaultTheme = { background: currentColor('base', { subtle: true }), color: currentColor('contrast', { subtle: true }), }, + + hover: { + background: currentColor('shade', { subtle: true }), + }, }, }, outline: { // Default non-semantic states default: { - background: '#f3f3f3', - color: '#626262', + background: 'transparent', + color: '#6c727a', border: { color: '#e0e0e0', @@ -1470,11 +1546,15 @@ export const defaultTheme: DefaultTheme = { }, }, + hover: { + background: '#f6f7fa', + }, + // Any of the semantic colors like primary, secondary, etc. semantic: { default: { - background: currentColor('base', { subtle: true }), - color: currentColor('contrast', { subtle: true }), + background: 'transparent', + color: currentColor('foreground', { subtle: true }), border: { color: currentColor('shade', { subtle: true }), @@ -1482,16 +1562,14 @@ export const defaultTheme: DefaultTheme = { width: '1px', }, }, + + hover: { + background: currentColor('shade', { subtle: true }), + }, }, }, }, }, - - icon: { - font: { - size: 'var(--ion-scaling-xxxs)', - }, - }, }, IonCol: { diff --git a/core/src/themes/ios/default.tokens.ts b/core/src/themes/ios/default.tokens.ts index 59325c74c84..13cee8fa2de 100644 --- a/core/src/themes/ios/default.tokens.ts +++ b/core/src/themes/ios/default.tokens.ts @@ -1620,6 +1620,12 @@ export const defaultTheme: DefaultTheme = { height: `${18 / (components.chip.font.size - 2)}`, }, + icon: { + font: { + size: `${20 / components.chip.font.size}em`, + }, + }, + avatar: { leading: { margin: { @@ -1663,6 +1669,12 @@ export const defaultTheme: DefaultTheme = { height: `${20 / components.chip.font.size}`, }, + icon: { + font: { + size: `${20 / components.chip.font.size}em`, + }, + }, + avatar: { leading: { margin: { @@ -1907,10 +1919,6 @@ export const defaultTheme: DefaultTheme = { icon: { color: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.54), - font: { - size: `${20 / components.chip.font.size}em`, - }, - leading: { margin: { top: '-4px', diff --git a/core/src/themes/md/default.tokens.ts b/core/src/themes/md/default.tokens.ts index fee0e35d56e..0c874c6b2b3 100644 --- a/core/src/themes/md/default.tokens.ts +++ b/core/src/themes/md/default.tokens.ts @@ -1777,6 +1777,12 @@ export const defaultTheme: DefaultTheme = { height: `${16 / (components.chip.font.size - 2)}`, }, + icon: { + font: { + size: `${20 / components.chip.font.size}em`, + }, + }, + avatar: { leading: { margin: { @@ -1820,6 +1826,12 @@ export const defaultTheme: DefaultTheme = { height: `${20 / components.chip.font.size}`, }, + icon: { + font: { + size: `${20 / components.chip.font.size}em`, + }, + }, + avatar: { leading: { margin: { @@ -2031,10 +2043,6 @@ export const defaultTheme: DefaultTheme = { icon: { color: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.54), - font: { - size: `${20 / components.chip.font.size}em`, - }, - leading: { margin: { top: '-4px', diff --git a/docs/themes/recipes.md b/docs/themes/recipes.md index ccb57ef7ff4..ee8e9f0cab0 100644 --- a/docs/themes/recipes.md +++ b/docs/themes/recipes.md @@ -36,7 +36,7 @@ icon: { leading: { margin? }, trailing: { margin? } } // not leading: { icon: ``` - `leading` is the part at the inline start (a `start` slot or `:first-child`), and `trailing` is the part at the inline end. -- A position only qualifies its part. Put a value under `leading` or `trailing` only when the part's two positions need different values, and keep shared values on the part itself, like `IonChip.icon.font.size`. +- A position only qualifies its part. Put a value under `leading` or `trailing` only when the part's two positions need different values, and keep shared values on the part itself, like `IonChip.icon.color`. ### Use the shared spacing types