t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.38k stars 2.84k forks source link

Alert with only an icon and title is missing bottom spacing #999

Open brentvollebregt opened 1 year ago

brentvollebregt commented 1 year ago

The issue

When creating an alert with only a title and icon, the spacing at the bottom that is usually provided when using buttons or text is not rendered.

For example, doing the following,

swal({
  title: "Example Title",
  icon: "error",
  buttons: false
});

will render,

image

Expectation

I would expect that there is spacing similar to when text is provided:

image

Possible Solution

One solution I see is to apply the bottom spacing like the margin for text is added, something like:

.swal-title:last-child {
  margin-bottom: 45px;
}

This would then give,

image