-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spinner size followup (using design tokens) (#988)
# Pull Request ## 🤨 Rationale Associated feature - #346 Nathan Mitchell, Fred Visser, Jesse Attas, and myself had a followup discussion about spinner sizes. The end result was that we wanted it to be easier for users to use the designer-prescribed spinner sizes. Nathan followed up with Brandon O'Keefe to confirm the 3 spinner sizes desired (they still went with 16/32/64, which also matches the spec). Separately I looked at the spinner usages in SystemLink Enterprise, and the vast majority are also 16x16, so I'm keeping 16x16 the default size as it was previously. After discussion with the dev team, we decided to use design tokens to provide the designer-provided `small` `medium` and `large` sizes (instead of a `size` DOM attribute). Consumers can set the `height` to a token as outlined in the spinner Storybook docs/examples. ## 👩💻 Implementation - Add design tokens `spinnerSmallHeight` (16px), `spinnerMediumHeight` (32px), and `spinnerLargeHeight` (64px). 16px (small) is the default, so using that token is optional. - Add `aspect-ratio: 1 / 1` to the spinner styling, so consumers can just set height (instead of both width and height) - Update Storybook docs to cover the 3 sizes and explain how to set them, and some examples of where they should be used in a page - Update theme matrix story to have those 3 sizes ## 🧪 Testing - Autotests - Looked at updated stories ## ✅ Checklist - [x] I have updated the project documentation to reflect my changes or determined no changes are needed.
- Loading branch information
Showing
7 changed files
with
103 additions
and
13 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@ni-nimble-components-1996d396-34af-4f72-95dd-d141df4ad7e4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Add design tokens for additional spinner sizes, and update docs.", | ||
"packageName": "@ni/nimble-components", | ||
"email": "20709258+msmithNI@users.noreply.github.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters