Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ShaneK
left a comment
There was a problem hiding this comment.
Looks good to me! Just a couple of small things on the sizing.
| top: 'var(--ion-spacing-xxs)', | ||
| end: 'var(--ion-spacing-250)', | ||
| bottom: 'var(--ion-spacing-xxs)', |
There was a problem hiding this comment.
| 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.
| - 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. A pressed chip now keeps its resting background under the ripple instead of darkening. Both follow the Material Design 2 guidelines. To revert to the previous appearance, set `IonChip.hue.bold.solid.focus.background`, `IonChip.hue.bold.outline.focus.background` and the `activated.background` of each hue and fill for global styles, or the matching `--ion-chip-hue-*-focus-background` and `--ion-chip-hue-*-activated-background` variables for component-specific styles. | ||
| - 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)`, and `IonChip.size.large.line.height` and `IonChip.size.large.letterSpacing` to `inherit` for global styles, or the matching `--ion-chip-size-large-*` variables for component-specific styles. |
There was a problem hiding this comment.
| - 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)`, and `IonChip.size.large.line.height` and `IonChip.size.large.letterSpacing` to `inherit` for global styles, or the matching `--ion-chip-size-large-*` 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.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. |
The icon and avatar sizes are based on the label size, so after this revert they're still smaller than before, an 18.67px icon and a 22.4px avatar instead of 20px and 24px. Setting these two as well brings them back to exactly what they were.
Issue number: internal
What is the current behavior?
The ios chip uses the same layout as the md chip:
32pxtall with6px12pxpadding, a14pxlabel with inherited line height and letter spacing,8pxbetween an icon and the label, and10pxcorners by default. A chip with acolorhas an8%background, and a disabled chip has an opacity of0.4. Its rem and em values are rounded to two decimals, so it renders slightly larger than onnext.What is the new behavior?
iOS has no chip, so the ios chip follows the closest native control: the bezeled capsule buttons in the iOS 17 design kit. Chips are one size below buttons, as in Material Design 2 (a
32pxchip next to a36pxbutton), so thelargechip matches the small bezeled button rather than the default one:round)largechip matches the small bezeled button:28pxtall,4px10pxpadding, and a15pxlabel with a20pxline height and-0.016emletter spacing (the Subheadline style and Apple's tracking for15pt)smallchip stays24pxtall, with3px8pxpadding and a13pxlabel with an18pxline height and-0.006emletter spacing (the Footnote style), since iOS has no smaller capsule4pxbetween a slotted icon and the labelcoloris tinted like the bezeled button:15%of the color, with hover and focus at19%and pressed at23%0.5, matching theiosbuttonnextThe pressed background stays, since ios chips have no ripple to show the press.
Does this introduce a breaking change?
The ios chip changes its size, typography, icon spacing, colored background and disabled opacity. The chip section of
BREAKING.mdlists each one with the global token and CSS variable that revert it.Other information
How to test
28px) with a slightly bigger label, and icons sit closer to the label