diff --git a/BREAKING.md b/BREAKING.md index 2f960fd5b20..038e7819907 100644 --- a/BREAKING.md +++ b/BREAKING.md @@ -351,7 +351,16 @@ The `default` value of the `fill` property is deprecated. It logs a warning and - `--color` is replaced by `IonChip.hue.subtle.outline.default` for global styles and `--ion-chip-hue-subtle-outline-default-color` for component-specific styles if the chip has a subtle hue and outline fill. - The `outline` property has been deprecated. To achieve an outlined chip, set the `fill` property to `"outline"`. The class `.chip-outline` has also been updated to `.chip-fill-outline` for clarity. - Specific mode classes (e.g., `ion-chip.md`) are no longer supported. Style modifications based on the active theme must be implemented using theme tokens rather than direct class targeting. -- The `border-radius` of the `ios` and `md` chip now defaults to `10px` and `8px`, respectively, instead of `16px` in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"round"`, or override the `IonChip.shape.round.border.radius` to specify a different value for global styles and `--ion-chip-shape-round-border-radius` for component-specific styles. +- The `border-radius` of the `ios` chip now defaults to `10px` instead of `16px` in accordance with the iOS guidelines. The `md` chip keeps its pill shape, in accordance with the Material Design 2 guidelines. To revert the `ios` chip to the previous appearance, set the `shape` to `"round"`, or override the `IonChip.shape.round.border.radius` to specify a different value for global styles and `--ion-chip-shape-round-border-radius` for component-specific styles. +- In the `md` theme, the chip now has a letter spacing of `0.0179em` (`0.25px` at `14px`), and the `large` chip a line height of `20px`, instead of inherited, in accordance with the Material Design 2 guidelines. To revert to the previous appearance, set `IonChip.size.large.letterSpacing` and `IonChip.size.large.line.height` to `inherit` for global styles, or `--ion-chip-size-large-letter-spacing` and `--ion-chip-size-large-line-height` for component-specific styles. +- In the `md` theme, a slotted `ion-icon` now has `4px` of space between it and the label instead of `8px`, in accordance with the Material Design 2 guidelines. 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 `md` theme, the border of an outline chip without a `color` is now `12%` of the text color instead of `32%`, in accordance with the Material Design 2 guidelines. To revert to the previous appearance, set `IonChip.hue.bold.outline.default.border.color` to `rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.32)` for global styles, or `--ion-chip-hue-bold-outline-default-border-color` for component-specific styles. +- In the `md` theme, a focused chip without a `color` now has a background of `21%` of the text color instead of `16%`, or `10%` instead of `4%` with an outline fill, in accordance with the Material Design 2 guidelines. To revert to the previous appearance, set `IonChip.hue.bold.solid.focus.background` to `rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)` and `IonChip.hue.bold.outline.focus.background` to `rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.04)` for global styles, or `--ion-chip-hue-bold-solid-focus-background` and `--ion-chip-hue-bold-outline-focus-background` for component-specific styles. +- In the `md` theme, a pressed chip, with or without a `color`, now keeps its resting background under the ripple instead of darkening, or its hover background while hovered, in accordance with the Material Design 2 guidelines. To revert to the previous appearance, set these tokens for global styles, or the matching `--ion-chip-hue-*-activated-background` variables for component-specific styles: + - `IonChip.hue.bold.solid.activated.background` to `rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)` + - `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.

Col

