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
refactor ProgressRadial
to use pseudo-elements
#1356
Conversation
ProgressRadial
to use pseudo-elements
} | ||
&::after { | ||
mask-image: conic-gradient(#0000, #000), linear-gradient(#000 0 0); | ||
animation: rotate-indeterminate 0.8s linear infinite; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might want to use a custom cubic-bezier easing instead of linear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, because this is a gradient now, i'm not exactly sure how to handle forced-colors mode 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this slight ease-in-out cubic-bezier: https://cubic-bezier.com/#.6,.4,.4,.6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the easing
Screen.Recording.2023-06-16.at.9.15.39.AM.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (except force colors mode)
} | ||
&::after { | ||
mask-image: conic-gradient(#0000, #000), linear-gradient(#000 0 0); | ||
animation: rotate-indeterminate 0.8s linear infinite; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this slight ease-in-out cubic-bezier: https://cubic-bezier.com/#.6,.4,.4,.6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat change!
So 25% is stroke-dashoffset: 66; or stroke-dashoffset: calc(88 - 88 | ||
* 25 / 100); | ||
For determinate variants, percentage is set by | ||
<code>--iui-progress-percentage</code>. | ||
</p> | ||
<br /> | ||
|
||
<div id="radial-size-large"> | ||
<!-- Small determinate --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't necessarily relate to your changes, but this might be a good time to change the comments from "Small" to "Large" for all of the large determinate examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Changes
Instead of using an svg, the radial progress indicator will now use pseudo-elements with a combination of conic and linear gradients. Based on this example: https://css-tricks.com/single-element-loaders-the-spinner/#aa-more-loader-examples
--iui-progress-percentage
.Testing
Html preview: https://itwin.github.io/iTwinUI/1356/css/progress-indicator.html
Screen.Recording.2023-06-14.at.5.36.12.PM.mov
Storybook preview: https://itwin.github.io/iTwinUI/1356/react/?path=/story/progressindicators-progressradial--indeterminate
Screen.Recording.2023-06-14.at.5.03.33.PM.mov
Unit/visual tests updated.
Docs
Changeset added.
Briefly mentioned in migration guide: https://github.com/iTwin/iTwinUI/wiki/iTwinUI-react-v3-migration-guide#progressradial--progresslinear