sciactive / pnotify

Beautiful JavaScript notifications with Web Notifications support.
https://sciactive.com/pnotify/
Apache License 2.0
3.65k stars 514 forks source link

If notification has title only, the text is not vertically aligned #363

Closed ppazos closed 4 years ago

ppazos commented 4 years ago

I'm using notifications with title only, titles have a class that adds a margin-bottom, that makes the space below the text greater than the space above, making the text in the notification to appear not aligned vertically.

It would be better to add a margin-top to the contents of the notification when there are contents, instead of adding the margin bottom to the title.

Current:

incorrect

Expected:

correct

aasiph commented 4 years ago

Add custom css in your stylesheet

.customcss .ui-pnotify-title {
  margin-bottom: 0 !important;
}

Use addClass option to supply css class

PNotify.info({
      title: "Button Clicked",
      addClass: 'customcss',
    });
ppazos commented 4 years ago

@aasiph thanks, I think correct alignment would be handled by the library by default.

hperrin commented 4 years ago

This is fixed in v5 (yet to be released as of this comment).