Giter VIP home page Giter VIP logo

Comments (3)

schiehll avatar schiehll commented on June 15, 2024

Hi @Tzaphkiel ,

The reason why the classes names are like that it's because we are using glamourous under the hood. It generates the className for us, so our classes won't mess up with your project's own classes or with any other dependency you may be using.

Also, this lib is not really designed to be that flexible, that's why we have the dark and light themes, the idea was to it be a drop-in-ready-to-use-already-looks-beautiful alert.

But if all you want is to change the style of the message (not the alert itself) you can do so. All you have to do is to pass a react component as the message like this:

this.msg.success(<div className="your-class">The Message</div>)

Is that what you are trying to do? Or you have another use case?

Oh, and the demo is still using the v1 of the lib, that's why it's using the old classes, sorry if that's confusing, I didn't have the time to change the demo and the appearance would be identical, so I didn't think it would matter.

from react-alert.

Tzaphkiel avatar Tzaphkiel commented on June 15, 2024

Hi @schiehll ,

Thank you for the clarification. I thought indeed that it had to do with the Glamor used.
Btw, I was still using "react-alert": "1.0.14" in the previous application...

My idea was to tailor the size of the text in the notification content. I actually wanted a (more) discreet notification that could potentially thus be ignored or not impact too much the user when manipulating the interface, especially when it is an info and not a warning or an error.

Your solution works and is good enough for the moment, but I still find the buttons, etc. a bit big:
image

If you ever have the time, inclination or are looking for a challenge ;-) perhaps you could consider allowing the addition of an extra class at multiple level to tweak the defaults or some similar solution?

from react-alert.

schiehll avatar schiehll commented on June 15, 2024

Nice! Glad it did help!

But yeah, that's something that could be really useful for some use cases, I may add it in the future if I have the time.

from react-alert.

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.