sotsera / sotsera.blazor.toaster

A Toastr.js port to Blazor in pure .Net.
https://blazor-toaster.sotsera.com/
MIT License
130 stars 29 forks source link

Is there a way to add text-alignment as a configuration item #32

Closed bholland314 closed 4 years ago

bholland314 commented 4 years ago

For example: Instead of having to modify the CSS .toast-title { font-weight: bold; text-align: center; } .toast-message { -ms-word-wrap: break-word; word-wrap: break-word; text-align: center; } Maybe something like services.AddToaster(config => { config.TextAlignment = Defaults.Classes.TextAlignment.Center

Thanks

ghidello commented 4 years ago

Yes, we can add some classes for the text alignment and maybe a couple configuration properties so the title and message can be placed independently. Good suggestion, thanks!

ghidello commented 4 years ago

I just pushed a new version to the dev branch that adds a couple of properties for configuring the title and message classes so the text position can now be changed using, for example, some bootstrap classes like

config.ToastTitleClass = "toast-title text-center";
config.ToastMessageClass = "toast-message text-right";

Can you test it out and see if this may be a solution?

bholland314 commented 4 years ago

Tested and works as expected. Do you mind if I add options in the sample projects? Thanks,

ghidello commented 4 years ago

Sure, please go ahead any help is ver much appreciated! Thanks

bholland314 commented 4 years ago

Replied to the wrong thread. Ok, I will make a new branch and PR it prob today.

I also figured out how to do HTML in the Title and Message. It's built into Toastr. I will create another branch and PR to add the escapeHtml option.

On Sat, Dec 21, 2019 at 9:21 AM Alessandro Ghidini notifications@github.com wrote:

Sure, please go ahead any help is ver much appreciated! Thanks

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sotsera/sotsera.blazor.toaster/issues/32?email_source=notifications&email_token=AAYBMMLVNHOOZTCYYUDZ3TDQZYQ6NA5CNFSM4J4AI6T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHO45GI#issuecomment-568184473, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYBMMLYO42PL4O3IOOKVXLQZYQ6NANCNFSM4J4AI6TQ .

bholland314 commented 4 years ago

Can you add me as a collaborator? bholland314

Thanks, Brian

On Mon, Dec 23, 2019 at 9:08 AM Brian Holland bholland1@gmail.com wrote:

Replied to the wrong thread. Ok, I will make a new branch and PR it prob today.

I also figured out how to do HTML in the Title and Message. It's built into Toastr. I will create another branch and PR to add the escapeHtml option.

On Sat, Dec 21, 2019 at 9:21 AM Alessandro Ghidini < notifications@github.com> wrote:

Sure, please go ahead any help is ver much appreciated! Thanks

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sotsera/sotsera.blazor.toaster/issues/32?email_source=notifications&email_token=AAYBMMLVNHOOZTCYYUDZ3TDQZYQ6NA5CNFSM4J4AI6T2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHO45GI#issuecomment-568184473, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYBMMLYO42PL4O3IOOKVXLQZYQ6NANCNFSM4J4AI6TQ .