feat(spinner): add recipe and tokens#31014
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
The ionic theme for spinner overwrites the medium since it's one of those components that differs to the set value of medium. I decided to not implement it since it's specific to the project. A workaround would be to set it:
ion-spinner {
--ion-color-medium-bold: #626262;
}There was a problem hiding this comment.
Only removed the word diff from the test file name to line up with the naming conventions of the other components.
There was a problem hiding this comment.
Only removed the word diff from the test file name to line up with the naming conventions of the other components.
There was a problem hiding this comment.
Only removed the word diff from the test file name to line up with the naming conventions of the other components.
There was a problem hiding this comment.
This was renamed, not sure why it's not showing as such.
There was a problem hiding this comment.
Why did you remove the examples of different spinners with color? I believe those existed to show the color properly applied to all spinner types.
There was a problem hiding this comment.
I didn't see how colors and names needed to be tied together for a test. I would expect that it would work for all names regardless. But I've added them back: 5f0020c
There was a problem hiding this comment.
Same question:
Why did you remove the examples of different spinners with color? I believe those existed to show the color properly applied to all spinner types.
| fn: (dur: number, index: number, total: number) => SpinnerData; | ||
| } | ||
|
|
||
| interface SpinnerData { |
There was a problem hiding this comment.
| interface SpinnerData { | |
| export interface SpinnerData { |
There was a problem hiding this comment.
SpinnerData isn't being used anywhere outside of this file so we don't need to export it.
| * Set to `"xlarge"` for the largest size. | ||
| * | ||
| * Defaults to `"xsmall"` for the `ionic` theme, undefined for all other themes. | ||
| * Defaults to `"medium"`. |
There was a problem hiding this comment.
Isn't this only the default for md and ios themes?
There was a problem hiding this comment.
Yes, I chose medium because that one has the values that are currently being used by the community. I also changed the default for ionic to be xsmall through their config.
| [spinnerName: string]: SpinnerConfig; | ||
| } | ||
|
|
||
| export interface SpinnerConfig { |
There was a problem hiding this comment.
Should we rename this? It's kind of confusing when we have IonSpinnerConfig also.
|
|
||
| circular: { | ||
| stroke: { | ||
| width: '5.6', |
There was a problem hiding this comment.
Should this be a token or calculated somehow?
There was a problem hiding this comment.
Nope, it's exactly the same value set for native.
| }, | ||
|
|
||
| IonSpinner: { | ||
| color: '#626262', |
There was a problem hiding this comment.
Shouldn't this use a token or are you waiting on the text / gray colors to be added?
iOS has:
color: 'var(--ion-text-color, #000)',
|
|
||
| lines: { | ||
| stroke: { | ||
| width: '7px', |
There was a problem hiding this comment.
Do we need to add variables for this, or should we use border-width ones?
There was a problem hiding this comment.
border-width doesn't have a 7px value. Even if it did, I still would expect to use scaling since the stroke width targets a svg not a border.
I don't think we should add a variable to account for 7px because it would break the current implementation we have for tokens like scaling. We are incrementing the keys by 50 so odd values aren't supported.
|
|
||
| lines: { | ||
| stroke: { | ||
| width: '7px', |
Co-authored-by: Brandy Smith <[email protected]>
Issue number: internal
What is the current behavior?
Component styles for
ion-spinnerare fragmented across multiple files (native andionic). Themdandiostheme uses the native styles. Developers were restricted to those themes and how those themes structured the logic and styles.What is the new behavior?
spinner.scssfile that consumes CSS variables, ensuring a single source of truth for component logic.spinner.interfaces.tsmdandios.Does this introduce a breaking change?
This PR introduces a breaking change to how
IonSpinneris styled. Existing manual CSS overrides targeting internal spinner structures or old token names will no longer work due to the shift to the new token hierarchy and a unified base SCSS file.Migration Path:
Token Updates: Update any custom theme configurations to match the new nested structure.
CSS Overrides: Ensure selectors align with the new slotted element logic and variable names (e.g.,
--ion-spinner-color).--colorshould no longer be used. Setting the value,IonSpinner.color, within the tokens file should be used to change the color.Theme classes: Remove any instances that target the theme classes:
ion-spinner.mdSpinner name class: The class have been updated to include the term
name..spinner-lines,.spinner-circular, etc should be updated to.spinner-name-lines,.spinner-name-circular, etc.Other information
Previews: