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

Crossfade border-radius of "%" and "px" units #1416

Merged
merged 3 commits into from Jan 11, 2022
Merged

Conversation

mattgperry
Copy link
Collaborator

@mattgperry mattgperry commented Jan 11, 2022

Fixes #1413

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 11, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3b802f9:

Sandbox Source
Framer Motion: Simple animation Configuration
App Store UI using React and Framer Motion Configuration
Framer Motion: Reorder animation Configuration
Framer Motion: growing item positionTransition issue Configuration
Framer Motion: Image lightbox Configuration
solitary-night-9gmux Issue #1413

@mattgperry mattgperry requested a review from nvh January 11, 2022 13:16
@mattgperry mattgperry changed the title Crossfade % and px border-radius Crossfade border-radius of "%" and "px" units Jan 11, 2022
@@ -17,6 +17,7 @@ export function pixelsToPercent(pixels: number, axis: Axis): number {
export const correctBorderRadius: ScaleCorrectorDefinition = {
correct: (latest, node) => {
if (!node.target) return latest

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems unnecessary

const canMix =
followRadius === 0 ||
leadRadius === 0 ||
isPx(followRadius) === isPx(leadRadius)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused why we're not adding percent.test(leadRadius) === percent.test(followRadius) to this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the test case seems to be still passing...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is essentially testing if they're different

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if they're both false it's all good too

Copy link
Contributor

@nvh nvh Jan 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right! So in the purely hypothetical case that there would be a third string-based format, we would be fucked.
Let's add a comment about that then, because I think it's pretty confusing.

@mattgperry mattgperry added the automerge Land this PR label Jan 11, 2022
@mergetron mergetron bot merged commit bb5f872 into main Jan 11, 2022
@mergetron mergetron bot deleted the fix/corrected-borders branch January 11, 2022 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Land this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

must borderRadius be unitless for crossfade effect ?
2 participants