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

How to change the default anim to something less cartoonish #321

Closed
Johnrobmiller opened this issue Jul 27, 2023 · 1 comment
Closed

How to change the default anim to something less cartoonish #321

Johnrobmiller opened this issue Jul 27, 2023 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@Johnrobmiller
Copy link

Johnrobmiller commented Jul 27, 2023

The default animation is very cartoonish. Was this ever critiqued at by a designer? The docs don't mention how to change it. If it's not possible to modify the animation to make it less cartoonish, then this severely limits the usefulness of the library.

@vpodk
Copy link
Owner

vpodk commented Jul 28, 2023

I believe this "cartoonish" animation was definitely "critiqued" by the designers and then well documented on the Google Material Design website. As you can see in the index.css file, almost all sizing and animation properties have references to where these settings were taken from:

  /*
    * Exits and closing:
    * A navigation drawer opens over 250ms but closes over 200ms.
    * @see https://material.io/design/motion/speed.html#duration
    *
    * Accelerated easing:
    * Elements exiting a screen use accelerated easing, a transition in which 
    * the element starts at rest and ends at peak velocity.
    * @see https://material.io/design/motion/speed.html#easing
    *
    * Decelerated easing:
    * Incoming elements are animated using decelerated easing, in which 
    * transitions begin at peak velocity (the fastest point in an element's 
    * movement) and end at rest.
    * @see https://material.io/design/motion/speed.html#easing
    *
    * Scrim color opacity: 32% (1 - 0.32 = 0.68)
    * @see https://material.io/components/navigation-drawer#theming
    */

Answering to your question how to change the default animation, use plain css with the same class names and css selectors, just like you would change other third party components in your application. In this particular case, you need to override the following property:

.HamburgerDrawer .HamburgerDrawer-panel {
  transition: transform 200ms cubic-bezier(0.4, 0, 1, 1), visibility 1s linear;
}

Hope this helps.

@vpodk vpodk self-assigned this Jul 28, 2023
@vpodk vpodk added the question Further information is requested label Jul 28, 2023
@vpodk vpodk closed this as completed Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants