Sweetalert2: Removal of style specific parameters

Created on 6 Jun 2016  路  3Comments  路  Source: sweetalert2/sweetalert2

Thoughts on removing the following paramters?

  • confirmButtonColor
  • cancelButtonColor
  • buttonsStyling
  • imageWidth
  • imageHeight
  • width
  • padding
  • background
    Also the appended media query for responsive sizing.

I feel all of these can be achieved more effectively and more flexibly via css and classes, and obviously converting these defaults to css in the provided css files so that it styles the same out of the box.

feature

Most helpful comment

No doubt for me, it's better and smarter to use classes instead of parameters. But programming skills of swal2 users are varied. Take a look on stackoverflow.com/questions/tagged/sweetalert, there're so many questions from absolute beginners :)

Let's leave these params for beginners. Experienced users always can stylize swal2 modal by using classes.

All 3 comments

No doubt for me, it's better and smarter to use classes instead of parameters. But programming skills of swal2 users are varied. Take a look on stackoverflow.com/questions/tagged/sweetalert, there're so many questions from absolute beginners :)

Let's leave these params for beginners. Experienced users always can stylize swal2 modal by using classes.

I know this is closed/old (and hopefully you catch this message), but should/could those be allowed to be set to null to not have inline styles? Using !important to override an inline style is so bad.

@nschubach If it doesn't already work like that, I think it's a reasonable idea for a change. Does it not work like that?

IMHO Ideally, in addition to being able to set these options to null, null would be the default for all of them, and what were previously the defaults would go into the sass files. Inline styles trump class styles (/w exception of !important styles) so it would be a non-breaking change.

Just my two cents, not sure anyone cares about this issue though.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eestein picture eestein  路  4Comments

WillGoldstein picture WillGoldstein  路  3Comments

snsarma picture snsarma  路  3Comments

Spidersouris picture Spidersouris  路  3Comments

Xosmond picture Xosmond  路  3Comments