Code Monkey home page Code Monkey logo

Comments (16)

JustFly1984 avatar JustFly1984 commented on May 18, 2024 5

I have CSS modules in my project, and just copied all CSS from the module and added :global prefix to each one. I do not have animations nor autoClose working.

from react-toastify.

fkhadra avatar fkhadra commented on May 18, 2024

@emadow I don't have the issue at all. I'm also using chrome and safari latest version. Do you see any things when you open the developer tools ?

from react-toastify.

emadow avatar emadow commented on May 18, 2024

@fkhadra no errors in the console. Very puzzling.

from react-toastify.

emadow avatar emadow commented on May 18, 2024

Ack. Seems to be the result of how webpack was dealing with my imports -- the css @keyframes were not accessible globally.

from react-toastify.

fkhadra avatar fkhadra commented on May 18, 2024

Ow I'm glad you fixed it.

from react-toastify.

ilovebeatles avatar ilovebeatles commented on May 18, 2024

@emadow Can you please share your fix? I've stuck with this too.

from react-toastify.

MaxiSantos avatar MaxiSantos commented on May 18, 2024

I'm also having this issue

from react-toastify.

fernandolobao avatar fernandolobao commented on May 18, 2024

I have the same problem as @JustFly1984 , autoclose and animation are not working because I had to put the css rules under :global approach. Does someones have a fiz already?

from react-toastify.

LudovicF42 avatar LudovicF42 commented on May 18, 2024

Same problem for me, +1

from react-toastify.

fkhadra avatar fkhadra commented on May 18, 2024

Hello,

It would be nice to reproduce the bug via codesandbox. Anyone know how to do this ?

from react-toastify.

LudovicF42 avatar LudovicF42 commented on May 18, 2024

I could, but is it possible to update webpack configuration with codesandbox ?

from react-toastify.

LudovicF42 avatar LudovicF42 commented on May 18, 2024

Here the code : https://codesandbox.io/s/z252xzmvrl

CSS for toasts does not work on codesandbox because the webpack.config.js is not used (so the modules are not activated by default for css-loader). I don't know if it is possible to configure webpack on codesandbox...

In my project on my PC, the CSS of the toast box works well, but not the autoclose or animations.
If I remove modules option in css-loader and import globally like in your documentation, autoclose and animations work.

from react-toastify.

JustFly1984 avatar JustFly1984 commented on May 18, 2024

from react-toastify.

vijilvpillai avatar vijilvpillai commented on May 18, 2024

Me too facing the same issue. Does anyone know how to fix this webpack issue . The progressbar and auto close is not working

from react-toastify.

chiragbhansali avatar chiragbhansali commented on May 18, 2024

I was using Next.js with CSS Modules and faced a similar issue. I solved it by tweaking the CSS file as follows:

Initial:

@keyframes Toastify__slideInUp {
  from {
    transform: translate3d(0, 110%, 0);
    visibility: visible;
  }

  to {
    transform: translate3d(0, 0, 0);
  }
}

Final (wrapping the animation name with :global()):

@keyframes :global(Toastify__slideInUp) {
  from {
    transform: translate3d(0, 110%, 0);
    visibility: visible;
  }

  to {
    transform: translate3d(0, 0, 0);
  }
}

Source: css-modules#115

I had to manually add :global to all the keyframes, apart from a common :global for the other classes. I have made the edited stylesheet with all the :global's added in this gist so that you don't have to go through the same pain ๐Ÿ˜…

from react-toastify.

chiragbhansali avatar chiragbhansali commented on May 18, 2024

@fkhadra Can you please add this to the documentation? It might be helpful for people using CSS Modules.

from react-toastify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.