Giter VIP home page Giter VIP logo

Comments (9)

davidhu2000 avatar davidhu2000 commented on June 15, 2024 4

You can also use css only.

Here is my code

<div className='alerts-container'>
  <AlertContainer ref={a => { this.msg = a; }} {...this.options} />
</div>
.alerts-container {
  > div[class^='css-'] > span > div[class^='css-'] {
    // entire alert styles here.

    div {

      // alert icon
      &:first-child {
      }
    
      // alert message div
      &:nth-child(2) {
      }

      // alert close div
      &:last-child {
      }
    }
  }
}

from react-alert.

schiehll avatar schiehll commented on June 15, 2024 1

with v3 you can now create custom alert templates, hope it helps!

from react-alert.

dennybiasiolli avatar dennybiasiolli commented on June 15, 2024

Hi @ok713, you can refer to #20:

You can use a React Element as a message, so to add a text-transform you could do something like this:
this.msg.success(<div style={{textTransform: 'capitalize'}}>TEXT WILL BE CAPITALIZED</div>)

Hope this helps!

from react-alert.

dennybiasiolli avatar dennybiasiolli commented on June 15, 2024

@ok713 did you solved your issue?

from react-alert.

plysik avatar plysik commented on June 15, 2024

It will be really handy if single alert container could have class depending on type. I'll ease stylying. Also each element (icon, content and close-btn) could have separated class.

from react-alert.

neilyoung avatar neilyoung commented on June 15, 2024

@davidhu2000 What kind of CSS syntax is this? VSCode is not accepting it

EDIT: And neither does CSSLint http://csslint.net/

from react-alert.

davidhu2000 avatar davidhu2000 commented on June 15, 2024

@neilyoung might be scss

from react-alert.

neilyoung avatar neilyoung commented on June 15, 2024

@davidhu2000 Thanks for enlighten me :)
EDIT: And it works

from react-alert.

plysik avatar plysik commented on June 15, 2024

Finally :) , but a little late. We had to migrate to another alerts package.
However this give us an oportunity to go back to use yours :)

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.