-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(spinner): add recipe and tokens #31014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 21 commits
0a3f41d
5eee3a8
75a325a
53d06e1
78cfbba
edb0414
2ffac3e
3d89f21
363cddf
7b13706
b2a301a
5f0020c
1179d40
4f5ee31
2cd0043
4c1c6d2
ee53528
8019941
0aef08c
cb80321
5388749
de06eb8
7e1f630
3c5afb3
8668db4
528cb40
e00d1f0
062a7c7
95b1b41
a8892a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,8 @@ This is a comprehensive list of the breaking changes introduced in the major ver | |
| - [Card](#version-9x-card) | ||
| - [Chip](#version-9x-chip) | ||
| - [Grid](#version-9x-grid) | ||
| - [Radio Group](#version-9x-radio-group) | ||
| - [Spinner](#version-9x-spinner) | ||
|
|
||
| <h2 id="version-9x-components">Components</h2> | ||
|
|
||
|
|
@@ -38,12 +40,6 @@ This is a comprehensive list of the breaking changes introduced in the major ver | |
|
|
||
| - The properties `pull` and `push` have been deprecated and no longer work. A similar look can be achieved with the newly added property `order`. | ||
|
|
||
| <h4 id="version-9x-radio-group">Radio Group</h4> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was moved to the correct location. It was originally added right in the middle of the grid changes. |
||
|
|
||
| - Converted `ion-radio-group` to use [Shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM).<br/> | ||
| If you were targeting the internals of `ion-radio-group` in your CSS, you will need to target the `supporting-text`, `helper-text` or `error-text` [Shadow Parts](https://ionicframework.com/docs/theming/css-shadow-parts) instead, or use the provided CSS Variables.<br/> | ||
| Additionally, the `radio-group-wrapper` div element has been removed, causing slotted elements to be direct children of the `ion-radio-group`. | ||
|
|
||
| <h5>Example 1: Swap two columns</h5> | ||
|
|
||
| **Version up to 8.x** | ||
|
|
@@ -140,4 +136,19 @@ To reorder two columns where column 1 has `size="9" push="3"` and column 2 has ` | |
| </ion-col> | ||
| </ion-row> | ||
| </ion-grid> | ||
| ``` | ||
| ``` | ||
|
|
||
| <h4 id="version-9x-radio-group">Radio Group</h4> | ||
|
|
||
| - Converted `ion-radio-group` to use [Shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM).<br/> | ||
| If you were targeting the internals of `ion-radio-group` in your CSS, you will need to target the `supporting-text`, `helper-text` or `error-text` [Shadow Parts](https://ionicframework.com/docs/theming/css-shadow-parts) instead, or use the provided CSS Variables.<br/> | ||
| Additionally, the `radio-group-wrapper` div element has been removed, causing slotted elements to be direct children of the `ion-radio-group`. | ||
|
|
||
| <h4 id="version-9x-spinner">Spinner</h4> | ||
|
|
||
| - Component CSS variables have been removed. The component now utilizes the centralized Ionic Theming system. Global updates should be managed via the theme tokens file, while component-specific overrides are handled through localized CSS variables. | ||
|
brandyscarney marked this conversation as resolved.
|
||
| - `--color` is replaced by `IonSpinner.color` for global styles and | ||
| `--ion-spinner-color` for component-specific styles. | ||
| - CSS classes now include the property name to improve clarity. | ||
| - `.spinner-[spinner-name]` → `.spinner-name-[spinner-name]` | ||
| - Specific theme classes (e.g., `ion-spinner.md`) are no longer supported. Style modifications based on the active theme must be implemented using theme tokens rather than direct class targeting. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR description says:
But we still have this variable, why?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because we discussed that it would be revisited as we add more components. Should I just remove them?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I thought that was just about the focus variables. I don't see a reason they can't override the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,19 +5,7 @@ | |
| // -------------------------------------------------- | ||
|
|
||
| :host { | ||
| /** | ||
| * @prop --border-radius: Border radius of the chip | ||
| * @prop --color: Color of the chip | ||
| * @prop --focus-ring-color: Color of the focus ring | ||
| * @prop --focus-ring-style: Style of the focus ring | ||
| * @prop --focus-ring-width: Width of the focus ring | ||
| */ | ||
|
Comment on lines
-8
to
-14
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we plan to document the new CSS variables? Are we going to add them here or somewhere else?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this auto-generated? If not we should really find a way to do so lol.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it was painstakingly annoying 😭 I'll make a ticket for us to look into a way to generate these. |
||
| --focus-ring-color: var(--ion-chip-state-focus-ring-color); | ||
| --focus-ring-style: var(--ion-chip-state-focus-ring-style); | ||
| --focus-ring-width: var(--ion-chip-state-focus-ring-width); | ||
|
|
||
| @include mixins.font-smoothing(); | ||
| @include mixins.border-radius(var(--border-radius)); | ||
| @include mixins.margin( | ||
| var(--ion-chip-margin-top), | ||
| var(--ion-chip-margin-end), | ||
|
|
@@ -37,8 +25,6 @@ | |
| align-items: center; | ||
| justify-content: center; | ||
|
|
||
| color: var(--color); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was never being applied. The color is done through the hue classes. |
||
|
|
||
| font-weight: var(--ion-chip-font-weight); | ||
|
|
||
| letter-spacing: var(--ion-chip-letter-spacing); | ||
|
|
@@ -72,15 +58,15 @@ | |
| // --------------------------------------------- | ||
|
|
||
| :host(.chip-shape-soft) { | ||
| --border-radius: var(--ion-chip-shape-soft-border-radius); | ||
| @include mixins.border-radius(var(--ion-chip-shape-soft-border-radius)); | ||
| } | ||
|
|
||
| :host(.chip-shape-round) { | ||
| --border-radius: var(--ion-chip-shape-round-border-radius); | ||
| @include mixins.border-radius(var(--ion-chip-shape-round-border-radius)); | ||
| } | ||
|
|
||
| :host(.chip-shape-rectangular) { | ||
| --border-radius: var(--ion-chip-shape-rectangular-border-radius); | ||
| @include mixins.border-radius(var(--ion-chip-shape-rectangular-border-radius)); | ||
| } | ||
|
|
||
| // Chip: Bold Solid | ||
|
|
@@ -358,7 +344,11 @@ | |
|
|
||
| // Focus | ||
| :host(.ion-focused) { | ||
| @include mixins.focused-state(var(--focus-ring-width), var(--focus-ring-style), var(--focus-ring-color)); | ||
| @include mixins.focused-state( | ||
| var(--ion-chip-state-focus-ring-width), | ||
| var(--ion-chip-state-focus-ring-style), | ||
| var(--ion-chip-state-focus-ring-color) | ||
| ); | ||
| } | ||
|
|
||
| // Chip Slotted Elements | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was renamed, not sure why it's not showing as such. |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| export interface SpinnerDefinitions { | ||
| [spinnerName: string]: SpinnerDefinition; | ||
| } | ||
|
|
||
| export interface SpinnerDefinition { | ||
| dur: number; | ||
| circles?: number; | ||
| lines?: number; | ||
| elmDuration?: boolean; | ||
| fn: (dur: number, index: number, total: number) => SpinnerData; | ||
| } | ||
|
|
||
| interface SpinnerData { | ||
|
brandyscarney marked this conversation as resolved.
|
||
| r?: number; | ||
| y1?: number; | ||
| y2?: number; | ||
| cx?: number; | ||
| cy?: number; | ||
| style: { [key: string]: string | undefined }; | ||
| viewBox?: string; | ||
| transform?: string; | ||
| } | ||
|
|
||
| export type IonSpinnerRecipe = { | ||
| color?: string; | ||
|
|
||
| lines?: { | ||
| stroke?: { | ||
| width?: string; | ||
| }; | ||
|
|
||
| small?: { | ||
| stroke?: { | ||
| width?: string; | ||
| }; | ||
| }; | ||
|
|
||
| sharp?: { | ||
| stroke?: { | ||
| width?: string; | ||
| }; | ||
|
|
||
| small?: { | ||
| stroke?: { | ||
| width?: string; | ||
| }; | ||
| }; | ||
| }; | ||
| }; | ||
|
|
||
| circular?: { | ||
| stroke?: { | ||
| width?: string; | ||
| }; | ||
| }; | ||
|
|
||
| crescent?: { | ||
| stroke?: { | ||
| width?: string; | ||
| }; | ||
| }; | ||
|
|
||
| // Sizes | ||
| size?: { | ||
| [K in SpinnerSize]?: IonSpinnerSizeDefinition; | ||
| }; | ||
| }; | ||
|
|
||
| type IonSpinnerSizeDefinition = { | ||
| width?: string; | ||
| height?: string; | ||
| }; | ||
|
|
||
| export type IonSpinnerConfig = { | ||
| size?: SpinnerSize; | ||
| }; | ||
|
|
||
| export type SpinnerSize = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'; | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.