Comments (3)
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.
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:
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.
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)
- Missing Alert warning type support HOT 1
- Custom options in `alert.show()` HOT 4
- peerDependencies HOT 4
- Update the demo HOT 1
- TypeScript HOT 4
- change the black background HOT 1
- Close HOT 2
- Custom alert type with typescript HOT 1
- Add New Transitions like slide from left / right
- Many contexts in one component HOT 1
- Test cases getting failed on using useAlert() HOT 3
- Showing Below the Model HOT 1
- How do I trigger an alert as a function? HOT 1
- Show alert in react dom tree HOT 1
- TypeError: Cannot read properties of undefined (reading 'current') HOT 7
- Onclose callback doesnt run if I manually close the alert dialoge.
- Feature request
- how to change default black theme?
- No compatibility with new react 18 HOT 4
- error while installing without --legacy-peer-deps
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-alert.