Skip to content
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

ui: Update primary button with better 3d look #465

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

juliaogris
Copy link
Member

@juliaogris juliaogris commented Feb 11, 2025

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 achieve
good i.e. non-janky performance results for the animations using a simple
translateY on all of these elements rather than animating box-shadow and
border-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/

@juliaogris juliaogris changed the title wip ui: Update primary button with better 3d look Feb 11, 2025
@juliaogris juliaogris marked this pull request as ready for review February 11, 2025 05:27
@juliaogris juliaogris requested a review from camh- as a code owner February 11, 2025 05:27
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 achieve
good i.e. non-janky performance results for the animations using a simple
`translateY` on all of these elements rather than animating box-shadow and
border-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 <evy-button> 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.

Commit-Group: 1/3
Re-generate static HTML files on learn and docs subdomains from templates
updated in previous commit with:

        make learn docs

Commit-group: 2/3
Gen-command: make learn docs
Update end-to-end snapshot test golden files for new new 3d button look with:

	make snaps USE_DOCKER=1

Commit-group: 3/3
Gen-command: make snaps USE_DOCKER=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant