ui: Update primary button with better 3d look #465
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update primary button with better 3d look and animation, according to Josh
Comeau post.
Demonstrate pushable button in the standalone frontend/css/pushable.html.
Josh uses separate
<spans>
for button front (top), edge and shadow to achievegood i.e. non-janky performance results for the animations using a simple
translateY
on all of these elements rather than animating box-shadow andborder-width. I didn't question this too much and followed his instructions
slightly tweaking things to get them closer to the Evy look. This makes for
slightly more awkward HTML unfortunately though. Maybe once I work out how
web-components work I can fold all of this into an or so.
This rework was also tricky because Evy's HTML/CSS is reused in many places -
the learn, docs, labs subdomains. There is a pretty good chance I've missed
things, but I have checked the snapshot updates in a follow-up commit carefully
and grepped for "primary" as the new pushable button style replaces the primary
button style.
This PR is broken up into 3-part commit-group, with the last 2 commits regenerating
snapshots and static HTML from templates.
For a review of this PR it might be good to click around the PR deployment and see if
things look and behave still ok.
See https://www.joshwcomeau.com/animation/3d-button/