adopted-ember-addons / ember-cli-flash

Simple, highly configurable flash messages for ember-cli
https://www.npmjs.com/package/ember-cli-flash
MIT License
355 stars 113 forks source link

feat: added messageStylePrefix variable #335

Closed Techn1x closed 3 years ago

Techn1x commented 3 years ago

Enable the ability to not use the generic bootstrap or foundation class names, by adding flashTypePrefixmessageStylePrefix which provides a way for the user to specify the flash type class name prefix.

Backwards compatibility is maintained with messageStyle, but if flashTypePrefixmessageStylePrefix is set it will take priority.

{{#each flashMessages.queue as |flash|}}
  <FlashMessage @flash={{this.flash}} @messageStylePrefix="special-alert-" />
{{/each}}

would produce an element like

<div class="flash-message special-alert-success" > ... </div>

Rationale

I've been running a custom flash-message component for this addon for a while now, because;

I noticed that with v2.0.0 the component has been updated to be tagless, render modifiers etc so I thought I would contribute some of my workings back to the project, with the aim of being able to use the component in this addon again!

Techn1x commented 3 years ago

btw! I am participating in hacktoberfest this year so I would much appreciate it if this pull request could have the hacktoberfest-accepted label added to it, or if the repo could have hacktoberfest label/topic :100:

Techn1x commented 3 years ago

Any interest in merging this @sbatson5 ? It's a requirement for me to not need to use a custom flash component

Techn1x commented 3 years ago

Thanks @sbatson5 those are all great suggestions, implemented them all

EDIT: except for the dev warning