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

feat: css unit handling for fly transition #6050

Closed
wants to merge 1 commit into from

Conversation

simondehaut
Copy link

It would be great to be able to give CSS unit parameter to transition fly function.

'fly' is the best candidate. It defines an absolute/arbitrary transformation while the others define rather a transformation relative to an existing div's style.

Units are quiet often left behind in a lot of js library, 'px' is not the only one :)

use: <div transition:fly={{ y: 1, unit: 'em' }}></div>

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with npm test and lint the project with npm run lint

It would be great to be able to give CSS unit parameter to **transition fly** function. 

**fly** is the best candidate. It defines an absolute/arbitrary transformation while the others define rather a transformation relative to an existing div's style.

Units are quiet often left behind in a lot of js library, 'px' is not the only one :)

use: `<div transition:fly={{ x: 1, unit: 'em' }}></div>`
@techniq
Copy link

techniq commented May 25, 2021

This is useful to perform 100% transitions (ex. hiding a drawer).

Instead of passing a unit option, x and y could support passing a string (ex. 100%, 1em, etc) to include the units, and then parsed it via some regex (this is the approach of my drawer repl). This also allows x and y to define different units.

@pngwn pngwn added runtime Changes relating to runtime APIs and removed feature: transitions labels Jun 27, 2021
@whatwhywhenandwho
Copy link

This seems to be ok. Can someone restart the checks, so we can get this out? 😬

@whatwhywhenandwho
Copy link

In all seriousness, I can't think of another way to close this, than to just keep on pinging, and perhaps someone seeing it in their inbox. So, again, this seems to be ok. Can someone restart the checks, so we can get this out? 🙂

@benmccann benmccann changed the title Add css unit handling to fly transition feat: css unit handling for fly transition Mar 14, 2023
@dummdidumm
Copy link
Member

Closing in favor of #7623 - thank you!

@dummdidumm dummdidumm closed this Mar 15, 2023
dummdidumm added a commit that referenced this pull request Mar 15, 2023
Closes #6050

---------

Co-authored-by: Bob Fanger <b.fanger@wearetriple.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runtime Changes relating to runtime APIs transition/animation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants