Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion BREAKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ 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` 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.
Expand All @@ -361,6 +360,10 @@ 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, 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.

<h4 id="version-10x-col">Col</h4>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 36 additions & 24 deletions core/src/themes/ios/default.tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const defaultTheme: DefaultTheme = {
IonChip: {
fill: 'solid',
hue: 'bold',
shape: 'soft',
shape: 'round',
size: 'large',
},

Expand Down Expand Up @@ -1596,38 +1596,44 @@ export const defaultTheme: DefaultTheme = {
size: {
small: {
padding: {
top: 'var(--ion-spacing-xs)',
end: 'var(--ion-spacing-md)',
bottom: 'var(--ion-spacing-xs)',
start: 'var(--ion-spacing-md)',
top: 'var(--ion-spacing-75)',
end: 'var(--ion-spacing-sm)',
bottom: 'var(--ion-spacing-75)',
start: 'var(--ion-spacing-sm)',
},

letterSpacing: '-0.006em',

min: {
height: 'var(--ion-scaling-xs)',
},

font: {
size: clamp(
'var(--ion-font-size-xs)',
`${((components.chip.font.size - 2) / global.root).toFixed(2)}rem`,
`${(components.chip.font.size - 2) / global.root}rem`,
'var(--ion-font-size-xl)'
),
},

line: {
height: `${18 / (components.chip.font.size - 2)}`,
},

avatar: {
leading: {
margin: {
top: '-4px',
end: 'var(--ion-spacing-sm)',
bottom: '-4px',
start: '-8px',
start: '-6px',
},
},

trailing: {
margin: {
top: '-4px',
end: '-8px',
end: '-6px',
bottom: '-4px',
start: 'var(--ion-spacing-sm)',
},
Expand All @@ -1637,18 +1643,24 @@ export const defaultTheme: DefaultTheme = {

large: {
padding: {
top: 'var(--ion-spacing-xs)',
end: 'var(--ion-spacing-md)',
bottom: 'var(--ion-spacing-xs)',
start: 'var(--ion-spacing-md)',
top: 'var(--ion-spacing-xxs)',
end: 'var(--ion-spacing-250)',
bottom: 'var(--ion-spacing-xxs)',
Comment on lines +1646 to +1648

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
top: 'var(--ion-spacing-xxs)',
end: 'var(--ion-spacing-250)',
bottom: 'var(--ion-spacing-xxs)',
top: 'var(--ion-spacing-75)',
end: 'var(--ion-spacing-250)',
bottom: 'var(--ion-spacing-75)',

Outline chips come out 2px taller than solid ones now, 30px vs 28px on large and 26px vs 24px on small, so a row mixing the two won't line up. The padding plus the line height already fills the min-height, so the outline's border can only add to it. With 3px here and 2px (--ion-spacing-xxxs) on small, every fill comes out 28px and 24px, and the solid, size, shape and avatar screenshots don't change.

The one catch is that solid chips at large font sizes get 2px shorter too (chip-scale goes from 38px to 36px). If you'd rather avoid that, I think taking the border width off the outline chip's padding in chip.scss would work instead. Either way, the padding in the breaking changes entry would need updating.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to Shane's outline height comment. The md PR has the same bug, so it'd be good to fix both the same way. If the outline border comes off the padding in chip.scss, it covers md and ios at once and the ios padding can stay as it is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the md PR with adfb6c9, which takes the outline's border width off its vertical padding in chip.scss. It's merged up here, and ios outline chips are now 28px and 24px like the solid ones (6656f18 updates the snapshots).

That keeps the ios padding as it is, so solid chips at large font sizes don't get shorter, and the BREAKING entry stays the same.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done that way in adfb6c9 on the md PR, so it covers md and ios at once. The ios snapshots are updated in 6656f18.

start: 'var(--ion-spacing-250)',
},

letterSpacing: '-0.016em',

min: {
height: 'var(--ion-scaling-md)',
height: 'var(--ion-scaling-sm)',
},

font: {
size: clamp('13px', `${(components.chip.font.size / global.root).toFixed(2)}rem`, '22px'),
size: clamp('13px', `${components.chip.font.size / global.root}rem`, '22px'),
},

line: {
height: `${20 / components.chip.font.size}`,
},

avatar: {
Expand Down Expand Up @@ -1676,7 +1688,7 @@ export const defaultTheme: DefaultTheme = {
// States
state: {
disabled: {
opacity: '0.4',
opacity: '0.5',
},
},

Expand Down Expand Up @@ -1726,20 +1738,20 @@ export const defaultTheme: DefaultTheme = {
// Any of the semantic colors like primary, secondary, etc.
semantic: {
default: {
background: currentColor('base', { alpha: 0.08 }),
background: currentColor('base', { alpha: 0.15 }),
color: currentColor('shade'),
},

hover: {
background: currentColor('base', { alpha: 0.12 }),
background: currentColor('base', { alpha: 0.19 }),
},

focus: {
background: currentColor('base', { alpha: 0.12 }),
background: currentColor('base', { alpha: 0.19 }),
},

activated: {
background: currentColor('base', { alpha: 0.16 }),
background: currentColor('base', { alpha: 0.23 }),
},
},
},
Expand Down Expand Up @@ -1896,13 +1908,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',
},
Expand All @@ -1913,14 +1925,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`,
height: `${24 / components.chip.font.size}em`,
width: `${24 / components.chip.font.size}em`,
},
},

Expand Down
2 changes: 1 addition & 1 deletion core/src/themes/ios/shared.tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const global = {
export const components = {
chip: {
font: {
size: 14,
size: 15,
},
},

Expand Down
Loading