diff --git a/core/api.txt b/core/api.txt index f7da14c8764..65c15e43e54 100644 --- a/core/api.txt +++ b/core/api.txt @@ -1016,14 +1016,6 @@ ion-chip,prop,outline,boolean,false,false,false ion-chip,prop,shape,"rectangular" | "round" | "soft" | undefined,undefined,false,false ion-chip,prop,size,"large" | "small" | undefined,undefined,false,false ion-chip,css-prop,--ion-chip-avatar-height -ion-chip,css-prop,--ion-chip-avatar-leading-margin-bottom -ion-chip,css-prop,--ion-chip-avatar-leading-margin-end -ion-chip,css-prop,--ion-chip-avatar-leading-margin-start -ion-chip,css-prop,--ion-chip-avatar-leading-margin-top -ion-chip,css-prop,--ion-chip-avatar-trailing-margin-bottom -ion-chip,css-prop,--ion-chip-avatar-trailing-margin-end -ion-chip,css-prop,--ion-chip-avatar-trailing-margin-start -ion-chip,css-prop,--ion-chip-avatar-trailing-margin-top ion-chip,css-prop,--ion-chip-avatar-width ion-chip,css-prop,--ion-chip-font-weight ion-chip,css-prop,--ion-chip-gap @@ -1089,23 +1081,45 @@ ion-chip,css-prop,--ion-chip-icon-trailing-margin-bottom ion-chip,css-prop,--ion-chip-icon-trailing-margin-end ion-chip,css-prop,--ion-chip-icon-trailing-margin-start ion-chip,css-prop,--ion-chip-icon-trailing-margin-top -ion-chip,css-prop,--ion-chip-letter-spacing -ion-chip,css-prop,--ion-chip-line-height ion-chip,css-prop,--ion-chip-margin-bottom ion-chip,css-prop,--ion-chip-margin-end ion-chip,css-prop,--ion-chip-margin-start ion-chip,css-prop,--ion-chip-margin-top -ion-chip,css-prop,--ion-chip-padding-bottom -ion-chip,css-prop,--ion-chip-padding-end -ion-chip,css-prop,--ion-chip-padding-start -ion-chip,css-prop,--ion-chip-padding-top ion-chip,css-prop,--ion-chip-shape-rectangular-border-radius ion-chip,css-prop,--ion-chip-shape-round-border-radius ion-chip,css-prop,--ion-chip-shape-soft-border-radius +ion-chip,css-prop,--ion-chip-size-large-avatar-leading-margin-bottom +ion-chip,css-prop,--ion-chip-size-large-avatar-leading-margin-end +ion-chip,css-prop,--ion-chip-size-large-avatar-leading-margin-start +ion-chip,css-prop,--ion-chip-size-large-avatar-leading-margin-top +ion-chip,css-prop,--ion-chip-size-large-avatar-trailing-margin-bottom +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-letter-spacing +ion-chip,css-prop,--ion-chip-size-large-line-height ion-chip,css-prop,--ion-chip-size-large-min-height +ion-chip,css-prop,--ion-chip-size-large-padding-bottom +ion-chip,css-prop,--ion-chip-size-large-padding-end +ion-chip,css-prop,--ion-chip-size-large-padding-start +ion-chip,css-prop,--ion-chip-size-large-padding-top +ion-chip,css-prop,--ion-chip-size-small-avatar-leading-margin-bottom +ion-chip,css-prop,--ion-chip-size-small-avatar-leading-margin-end +ion-chip,css-prop,--ion-chip-size-small-avatar-leading-margin-start +ion-chip,css-prop,--ion-chip-size-small-avatar-leading-margin-top +ion-chip,css-prop,--ion-chip-size-small-avatar-trailing-margin-bottom +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-letter-spacing +ion-chip,css-prop,--ion-chip-size-small-line-height ion-chip,css-prop,--ion-chip-size-small-min-height +ion-chip,css-prop,--ion-chip-size-small-padding-bottom +ion-chip,css-prop,--ion-chip-size-small-padding-end +ion-chip,css-prop,--ion-chip-size-small-padding-start +ion-chip,css-prop,--ion-chip-size-small-padding-top ion-chip,css-prop,--ion-chip-state-disabled-opacity ion-chip,css-prop,--ion-chip-state-focus-ring-color ion-chip,css-prop,--ion-chip-state-focus-ring-style diff --git a/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Chrome-linux.png b/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Chrome-linux.png index 06feb4243a8..2147bae8d4b 100644 Binary files a/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Firefox-linux.png b/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Firefox-linux.png index 32c580e473d..09d370a103c 100644 Binary files a/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Safari-linux.png b/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Safari-linux.png index 42080de845f..1679a9526b5 100644 Binary files a/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Safari-linux.png and b/core/src/components/avatar/test/basic/avatar.e2e.ts-snapshots/avatar-chip-diff-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/chip.interface.ts b/core/src/components/chip/chip.interface.ts index da809d6e389..a707987556f 100644 --- a/core/src/components/chip/chip.interface.ts +++ b/core/src/components/chip/chip.interface.ts @@ -1,12 +1,7 @@ import type { IonPadding, IonMargin, Hue } from '../../themes/themes.interfaces'; export type IonChipRecipe = { - letterSpacing?: string | number; - line?: { - height?: string | number; - }; margin?: IonMargin; - padding?: IonPadding; gap?: string | number; font?: { @@ -73,6 +68,9 @@ type IonChipColorDefinition = { }; type IonChipSizeDefinition = { + padding?: IonPadding; + letterSpacing?: string | number; + min?: { height?: string | number; }; @@ -80,6 +78,12 @@ type IonChipSizeDefinition = { font?: { size?: string | number; }; + + line?: { + height?: string | number; + }; + + avatar?: IonChipMediaDefinition; }; type IonChipShapeDefinition = { @@ -108,7 +112,7 @@ type IonChipIconDefinition = IonChipMediaDefinition & { }; }; -type IonChipAvatarDefinition = IonChipMediaDefinition & { +type IonChipAvatarDefinition = { height?: string | number; width?: string | number; }; diff --git a/core/src/components/chip/chip.scss b/core/src/components/chip/chip.scss index 7b2814cf651..fd96be6d2da 100644 --- a/core/src/components/chip/chip.scss +++ b/core/src/components/chip/chip.scss @@ -10,21 +10,42 @@ * @prop --ion-chip-margin-bottom: Bottom margin of the chip * @prop --ion-chip-margin-start: Left margin if direction is left-to-right, and right margin if direction is right-to-left of the chip * - * @prop --ion-chip-padding-top: Top padding of the chip - * @prop --ion-chip-padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the chip - * @prop --ion-chip-padding-bottom: Bottom padding of the chip - * @prop --ion-chip-padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the chip - * * @prop --ion-chip-font-weight: Font weight of the chip - * @prop --ion-chip-letter-spacing: Letter spacing of the chip - * @prop --ion-chip-line-height: Line height of the chip * @prop --ion-chip-gap: Gap between slotted elements in the chip * * Sizes + * @prop --ion-chip-size-small-padding-top: Top padding of the `small` chip size + * @prop --ion-chip-size-small-padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the `small` chip size + * @prop --ion-chip-size-small-padding-bottom: Bottom padding of the `small` chip size + * @prop --ion-chip-size-small-padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the `small` chip size + * @prop --ion-chip-size-small-letter-spacing: Letter spacing of the `small` chip size * @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-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 + * @prop --ion-chip-size-small-avatar-leading-margin-start: Left margin if direction is left-to-right, and right 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-trailing-margin-top: Top margin of the slotted `ion-avatar` when it is the last child of the `small` chip size + * @prop --ion-chip-size-small-avatar-trailing-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 last child of the `small` chip size + * @prop --ion-chip-size-small-avatar-trailing-margin-bottom: Bottom margin of the slotted `ion-avatar` when it is the last child of the `small` chip size + * @prop --ion-chip-size-small-avatar-trailing-margin-start: Left margin if direction is left-to-right, and right margin if direction is right-to-left of the slotted `ion-avatar` when it is the last child of the `small` chip size + * @prop --ion-chip-size-large-padding-top: Top padding of the `large` chip size + * @prop --ion-chip-size-large-padding-end: Right padding if direction is left-to-right, and left padding if direction is right-to-left of the `large` chip size + * @prop --ion-chip-size-large-padding-bottom: Bottom padding of the `large` chip size + * @prop --ion-chip-size-large-padding-start: Left padding if direction is left-to-right, and right padding if direction is right-to-left of the `large` chip size + * @prop --ion-chip-size-large-letter-spacing: Letter spacing of the `large` chip size * @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-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 + * @prop --ion-chip-size-large-avatar-leading-margin-start: Left margin if direction is left-to-right, and right 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-trailing-margin-top: Top margin of the slotted `ion-avatar` when it is the last child of the `large` chip size + * @prop --ion-chip-size-large-avatar-trailing-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 last child of the `large` chip size + * @prop --ion-chip-size-large-avatar-trailing-margin-bottom: Bottom margin of the slotted `ion-avatar` when it is the last child of the `large` chip size + * @prop --ion-chip-size-large-avatar-trailing-margin-start: Left margin if direction is left-to-right, and right margin if direction is right-to-left of the slotted `ion-avatar` when it is the last child of the `large` chip size * * Shapes * @prop --ion-chip-shape-soft-border-radius: Border radius of the `soft` chip shape @@ -112,14 +133,6 @@ * Slotted Avatar * @prop --ion-chip-avatar-width: Width of the slotted `ion-avatar` * @prop --ion-chip-avatar-height: Height of the slotted `ion-avatar` - * @prop --ion-chip-avatar-leading-margin-top: Top margin of the slotted `ion-avatar` when it is the first child - * @prop --ion-chip-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 - * @prop --ion-chip-avatar-leading-margin-bottom: Bottom margin of the slotted `ion-avatar` when it is the first child - * @prop --ion-chip-avatar-leading-margin-start: Left margin if direction is left-to-right, and right margin if direction is right-to-left of the slotted `ion-avatar` when it is the first child - * @prop --ion-chip-avatar-trailing-margin-top: Top margin of the slotted `ion-avatar` when it is the last child - * @prop --ion-chip-avatar-trailing-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 last child - * @prop --ion-chip-avatar-trailing-margin-bottom: Bottom margin of the slotted `ion-avatar` when it is the last child - * @prop --ion-chip-avatar-trailing-margin-start: Left margin if direction is left-to-right, and right margin if direction is right-to-left of the slotted `ion-avatar` when it is the last child */ @include mixins.font-smoothing(); @@ -129,12 +142,6 @@ var(--ion-chip-margin-bottom), var(--ion-chip-margin-start) ); - @include mixins.padding( - var(--ion-chip-padding-top), - var(--ion-chip-padding-end), - var(--ion-chip-padding-bottom), - var(--ion-chip-padding-start) - ); display: inline-flex; position: relative; @@ -144,10 +151,6 @@ font-weight: var(--ion-chip-font-weight); - letter-spacing: var(--ion-chip-letter-spacing); - - line-height: var(--ion-chip-line-height); - cursor: pointer; gap: var(--ion-chip-gap); @@ -160,15 +163,62 @@ // --------------------------------------------- :host(.chip-size-small) { + @include mixins.padding( + var(--ion-chip-size-small-padding-top), + var(--ion-chip-size-small-padding-end), + var(--ion-chip-size-small-padding-bottom), + var(--ion-chip-size-small-padding-start) + ); + min-height: var(--ion-chip-size-small-min-height); font-size: var(--ion-chip-size-small-font-size); + + letter-spacing: var(--ion-chip-size-small-letter-spacing); + + line-height: var(--ion-chip-size-small-line-height); } :host(.chip-size-large) { + @include mixins.padding( + var(--ion-chip-size-large-padding-top), + var(--ion-chip-size-large-padding-end), + var(--ion-chip-size-large-padding-bottom), + var(--ion-chip-size-large-padding-start) + ); + min-height: var(--ion-chip-size-large-min-height); font-size: var(--ion-chip-size-large-font-size); + + letter-spacing: var(--ion-chip-size-large-letter-spacing); + + line-height: var(--ion-chip-size-large-line-height); +} + +// Outline Sizes +// --------------------------------------------- + +/** + * The border is part of the chip's size, so an outline chip + * is as tall as a solid one. + */ +@each $size in (small, large) { + @each $hue in (bold, subtle) { + :host(.chip-size-#{$size}.chip-hue-#{$hue}.chip-fill-outline) { + $border-width: var(--ion-chip-hue-#{$hue}-outline-default-border-width, 0px); + + padding-top: calc(var(--ion-chip-size-#{$size}-padding-top) - #{$border-width}); + padding-bottom: calc(var(--ion-chip-size-#{$size}-padding-bottom) - #{$border-width}); + } + + :host(.chip-size-#{$size}.chip-hue-#{$hue}.chip-fill-outline.ion-color) { + $border-width: var(--ion-chip-hue-#{$hue}-outline-semantic-default-border-width, 0px); + + padding-top: calc(var(--ion-chip-size-#{$size}-padding-top) - #{$border-width}); + padding-bottom: calc(var(--ion-chip-size-#{$size}-padding-bottom) - #{$border-width}); + } + } } // Chip Shapes @@ -449,6 +499,35 @@ ); } +// Chip: Activated While Hovered +// --------------------------------------------- + +/** + * A theme without an activated background keeps the hover background, + * so a hovered chip doesn't get lighter when it's pressed. + */ +@media (any-hover: hover) { + @each $hue in (bold, subtle) { + @each $fill in (solid, outline) { + $prefix: --ion-chip-hue-#{$hue}-#{$fill}; + + :host(.chip-hue-#{$hue}.chip-fill-#{$fill}.ion-activated:hover) { + background: var( + #{$prefix}-activated-background, + var(#{$prefix}-hover-background, var(#{$prefix}-default-background)) + ); + } + + :host(.chip-hue-#{$hue}.chip-fill-#{$fill}.ion-color.ion-activated:hover) { + background: var( + #{$prefix}-semantic-activated-background, + var(#{$prefix}-semantic-hover-background, var(#{$prefix}-semantic-default-background)) + ); + } + } + } +} + // Chip States // --------------------------------------------- @@ -506,20 +585,22 @@ height: var(--ion-chip-avatar-height, revert-layer); } -::slotted(ion-avatar:first-child) { - @include mixins.margin( - var(--ion-chip-avatar-leading-margin-top), - var(--ion-chip-avatar-leading-margin-end), - var(--ion-chip-avatar-leading-margin-bottom), - var(--ion-chip-avatar-leading-margin-start) - ); -} +@each $size in (small, large) { + :host(.chip-size-#{$size}) ::slotted(ion-avatar:first-child) { + @include mixins.margin( + var(--ion-chip-size-#{$size}-avatar-leading-margin-top), + var(--ion-chip-size-#{$size}-avatar-leading-margin-end), + var(--ion-chip-size-#{$size}-avatar-leading-margin-bottom), + var(--ion-chip-size-#{$size}-avatar-leading-margin-start) + ); + } -::slotted(ion-avatar:last-child) { - @include mixins.margin( - var(--ion-chip-avatar-trailing-margin-top), - var(--ion-chip-avatar-trailing-margin-end), - var(--ion-chip-avatar-trailing-margin-bottom), - var(--ion-chip-avatar-trailing-margin-start) - ); + :host(.chip-size-#{$size}) ::slotted(ion-avatar:last-child) { + @include mixins.margin( + var(--ion-chip-size-#{$size}-avatar-trailing-margin-top), + var(--ion-chip-size-#{$size}-avatar-trailing-margin-end), + var(--ion-chip-size-#{$size}-avatar-trailing-margin-bottom), + var(--ion-chip-size-#{$size}-avatar-trailing-margin-start) + ); + } } diff --git a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Chrome-linux.png index 37c6ee6fa96..aedf3f65743 100644 Binary files a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Firefox-linux.png index 22ca4ca18c3..c0c041aaea5 100644 Binary files a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Safari-linux.png index 44746013ebb..9bb98c151c4 100644 Binary files a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Safari-linux.png and b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-large-contents-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Chrome-linux.png index 93c1ed43350..9134e9baf30 100644 Binary files a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Firefox-linux.png index a18cfb390c1..50401a97601 100644 Binary files a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Safari-linux.png index 087224eb969..646d4a4d550 100644 Binary files a/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Safari-linux.png and b/core/src/components/chip/test/a11y/chip.e2e.ts-snapshots/chip-scale-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/basic/chip.e2e.ts b/core/src/components/chip/test/basic/chip.e2e.ts index 8f276b2e9db..c18d01fe331 100644 --- a/core/src/components/chip/test/basic/chip.e2e.ts +++ b/core/src/components/chip/test/basic/chip.e2e.ts @@ -57,7 +57,7 @@ configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, screenshot, c }); /** - * `md` mode does not differ from `ios` mode in chip rendering. + * The hue tests cover the `md` outline and color chips. */ configs({ modes: ['ios', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { test.describe(title('chip: outline'), () => { diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Chrome-linux.png index 9ed03ba787b..e8e3fac8ce9 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Firefox-linux.png index b3460c5dc75..df36c7810c6 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Safari-linux.png index ad00525a758..ff2b046c983 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Safari-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-bold-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Chrome-linux.png index dd8068fa230..dd72248b8ed 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Firefox-linux.png index 1404f66e953..be86408e9cd 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Safari-linux.png index 197981812db..61d795da625 100644 Binary files a/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Safari-linux.png and b/core/src/components/chip/test/hue/chip.e2e.ts-snapshots/chip-hue-subtle-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Chrome-linux.png index e56fb3a04f0..c1a9b3f8c87 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Firefox-linux.png index c5653589660..8d88e89155e 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Safari-linux.png index 693bbd63bf7..d493124c384 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Safari-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-rectangular-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Chrome-linux.png index 6b6c26daed8..8325baaea5f 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Firefox-linux.png index 69589024e9f..c9432a44f04 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Safari-linux.png index e00f2b33829..fda173c9677 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Safari-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-round-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Chrome-linux.png index 917c33b7238..5fc6ba255c3 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Firefox-linux.png index 363e1544709..2fa7e8e39bb 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Safari-linux.png index e9035e497df..a4fe71c2064 100644 Binary files a/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Safari-linux.png and b/core/src/components/chip/test/shape/chip.e2e.ts-snapshots/chip-soft-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Chrome-linux.png index d699d9c8a95..05c9cb5c016 100644 Binary files a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Firefox-linux.png index 7deee2866f1..2ef50cb2b34 100644 Binary files a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Safari-linux.png index bd1859cc145..77a0d13c701 100644 Binary files a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Safari-linux.png and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-large-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Chrome-linux.png index 3f7e044a577..3630d43fed6 100644 Binary files a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Chrome-linux.png and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Firefox-linux.png index 0a357ce31be..54aa28f8378 100644 Binary files a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Firefox-linux.png and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Safari-linux.png index 009929c2c6b..46b30f5936e 100644 Binary files a/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Safari-linux.png and b/core/src/components/chip/test/size/chip.e2e.ts-snapshots/chip-size-small-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts b/core/src/components/chip/test/states/chip.e2e.ts index 5476a4c4799..43f6b887bf9 100644 --- a/core/src/components/chip/test/states/chip.e2e.ts +++ b/core/src/components/chip/test/states/chip.e2e.ts @@ -6,10 +6,8 @@ import { ION_CHIP_FILLS } from '../../chip.interface'; /** * This behavior does not vary across directions. - * - * `md` does not differ from `ios`. */ -configs({ modes: ['ios', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { +configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { test.describe(title('chip: states'), () => { test('should render disabled state', async ({ page }) => { await page.setContent( @@ -143,6 +141,38 @@ configs({ modes: ['ionic-md'], directions: ['ltr'] }).forEach(({ title, config } await expect(chip).toHaveCSS('background-color', 'rgb(0, 0, 255)'); }); + + test(`should keep the hover background when pressing a hovered ${hue} ${fill} chip${ + color ? ` with a color` : '' + } without an activated background`, async ({ page, skip }) => { + skip.browser('firefox', 'Headless Firefox reports no hover capability'); + + const prefix = `--ion-chip-hue-${hue}-${fill}${color ? '-semantic' : ''}`; + + await page.setContent( + ` + + + + Chip + + `, + config + ); + + const chip = page.locator('ion-chip'); + + await chip.hover(); + await chip.evaluate((el) => el.classList.add('ion-activated')); + await page.waitForChanges(); + + await expect(chip).toHaveCSS('background-color', 'rgb(255, 0, 0)'); + }); }); }); }); diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..2e582ace151 Binary files /dev/null and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..e45ac050c2b Binary files /dev/null and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 00000000000..864802e0534 Binary files /dev/null and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-disabled-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-md-ltr-Mobile-Chrome-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-md-ltr-Mobile-Chrome-linux.png new file mode 100644 index 00000000000..57bf7a14d96 Binary files /dev/null and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-md-ltr-Mobile-Chrome-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-md-ltr-Mobile-Firefox-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-md-ltr-Mobile-Firefox-linux.png new file mode 100644 index 00000000000..27d600ef2db Binary files /dev/null and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-md-ltr-Mobile-Firefox-linux.png differ diff --git a/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-md-ltr-Mobile-Safari-linux.png b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-md-ltr-Mobile-Safari-linux.png new file mode 100644 index 00000000000..eaeda200568 Binary files /dev/null and b/core/src/components/chip/test/states/chip.e2e.ts-snapshots/chip-focused-md-ltr-Mobile-Safari-linux.png differ diff --git a/core/src/components/chip/test/states/index.html b/core/src/components/chip/test/states/index.html index 9c0c0925367..57c5d99318c 100644 --- a/core/src/components/chip/test/states/index.html +++ b/core/src/components/chip/test/states/index.html @@ -290,8 +290,8 @@

Custom

--ion-chip-hue-bold-solid-hover-background: #fcc6ce; --ion-chip-hue-bold-solid-focus-background: lightpink; --ion-chip-hue-bold-solid-default-color: rgb(214, 60, 235); - --ion-chip-padding-start: 10px; - --ion-chip-padding-end: 10px; + --ion-chip-size-large-padding-start: 10px; + --ion-chip-size-large-padding-end: 10px; } .custom:hover { diff --git a/core/src/themes/ionic/default.tokens.ts b/core/src/themes/ionic/default.tokens.ts index f1a0a7d4cb5..bc13305e9d4 100644 --- a/core/src/themes/ionic/default.tokens.ts +++ b/core/src/themes/ionic/default.tokens.ts @@ -1309,17 +1309,6 @@ export const defaultTheme: DefaultTheme = { start: 'var(--ion-spacing-0)', }, - padding: { - top: 'var(--ion-spacing-xs)', - end: 'var(--ion-spacing-sm)', - bottom: 'var(--ion-spacing-xs)', - start: 'var(--ion-spacing-sm)', - }, - - line: { - height: '100%', - }, - letterSpacing: '0%', gap: 'var(--ion-spacing-xxs)', font: { @@ -1329,20 +1318,44 @@ export const defaultTheme: DefaultTheme = { // Sizes size: { small: { + padding: { + top: 'var(--ion-spacing-xs)', + end: 'var(--ion-spacing-sm)', + bottom: 'var(--ion-spacing-xs)', + start: 'var(--ion-spacing-sm)', + }, + + letterSpacing: '0%', + min: { height: 'var(--ion-scaling-xs)', }, font: { size: 'var(--ion-font-size-xs)', }, + line: { + height: '100%', + }, }, large: { + padding: { + top: 'var(--ion-spacing-xs)', + end: 'var(--ion-spacing-sm)', + bottom: 'var(--ion-spacing-xs)', + start: 'var(--ion-spacing-sm)', + }, + + letterSpacing: '0%', + min: { height: 'var(--ion-scaling-md)', }, font: { size: 'var(--ion-font-size-sm)', }, + line: { + height: '100%', + }, }, }, diff --git a/core/src/themes/ios/default.tokens.ts b/core/src/themes/ios/default.tokens.ts index 05cf3c9104f..8250f51be01 100644 --- a/core/src/themes/ios/default.tokens.ts +++ b/core/src/themes/ios/default.tokens.ts @@ -1592,16 +1592,16 @@ export const defaultTheme: DefaultTheme = { start: 'var(--ion-spacing-xxs)', }, - padding: { - top: 'var(--ion-spacing-xs)', - end: 'var(--ion-spacing-md)', - bottom: 'var(--ion-spacing-xs)', - start: 'var(--ion-spacing-md)', - }, - // Sizes size: { small: { + padding: { + top: 'var(--ion-spacing-xs)', + end: 'var(--ion-spacing-md)', + bottom: 'var(--ion-spacing-xs)', + start: 'var(--ion-spacing-md)', + }, + min: { height: 'var(--ion-scaling-xs)', }, @@ -1613,9 +1613,36 @@ export const defaultTheme: DefaultTheme = { 'var(--ion-font-size-xl)' ), }, + + avatar: { + leading: { + margin: { + top: '-4px', + end: 'var(--ion-spacing-sm)', + bottom: '-4px', + start: '-8px', + }, + }, + + trailing: { + margin: { + top: '-4px', + end: '-8px', + bottom: '-4px', + start: 'var(--ion-spacing-sm)', + }, + }, + }, }, large: { + padding: { + top: 'var(--ion-spacing-xs)', + end: 'var(--ion-spacing-md)', + bottom: 'var(--ion-spacing-xs)', + start: 'var(--ion-spacing-md)', + }, + min: { height: 'var(--ion-scaling-md)', }, @@ -1623,6 +1650,26 @@ export const defaultTheme: DefaultTheme = { font: { size: clamp('13px', `${(components.chip.font.size / global.root).toFixed(2)}rem`, '22px'), }, + + avatar: { + leading: { + margin: { + top: '-4px', + end: 'var(--ion-spacing-sm)', + bottom: '-4px', + start: '-8px', + }, + }, + + trailing: { + margin: { + top: '-4px', + end: '-8px', + bottom: '-4px', + start: 'var(--ion-spacing-sm)', + }, + }, + }, }, }, @@ -1874,24 +1921,6 @@ export const defaultTheme: DefaultTheme = { avatar: { height: `${(24 / components.chip.font.size).toFixed(2)}em`, width: `${(24 / components.chip.font.size).toFixed(2)}em`, - - leading: { - margin: { - top: '-4px', - end: 'var(--ion-spacing-sm)', - bottom: '-4px', - start: '-8px', - }, - }, - - trailing: { - margin: { - top: '-4px', - end: '-8px', - bottom: '-4px', - start: 'var(--ion-spacing-sm)', - }, - }, }, }, diff --git a/core/src/themes/md/default.tokens.ts b/core/src/themes/md/default.tokens.ts index 2d4329c2f0d..fee0e35d56e 100644 --- a/core/src/themes/md/default.tokens.ts +++ b/core/src/themes/md/default.tokens.ts @@ -42,7 +42,7 @@ export const defaultTheme: DefaultTheme = { IonChip: { fill: 'solid', hue: 'bold', - shape: 'soft', + shape: 'round', size: 'large', }, @@ -1751,31 +1751,93 @@ export const defaultTheme: DefaultTheme = { start: 'var(--ion-spacing-xxs)', }, - padding: { - top: 'var(--ion-spacing-xs)', - end: 'var(--ion-spacing-md)', - bottom: 'var(--ion-spacing-xs)', - start: 'var(--ion-spacing-md)', - }, - // Sizes size: { + // MD2 has no small chip, so this scales the `large` chip down + // to 24px on the 4dp grid small: { + padding: { + top: 'var(--ion-spacing-xxs)', + end: 'var(--ion-spacing-sm)', + bottom: 'var(--ion-spacing-xxs)', + start: 'var(--ion-spacing-sm)', + }, + + letterSpacing: '0.0179em', + min: { height: 'var(--ion-scaling-xs)', }, font: { - size: `${((components.chip.font.size - 2) / global.root).toFixed(2)}rem`, + size: `${(components.chip.font.size - 2) / global.root}rem`, + }, + + line: { + height: `${16 / (components.chip.font.size - 2)}`, + }, + + avatar: { + leading: { + margin: { + top: '-4px', + end: 'var(--ion-spacing-sm)', + bottom: '-4px', + start: '-6px', + }, + }, + + trailing: { + margin: { + top: '-4px', + end: '-6px', + bottom: '-4px', + start: 'var(--ion-spacing-sm)', + }, + }, }, }, + large: { + padding: { + top: 'var(--ion-spacing-xs)', + end: 'var(--ion-spacing-md)', + bottom: 'var(--ion-spacing-xs)', + start: 'var(--ion-spacing-md)', + }, + + letterSpacing: '0.0179em', + min: { height: 'var(--ion-scaling-md)', }, font: { - size: `${(components.chip.font.size / global.root).toFixed(2)}rem`, + size: `${components.chip.font.size / global.root}rem`, + }, + + line: { + height: `${20 / components.chip.font.size}`, + }, + + avatar: { + leading: { + margin: { + top: '-4px', + end: 'var(--ion-spacing-sm)', + bottom: '-4px', + start: '-8px', + }, + }, + + trailing: { + margin: { + top: '-4px', + end: '-8px', + bottom: '-4px', + start: 'var(--ion-spacing-sm)', + }, + }, }, }, }, @@ -1783,7 +1845,7 @@ export const defaultTheme: DefaultTheme = { // States state: { disabled: { - opacity: '0.4', + opacity: '0.38', }, }, @@ -1823,11 +1885,7 @@ export const defaultTheme: DefaultTheme = { }, focus: { - background: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.16), - }, - - activated: { - background: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.2), + background: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.21), }, // Any of the semantic colors like primary, secondary, etc. @@ -1844,10 +1902,6 @@ export const defaultTheme: DefaultTheme = { focus: { background: currentColor('base', { alpha: 0.12 }), }, - - activated: { - background: currentColor('base', { alpha: 0.16 }), - }, }, }, @@ -1858,7 +1912,7 @@ export const defaultTheme: DefaultTheme = { color: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.87), border: { - color: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.32), + color: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.12), style: 'solid', width: 'var(--ion-border-width-xxxs)', }, @@ -1869,11 +1923,7 @@ export const defaultTheme: DefaultTheme = { }, focus: { - background: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.04), - }, - - activated: { - background: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.08), + background: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.1), }, semantic: { @@ -1895,10 +1945,6 @@ export const defaultTheme: DefaultTheme = { focus: { background: currentColor('base', { alpha: 0.12 }), }, - - activated: { - background: currentColor('base', { alpha: 0.16 }), - }, }, }, }, @@ -1919,10 +1965,6 @@ export const defaultTheme: DefaultTheme = { background: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.1), }, - activated: { - background: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.14), - }, - // Any of the semantic colors like primary, secondary, etc. semantic: { default: { @@ -1937,10 +1979,6 @@ export const defaultTheme: DefaultTheme = { focus: { background: currentColor('base', { alpha: 0.6, subtle: true }), }, - - activated: { - background: currentColor('base', { alpha: 0.8, subtle: true }), - }, }, }, @@ -1951,7 +1989,7 @@ export const defaultTheme: DefaultTheme = { color: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.8), border: { - color: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.16), + color: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.12), style: 'solid', width: 'var(--ion-border-width-xxxs)', }, @@ -1965,10 +2003,6 @@ export const defaultTheme: DefaultTheme = { background: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.04), }, - activated: { - background: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.04), - }, - // Any of the semantic colors like primary, secondary, etc. semantic: { default: { @@ -1989,10 +2023,6 @@ export const defaultTheme: DefaultTheme = { focus: { background: currentColor('base', { alpha: 0.6, subtle: true }), }, - - activated: { - background: currentColor('base', { alpha: 0.8, subtle: true }), - }, }, }, }, @@ -2002,13 +2032,13 @@ export const defaultTheme: DefaultTheme = { color: rgba('var(--ion-text-color-rgb, 0, 0, 0)', 0.54), font: { - size: `${(20 / components.chip.font.size).toFixed(2)}em`, + size: `${20 / components.chip.font.size}em`, }, leading: { margin: { top: '-4px', - end: 'var(--ion-spacing-sm)', + end: 'var(--ion-spacing-xxs)', bottom: '-4px', start: '-4px', }, @@ -2019,32 +2049,14 @@ export const defaultTheme: DefaultTheme = { top: '-4px', end: '-4px', bottom: '-4px', - start: 'var(--ion-spacing-sm)', + start: 'var(--ion-spacing-xxs)', }, }, }, avatar: { - height: `${(24 / components.chip.font.size).toFixed(2)}em`, - width: `${(24 / components.chip.font.size).toFixed(2)}em`, - - leading: { - margin: { - top: '-4px', - end: 'var(--ion-spacing-sm)', - bottom: '-4px', - start: '-8px', - }, - }, - - trailing: { - margin: { - top: '-4px', - end: '-8px', - bottom: '-4px', - start: 'var(--ion-spacing-sm)', - }, - }, + height: `${24 / components.chip.font.size}em`, + width: `${24 / components.chip.font.size}em`, }, },