Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change growl default style classes (Issue #101) #121

Closed
wants to merge 11 commits into from

Conversation

flaviocysne
Copy link

@flaviocysne flaviocysne commented Nov 1, 2016

Motivated by the Issue #101, I implemented some basic changes to angular-growl-2 to allow users to define another set of style classes for all growl tags and also for a specific growl.

Global config object should use the format below (samples are using FontAwesome styles just to relate to the issue, but could be used any style class names from any similar icon library):

config: {
...
styleClasses: {
    success: 'fa fa-check-circle',
    info: 'fa fa-info-circle',
    warning: 'fa fa-exclamation-circle',
    error: 'fa fa-times-circle',
    danger: 'fa fa-times-circle'}
...
}

All styleClasses attributes are optional and if not defined will fallback to the actual default value.
If a user want to suppress an icon an empty string should be passed as the attribute value for the specific severity.

A specific growl tag could use custom style classes adding some attributes to it, like this:

<growl ... success-class="fa fa-check" info-class="fa fa-info" warning-class="fa fa-exclamation" error-class="fa fa-times" danger-class="fa fa-times">...</growl>

I'll provide a Plunker with samples for these situations.

Hope it will help.

Update my fork with latest commits
Custom directive properties to change message style classes.

This commit maybe will solve Issue JanStevens#101.
Allow custom style classes related to severities to be defined globally.
Made style class available globally
Use custom style class or global
Allow changing growl default style classes globally (Issue JanStevens#101)
@flaviocysne
Copy link
Author

I'm still trying to create a sample in Plunker to demonstrate the changes.
It's not working as expected at the moment.

Maybe I'll have to change the angular-growl's CSS and the default template in growlDirective.js.
Both icon libraries, Bootstrap and Font-Awesome, use an HTML span to include icons in alert messages.

Allow customization of overall growl message style and which icon to use for each severity.
- styleClasses: defines the overall style of growl messages for each severity.
- iconClasses: defines the icons for each severity.
Allow customization of overall growl message style and which icon to use for each severity.
- severityNames: severity names that will be styled.
- styleClasses: defines the overall style of growl messages for each severity.
- iconClasses: defines the icons for each severity.
Objective: allow any severity names (different of "success", "info", "warning", "error"), sent from server or customized by the user, to be styled by the component.
- severity names customization
- default severity customization
Allow custom severity names
@flaviocysne
Copy link
Author

I'll postpone this pull request until I have some reasonable/stable code to commit and samples to demonstrate the new features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant