diff --git a/README.md b/README.md index bc4d8d91..14db5bae 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ For individual CSS files and animation settings, use [configuration](https://web - [Color system](https://webview-native-ui.com/projects/ionic-theme-md3/docs/color-system) — Ionic palette defaults, optional Material roles and component color assignments. - [Android Settings appearance](https://webview-native-ui.com/projects/ionic-theme-md3/docs/android-settings) — default geometry, CSS font defaults and Ionic customization. - [Using ion-item-group](https://webview-native-ui.com/projects/ionic-theme-md3/docs/using-ion-item-group) — shared inset-list markup for iOS 27 and MD3. -- [Special markup](https://webview-native-ui.com/projects/ionic-theme-md3/docs/special-markup) — opt-in component combinations used by the demo. +- [Special markup](https://webview-native-ui.com/projects/ionic-theme-md3/docs/special-markup) — opt-in patterns, including connected button groups with `ion-segment.segment-group`. - [ESLint](https://webview-native-ui.com/projects/ionic-theme-md3/docs/eslint) — check list structure with ESLint rules. - [Migration](https://webview-native-ui.com/projects/ionic-theme-md3/docs/migration) — optional setup simplification and version-specific upgrade steps. diff --git a/demo/e2e/screenshot.spec.ts-snapshots/device-segment-dark.png b/demo/e2e/screenshot.spec.ts-snapshots/device-segment-dark.png index 12d739bb..13974ea5 100644 Binary files a/demo/e2e/screenshot.spec.ts-snapshots/device-segment-dark.png and b/demo/e2e/screenshot.spec.ts-snapshots/device-segment-dark.png differ diff --git a/demo/e2e/screenshot.spec.ts-snapshots/device-segment-light.png b/demo/e2e/screenshot.spec.ts-snapshots/device-segment-light.png index 1059cfc9..a80141e6 100644 Binary files a/demo/e2e/screenshot.spec.ts-snapshots/device-segment-light.png and b/demo/e2e/screenshot.spec.ts-snapshots/device-segment-light.png differ diff --git a/demo/e2e/screenshot.spec.ts-snapshots/segment-dark.png b/demo/e2e/screenshot.spec.ts-snapshots/segment-dark.png index 8dbf47e9..b85f089e 100644 Binary files a/demo/e2e/screenshot.spec.ts-snapshots/segment-dark.png and b/demo/e2e/screenshot.spec.ts-snapshots/segment-dark.png differ diff --git a/demo/e2e/screenshot.spec.ts-snapshots/segment.png b/demo/e2e/screenshot.spec.ts-snapshots/segment.png index 875df5ae..4733c00d 100644 Binary files a/demo/e2e/screenshot.spec.ts-snapshots/segment.png and b/demo/e2e/screenshot.spec.ts-snapshots/segment.png differ diff --git a/demo/src/app/docs/docs-content.generated.ts b/demo/src/app/docs/docs-content.generated.ts index 7fce51a4..24493926 100644 --- a/demo/src/app/docs/docs-content.generated.ts +++ b/demo/src/app/docs/docs-content.generated.ts @@ -1,3 +1,3 @@ // Generated from docs/special-markup.md. Do not edit directly. export const docsContentHtml = - '

Special markup

\n

Most Ionic markup works without changes. Shared markup carries the same meaning in\n@rdlabo/ionic-theme-ios27 and this theme; its appearance follows the active platform.\nAndroid Settings is the MD3 visual reference. Shared markup does not request an iOS\nGlass appearance on Android.

\n

Submit buttons

\n

Use type="submit" for a real form submission. If submitting through a form is not\npossible, type="button" class="button-submit" identifies the equivalent action;\nthe class only describes appearance and does not submit, validate, or install a handler.\nFor a filled primary action, use Ionic's public fill="solid". MD3 already renders\nsolid buttons using the palette's base/contrast pair, so these two forms share the\nsame Android appearance without an additional effect or JavaScript helper.

\n
<ion-button type="submit" fill="solid" color="primary">Submit</ion-button>\n<ion-button type="button" class="button-submit" fill="solid" color="primary">Continue</ion-button>
\n\n
\n
Preview
\nSubmit\nContinue\n
\n\n

Explicit Ionic colors, disabled state, and fill="clear" / fill="outline" keep their\nnormal meaning. The class does not force a different fill.

\n

Toolbar button badges

\n

Place ion-badge directly inside an ion-button in an ion-toolbar. Both\nstandalone buttons and buttons inside ion-buttons support this markup.\nAn empty badge shows an unread indicator; text such as 3 or 99+ shows a count.\nFor an indicator, keep the contents completely empty (<ion-badge></ion-badge>),\nwithout spaces or line breaks between the tags.

\n

Standalone toolbar button:

\n
<ion-toolbar>\n  <ion-button slot="end" aria-label="Notifications">\n    <ion-icon name="ellipsis-horizontal" slot="icon-only"></ion-icon>\n    <ion-badge>3</ion-badge>\n  </ion-button>\n</ion-toolbar>
\n\n
\n
Preview
\n\n \n \n 3\n \n\n
\n\n

Grouped toolbar buttons, with empty, numeric and wide badges:

\n
<ion-toolbar>\n  <ion-buttons slot="end">\n    <ion-button aria-label="Unread notifications">\n      <ion-icon name="ellipsis-horizontal" slot="icon-only"></ion-icon>\n      <ion-badge></ion-badge>\n    </ion-button>\n    <ion-button aria-label="3 notifications">\n      <ion-icon name="ellipsis-horizontal" slot="icon-only"></ion-icon>\n      <ion-badge>3</ion-badge>\n    </ion-button>\n    <ion-button aria-label="99 or more notifications">\n      <ion-icon name="ellipsis-horizontal" slot="icon-only"></ion-icon>\n      <ion-badge>99+</ion-badge>\n    </ion-button>\n  </ion-buttons>\n</ion-toolbar>
\n\n
\n
Preview
\n\n \n \n \n \n \n \n \n 3\n \n \n \n 99+\n \n \n\n
\n\n

Use the badge's color property to choose an Ionic color. Setting hidden or\ndisplay: none, or removing the badge, hides it without changing the action's\nlayout. Include the notification state in the action's accessible label.

\n

The treatment is limited to direct-child badges in toolbar buttons. Badges in\ntabs, outside toolbars, or nested in another child keep their existing styling.\nTheme opt-outs on the toolbar, group, button or badge remain supported.

\n

Preferred overlay actions

\n

For alerts and action sheets, use role: 'preferred' for the recommended action,\nmatching the iOS 27 theme's convention. Appearance follows the overlay's purpose:\nan Alert uses a filled primary/on-primary action, while an Action Sheet keeps the\nsame full-width row geometry as its other choices and emphasizes its text/icon\nwith primary color and medium weight. The Action Sheet's Cancel group is separated\nfrom the choices by spacing and a divider. Colors derive from the Ionic palette\nunless optional Material roles are supplied. Ordinary/default actions remain text\nactions; confirm alone does not request emphasis. Cancellation, selection, and\ndestructive roles remain separate from recommendation.

\n
buttons: [\n  { text: \'Cancel\', role: \'cancel\' },\n  { text: \'Continue\', role: \'preferred\' },\n];
\n\n

This custom Ionic role does not select or invoke an action automatically. The\nbutton's handler runs normally and dismissal reports preferred; handle that\nrole explicitly if the application inspects dismissal results. cancel retains\nIonic cancellation behavior. Do not replace cancel, selected, or destructive\nwith preferred just to change their color.

\n

Two-line inset list items

\n

Place an unslotted ion-label immediately alongside an unslotted ion-note to render a two-line item. Wrap inset items in ion-item-group and keep ion-list-header outside the group. Use slot="end" on ion-note when you want the standard trailing-note layout instead.

\n
<ion-list inset="true">\n  <ion-item-group>\n    <ion-item>\n      <ion-label>Network &amp; internet</ion-label>\n      <ion-note>Mobile, Wi-Fi, hotspot</ion-note>\n    </ion-item>\n  </ion-item-group>\n</ion-list>
\n\n
\n
Preview
\n\n \n \n Network & internet\n Mobile, Wi-Fi, hotspot\n \n \n\n
\n\n

Square buttons

\n

Add .button-square when a button should use more squared corners. It works with text buttons and icon-only buttons.

\n
<ion-button class="button-square" fill="solid">Continue</ion-button>\n<ion-button class="button-square" fill="solid">\n  <ion-icon name="add" slot="icon-only"></ion-icon>\n</ion-button>
\n\n
\n
Preview
\nContinue\n\n \n\n
\n\n

Inset-list section headers

\n

Add .item-group-header to an ion-item-group to create the centered icon, title, and description used at the top of the component demo pages.

\n

This is an introductory group. Place regular list items in a separate ion-item-group that follows it.

\n
<ion-list inset="true">\n  <ion-item-group class="item-group-header">\n    <ion-item>\n      <ion-label>\n        <ion-icon name="list" style="background: var(--ion-color-primary)"></ion-icon>\n        <h2>Lists</h2>\n        <ion-text>Inset-list examples</ion-text>\n      </ion-label>\n    </ion-item>\n  </ion-item-group>\n  <ion-item-group>\n    <ion-item><ion-label>First item</ion-label></ion-item>\n  </ion-item-group>\n</ion-list>
\n\n
\n
Preview
\n\n \n \n \n \n

Lists

\n Inset-list examples\n
\n
\n
\n \n First item\n \n
\n
\n\n

Android Settings controls

\n

The standard toggle is icon-free. Ionic's enableOnOffLabels remains available\nwhen the application explicitly requests labels:

\n
<ion-list inset="true">\n  <ion-item-group>\n    <ion-item><ion-toggle justify="space-between">Notifications</ion-toggle></ion-item>\n    <ion-item>\n      <ion-toggle justify="space-between" enable-on-off-labels="true">Notifications with on/off labels</ion-toggle>\n    </ion-item>\n  </ion-item-group>\n</ion-list>
\n\n
\n
Preview
\n\n \n Notifications\n \n Notifications with on/off labels\n \n \n\n
\n\n

The theme uses a 52×28px track and 20px thumb. Grouped rows have a 56px minimum\nheight, or 72px for radio rows; long content can grow. Use Ionic's public CSS\nvariables for application sizing, and keep the shared list structure.

\n

The main theme supplies a CSS-only MD font default using local Google Sans Flex\nwhen available and standard fallbacks otherwise. An application's\n--ion-font-family takes priority. Back icons are managed by Ionic; the theme does\nnot bundle a replacement. See Android Settings appearance\nfor font defaults, fallbacks and application overrides.\nReview the migration guide\nwhen updating applications with custom dimensions. These options preserve Ionic's\npalette intent and explicit component properties.

\n

Platform-specific extensions

\n

The shared structure above works without platform-specific templates. iOS-only\nsegment-style-glass, searchbar-classic, floating iPad sheets, and iOS tab-bar\npositioning are not Android appearance requirements. MD3 retains Ionic's segment,\nsearchbar, modal, and tab-bar behavior. .button-square is an optional MD3 shape\nextension, not a required shared markup convention.

\n

\n

Disable the theme for a component

\n

Add .md3-disabled to an individual Ionic component when it must retain Ionic's standard Material styling.

\n
<ion-button fill="solid">MD3 theme</ion-button> <ion-button class="md3-disabled" fill="solid">Standard Ionic</ion-button>
\n\n
\n
Preview
\nMD3 theme Standard Ionic\n
\n'; + '

Special markup

\n

Most Ionic markup works without changes. Shared markup carries the same meaning in\n@rdlabo/ionic-theme-ios27 and this theme; its appearance follows the active platform.\nAndroid Settings is the MD3 visual reference. Shared markup does not request an iOS\nGlass appearance on Android.

\n

Submit buttons

\n

Use type="submit" for a real form submission. If submitting through a form is not\npossible, type="button" class="button-submit" identifies the equivalent action;\nthe class only describes appearance and does not submit, validate, or install a handler.\nFor a filled primary action, use Ionic's public fill="solid". MD3 already renders\nsolid buttons using the palette's base/contrast pair, so these two forms share the\nsame Android appearance without an additional effect or JavaScript helper.

\n
<ion-button type="submit" fill="solid" color="primary">Submit</ion-button>\n<ion-button type="button" class="button-submit" fill="solid" color="primary">Continue</ion-button>
\n\n
\n
Preview
\nSubmit\nContinue\n
\n\n

Explicit Ionic colors, disabled state, and fill="clear" / fill="outline" keep their\nnormal meaning. The class does not force a different fill.

\n

Connected button groups

\n

Add .segment-group to an ion-segment to present related choices as a Material 3\nconnected button group. Ionic manages the value, keyboard navigation and disabled\nstate. Pressing a button tightens its inner corners and starts an Ionic ripple at the touch point. On release,\nthe selected button takes a pill shape. Button widths and the gaps between them\nstay fixed throughout the interaction, as in Android 17’s Transit volume settings.

\n
<ion-segment class="segment-group" value="week" aria-label="Calendar view">\n  <ion-segment-button value="day"><ion-label>Day</ion-label></ion-segment-button>\n  <ion-segment-button value="week"><ion-label>Week</ion-label></ion-segment-button>\n  <ion-segment-button value="month"><ion-label>Month</ion-label></ion-segment-button>\n</ion-segment>
\n\n
\n
Preview
\n\n Day\n Week\n Month\n\n
\n\n

Material 3 button groups

\n

Toolbar button badges

\n

Place ion-badge directly inside an ion-button in an ion-toolbar. Both\nstandalone buttons and buttons inside ion-buttons support this markup.\nAn empty badge shows an unread indicator; text such as 3 or 99+ shows a count.\nFor an indicator, keep the contents completely empty (<ion-badge></ion-badge>),\nwithout spaces or line breaks between the tags.

\n

Standalone toolbar button:

\n
<ion-toolbar>\n  <ion-button slot="end" aria-label="Notifications">\n    <ion-icon name="ellipsis-horizontal" slot="icon-only"></ion-icon>\n    <ion-badge>3</ion-badge>\n  </ion-button>\n</ion-toolbar>
\n\n
\n
Preview
\n\n \n \n 3\n \n\n
\n\n

Grouped toolbar buttons, with empty, numeric and wide badges:

\n
<ion-toolbar>\n  <ion-buttons slot="end">\n    <ion-button aria-label="Unread notifications">\n      <ion-icon name="ellipsis-horizontal" slot="icon-only"></ion-icon>\n      <ion-badge></ion-badge>\n    </ion-button>\n    <ion-button aria-label="3 notifications">\n      <ion-icon name="ellipsis-horizontal" slot="icon-only"></ion-icon>\n      <ion-badge>3</ion-badge>\n    </ion-button>\n    <ion-button aria-label="99 or more notifications">\n      <ion-icon name="ellipsis-horizontal" slot="icon-only"></ion-icon>\n      <ion-badge>99+</ion-badge>\n    </ion-button>\n  </ion-buttons>\n</ion-toolbar>
\n\n
\n
Preview
\n\n \n \n \n \n \n \n \n 3\n \n \n \n 99+\n \n \n\n
\n\n

Use the badge's color property to choose an Ionic color. Setting hidden or\ndisplay: none, or removing the badge, hides it without changing the action's\nlayout. Include the notification state in the action's accessible label.

\n

The treatment is limited to direct-child badges in toolbar buttons. Badges in\ntabs, outside toolbars, or nested in another child keep their existing styling.\nTheme opt-outs on the toolbar, group, button or badge remain supported.

\n

Preferred overlay actions

\n

For alerts and action sheets, use role: 'preferred' for the recommended action,\nmatching the iOS 27 theme's convention. Appearance follows the overlay's purpose:\nan Alert uses a filled primary/on-primary action, while an Action Sheet keeps the\nsame full-width row geometry as its other choices and emphasizes its text/icon\nwith primary color and medium weight. The Action Sheet's Cancel group is separated\nfrom the choices by spacing and a divider. Colors derive from the Ionic palette\nunless optional Material roles are supplied. Ordinary/default actions remain text\nactions; confirm alone does not request emphasis. Cancellation, selection, and\ndestructive roles remain separate from recommendation.

\n
buttons: [\n  { text: \'Cancel\', role: \'cancel\' },\n  { text: \'Continue\', role: \'preferred\' },\n];
\n\n

This custom Ionic role does not select or invoke an action automatically. The\nbutton's handler runs normally and dismissal reports preferred; handle that\nrole explicitly if the application inspects dismissal results. cancel retains\nIonic cancellation behavior. Do not replace cancel, selected, or destructive\nwith preferred just to change their color.

\n

Two-line inset list items

\n

Place an unslotted ion-label immediately alongside an unslotted ion-note to render a two-line item. Wrap inset items in ion-item-group and keep ion-list-header outside the group. Use slot="end" on ion-note when you want the standard trailing-note layout instead.

\n
<ion-list inset="true">\n  <ion-item-group>\n    <ion-item>\n      <ion-label>Network &amp; internet</ion-label>\n      <ion-note>Mobile, Wi-Fi, hotspot</ion-note>\n    </ion-item>\n  </ion-item-group>\n</ion-list>
\n\n
\n
Preview
\n\n \n \n Network & internet\n Mobile, Wi-Fi, hotspot\n \n \n\n
\n\n

Square buttons

\n

Add .button-square when a button should use more squared corners. It works with text buttons and icon-only buttons.

\n
<ion-button class="button-square" fill="solid">Continue</ion-button>\n<ion-button class="button-square" fill="solid">\n  <ion-icon name="add" slot="icon-only"></ion-icon>\n</ion-button>
\n\n
\n
Preview
\nContinue\n\n \n\n
\n\n

Inset-list section headers

\n

Add .item-group-header to an ion-item-group to create the centered icon, title, and description used at the top of the component demo pages.

\n

This is an introductory group. Place regular list items in a separate ion-item-group that follows it.

\n
<ion-list inset="true">\n  <ion-item-group class="item-group-header">\n    <ion-item>\n      <ion-label>\n        <ion-icon name="list" style="background: var(--ion-color-primary)"></ion-icon>\n        <h2>Lists</h2>\n        <ion-text>Inset-list examples</ion-text>\n      </ion-label>\n    </ion-item>\n  </ion-item-group>\n  <ion-item-group>\n    <ion-item><ion-label>First item</ion-label></ion-item>\n  </ion-item-group>\n</ion-list>
\n\n
\n
Preview
\n\n \n \n \n \n

Lists

\n Inset-list examples\n
\n
\n
\n \n First item\n \n
\n
\n\n

Android Settings controls

\n

The standard toggle is icon-free. Ionic's enableOnOffLabels remains available\nwhen the application explicitly requests labels:

\n
<ion-list inset="true">\n  <ion-item-group>\n    <ion-item><ion-toggle justify="space-between">Notifications</ion-toggle></ion-item>\n    <ion-item>\n      <ion-toggle justify="space-between" enable-on-off-labels="true">Notifications with on/off labels</ion-toggle>\n    </ion-item>\n  </ion-item-group>\n</ion-list>
\n\n
\n
Preview
\n\n \n Notifications\n \n Notifications with on/off labels\n \n \n\n
\n\n

The theme uses a 52×28px track and 20px thumb. Grouped rows have a 56px minimum\nheight, or 72px for radio rows; long content can grow. Use Ionic's public CSS\nvariables for application sizing, and keep the shared list structure.

\n

The main theme supplies a CSS-only MD font default using local Google Sans Flex\nwhen available and standard fallbacks otherwise. An application's\n--ion-font-family takes priority. Back icons are managed by Ionic; the theme does\nnot bundle a replacement. See Android Settings appearance\nfor font defaults, fallbacks and application overrides.\nReview the migration guide\nwhen updating applications with custom dimensions. These options preserve Ionic's\npalette intent and explicit component properties.

\n

Platform-specific extensions

\n

The shared structure above works without platform-specific templates. iOS-only\nsegment-style-glass, searchbar-classic, floating iPad sheets, and iOS tab-bar\npositioning are not Android appearance requirements. MD3 retains Ionic's segment,\nsearchbar, modal, and tab-bar behavior. .button-square is an optional MD3 shape\nextension, not a required shared markup convention.

\n

\n

Disable the theme for a component

\n

Add .md3-disabled to an individual Ionic component when it must retain Ionic's standard Material styling.

\n
<ion-button fill="solid">MD3 theme</ion-button> <ion-button class="md3-disabled" fill="solid">Standard Ionic</ion-button>
\n\n
\n
Preview
\nMD3 theme Standard Ionic\n
\n'; diff --git a/demo/src/app/docs/docs-page.component.spec.ts b/demo/src/app/docs/docs-page.component.spec.ts index 006f9cd1..a215f683 100644 --- a/demo/src/app/docs/docs-page.component.spec.ts +++ b/demo/src/app/docs/docs-page.component.spec.ts @@ -19,6 +19,7 @@ describe('DocsPage', () => { expect(element.querySelector('article.docs-content h1')?.textContent).toContain('Special markup'); expect(element.querySelectorAll('.code-block-container pre.shiki code').length).toBeGreaterThan(0); expect(element.querySelector('.code-block-container code span[style*="color"]')).not.toBeNull(); - expect(element.querySelectorAll('figure.docs-example').length).toBe(8); + expect(element.querySelectorAll('figure.docs-example').length).toBe(9); + expect(element.querySelectorAll('figure.docs-example ion-segment.segment-group > ion-segment-button').length).toBe(3); }); }); diff --git a/demo/src/app/index/pages/segment/segment.page.html b/demo/src/app/index/pages/segment/segment.page.html index 4520514d..15a3e6da 100644 --- a/demo/src/app/index/pages/segment/segment.page.html +++ b/demo/src/app/index/pages/segment/segment.page.html @@ -123,5 +123,11 @@

segment

+

Connected button group

+ + Day + Week + Month + diff --git a/docs/special-markup.md b/docs/special-markup.md index c53ee427..13a6f298 100644 --- a/docs/special-markup.md +++ b/docs/special-markup.md @@ -26,6 +26,24 @@ same Android appearance without an additional effect or JavaScript helper. Explicit Ionic colors, disabled state, and `fill="clear"` / `fill="outline"` keep their normal meaning. The class does not force a different fill. +## Connected button groups + +Add `.segment-group` to an `ion-segment` to present related choices as a Material 3 +connected button group. Ionic manages the value, keyboard navigation and disabled +state. Pressing a button tightens its inner corners and starts an Ionic ripple at the touch point. On release, +the selected button takes a pill shape. Button widths and the gaps between them +stay fixed throughout the interaction, as in Android 17’s Transit volume settings. + +```html preview + + Day + Week + Month + +``` + +[Material 3 button groups](https://m3.material.io/components/button-groups/overview) + ## Toolbar button badges Place `ion-badge` directly inside an `ion-button` in an `ion-toolbar`. Both diff --git a/src/styles/components/ion-segment.scss b/src/styles/components/ion-segment.scss index a8f53d2b..71e0426f 100644 --- a/src/styles/components/ion-segment.scss +++ b/src/styles/components/ion-segment.scss @@ -1,3 +1,5 @@ +@use '../utils/colors' as md3; + ion-segment.md:not(.md3-disabled) { border-bottom: 1px solid var( @@ -5,3 +7,75 @@ ion-segment.md:not(.md3-disabled) { var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))) ); } + +ion-segment.md.segment-group:not(.md3-disabled) { + gap: 2px; + border-bottom: 0; + + > ion-segment-button.md:not(.md3-disabled) { + --md3-segment-inner-corner: 8px; + --indicator-height: 0; + --background: transparent; + --background-checked: transparent; + --color: #{md3.color(on-secondary-container)}; + --color-checked: #{md3.color(on-secondary)}; + --md3-segment-selected-background: #{md3.color(secondary)}; + --background-hover: currentColor; + --background-focused: currentColor; + --ripple-color: currentColor; + min-width: 48px; + min-height: 48px; + padding-block: 4px; + text-transform: none; + letter-spacing: 0.006em; + + &.in-segment-color { + --md3-segment-selected-background: var(--ion-color-base); + --color-checked: var(--ion-color-contrast); + } + &:first-of-type { + --md3-segment-start-corner: 20px; + } + &:last-of-type { + --md3-segment-end-corner: 20px; + } + &.segment-button-checked { + --md3-segment-inner-corner: 20px; + } + &:active { + --md3-segment-inner-corner: 4px; + } + &::part(native) { + min-height: 40px; + border-start-start-radius: var(--md3-segment-start-corner, var(--md3-segment-inner-corner)); + border-end-start-radius: var(--md3-segment-start-corner, var(--md3-segment-inner-corner)); + border-start-end-radius: var(--md3-segment-end-corner, var(--md3-segment-inner-corner)); + border-end-end-radius: var(--md3-segment-end-corner, var(--md3-segment-inner-corner)); + background: #{md3.color(secondary-container)}; + color: var(--color); + } + &.segment-button-checked::part(native) { + background: var(--md3-segment-selected-background); + color: var(--color-checked); + } + &.ion-focused::part(native) { + outline: 2px solid currentColor; + outline-offset: -3px; + } + > ion-label:not(.md3-disabled), + > ion-icon:not(.md3-disabled) { + margin-block: 0; + } + > ion-icon:not(.md3-disabled) { + font-size: 18px; + } + + @media (prefers-reduced-motion: no-preference) { + &::part(native) { + transition: + border-radius var(--token-expressive-fast-effects), + background-color var(--token-expressive-fast-effects); + } + } + } +}