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 really good, every md value I checked lines up with the PR description! Just a few things, mainly the readonly datetime buttons going gray and the toolbar icon buttons growing to 64px.
…md-sync # Conflicts: # core/src/themes/md/default.tokens.ts
…md-sync # Conflicts: # BREAKING.md
| | Disabled | the whole button at `0.5` opacity | `38%` text color, a `12%` container and no elevation | `IonButton.hue.bold.<fill>.disabled.opacity`, `.color`, `.background` and `.box.shadow` (`.semantic.disabled.color` and `.background` with a `color`) | | ||
| | Pressed ripple | `16%` | `24%` on solid, `12%` on outline and clear | `IonButton.hue.bold.<fill>.rippleEffect.opacity` (`.semantic.rippleEffect.opacity` with a `color`) | | ||
|
|
||
| Buttons in toolbars keep their previous colors when disabled. Buttons in `ion-buttons` also have no min width and no elevation on hover or focus. |
There was a problem hiding this comment.
| Buttons in toolbars keep their previous colors when disabled. Buttons in `ion-buttons` also have no min width and no elevation on hover or focus. | |
| Buttons in toolbars keep their previous colors when disabled. Buttons in `ion-buttons` also have no min width, and in a toolbar they have no elevation on hover or focus. |
Small follow-up to my earlier comment on this sentence, now that item 7 covers ion-buttons outside a toolbar. The none overrides only exist under IonToolbar.IonButtons, so a solid button in an ion-buttons with no toolbar still goes from elevation 2 to elevation 4 on hover and focus. That matches item 7, but this sentence says it doesn't happen.
|
|
||
| IonToolbar: { | ||
| // In a toolbar, a disabled button keeps its colors and fades | ||
| IonButton: { |
There was a problem hiding this comment.
Could we add IonButton?: IonButtonRecipe; under /** In any toolbar */ in the IonToolbar theme type? No theme put IonButton straight under IonToolbar before, so right now these overrides fall through to [key: string]: any and a typo like disabled.colr compiles without an error. All four default themes still type-check with it added.
Issue number: resolves internal
What is the current behavior?
md buttons use values carried over from v9 instead of Material Design 2: 15.4px padding,
0.06emtracking, a 2px outline in the button's color, a 0.5 fade when disabled, and the same elevation on hover and focus as at rest.What is the new behavior?
md buttons follow Material Design 2, using the values from Material Components Web 14, Google's MD2 implementation:
0.0893emletter spacingion-buttonshave no min width, so an icon withoutslot="icon-only"doesn't widen themTo support this, the recipe gains
hover.box.shadow,focus.box.shadowanddisabled.{color, border.color, box.shadow}. A theme that doesn't set the disabled colors keeps its default colors, so ios and ionic don't change.Toolbar and datetime buttons keep their current look: no elevation on hover or focus, and disabled toolbar buttons still fade their own colors.
Snapshots are in #31637.
Does this introduce a breaking change?
The
mdbutton follows Material Design 2 for its spacing, outline, elevation and disabled state. To keep a previous value, set the token for global styles, or the matching--ion-button-*CSS variable for component-specific styles. Replace<fill>withsolid,outlineorclear, and<size>withsmall,mediumorlarge.1.1em1.1429em(16pxat the default size)IonButton.size.medium.padding.startand.end64pxIonButton.size.medium.min.width0.06em0.0893emIonButton.letter.spacing1.35em1.2857em(18pxat the default size)IonButton.size.<size>.icon.font.size0.3em0.4444em(8pxat the default size)IonButton.size.<size>.icon.leading.margin.endand.trailing.margin.start28pxby default)1.2857emby default (18pxat the default size), with the other spinner sizes in their usual ratio to itIonButton.size.<size>.spinner.size.<spinner size>.widthand.height2px, the button's color1px, the text color at12%IonButton.hue.bold.outline.default.border.widthand.color(.semantic.default.border.colorwith acolor)IonButton.hue.bold.solid.hover.box.shadowand.focus.box.shadow0.5opacity38%text color, a12%container and no elevationIonButton.hue.bold.<fill>.disabled.opacity,.color,.backgroundand.box.shadow(.semantic.disabled.colorand.backgroundwith acolor)16%24%on solid,12%on outline and clearIonButton.hue.bold.<fill>.rippleEffect.opacity(.semantic.rippleEffect.opacitywith acolor)Buttons in toolbars keep their previous colors when disabled. Buttons in
ion-buttonsalso have no min width and no elevation on hover or focus.Other information
Not matched to MD2 on purpose
rounddefault from feat(button): set default shape to soft for ios and round for md and ionic themes #29404 staysKnown gaps
TODO(FW-6417)). The lighter ripple helps, but the text still falls short of WCAG's 4.5:1. The fix belongs to the dark paletteHow to test