Skip to content

Commit

Permalink
refactor(theme): remove angular2-toaster styling (#721)
Browse files Browse the repository at this point in the history
BREAKING CHANGE:
angular2-toaster styles were removed from Nebular.
Instead, we suggest using our new `NbToastrService`.

To Update:
Add `NbToastrModule` into imports of your `app.module`.
Inject `NbToastrService` into the required component.
call `NbToastrService.show(...)` to render toasts.
For more information check [toastr documentation](https://akveo.github.io/nebular/docs/components/toastr).
  • Loading branch information
tibing-old-email authored and nnixaa committed Sep 19, 2018
1 parent 60a65cb commit 026974e
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 129 deletions.
23 changes: 1 addition & 22 deletions docs/articles/concept-3rd-party.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,11 @@
Currently Nebular Theme system is integrated with the following 3rd party modules:

- ng2-smart-table;
- angular2-toaster.

It means that we've created style overriding for these modules, so that you can change component's look & feel using Nebular theme variables.
For example, if you change the `color-primary` variable, components using this color will be changed accordingly.


Or that's how we described variables for the `angular2-toaster` module:

```scss
...
toaster-bg: color-primary,
toaster-fg-default: color-inverse,
toaster-btn-close-bg: transparent,
toaster-btn-close-fg: toaster-fg-default,
toaster-shadow: shadow,

toaster-fg: color-white,
toaster-success: color-success,
toaster-info: color-info,
toaster-warning: color-warning,
toaster-wait: color-primary,
toaster-error: color-danger,
...

```
<hr>
<hr>

## Related Articles

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*/

@mixin nb-toaster-theme() {
@mixin nb-toast-theme() {
nb-toast {
background-color: nb-theme(toastr-bg);
padding: nb-theme(toastr-padding);
Expand Down
2 changes: 1 addition & 1 deletion src/framework/theme/styles/global/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
@include nb-popover-theme();
@include nb-context-menu-theme();
@include nb-select-theme();
@include nb-toaster-theme();
@include nb-toast-theme();
@include nb-tooltip-theme();
@include nb-window-theme();
}
2 changes: 0 additions & 2 deletions src/framework/theme/styles/global/_overrides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@import 'normalize.scss';
@import 'components/tree.theme';
@import 'components/toaster.theme';
@import 'maps/leaflet.theme';
@import 'tables/smart-table.theme';

Expand All @@ -17,5 +16,4 @@
@include nb-components-tree-theme();
@include nb-maps-leaflet-theme();
@include nb-tables-smart-table-theme();
@include nb-components-toaster-theme();
}
90 changes: 0 additions & 90 deletions src/framework/theme/styles/global/components/_toaster.theme.scss

This file was deleted.

13 changes: 0 additions & 13 deletions src/framework/theme/styles/themes/_default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -302,19 +302,6 @@ $theme: (
smart-table-paging-bg-active: color-success,
smart-table-paging-hover: rgba(0, 0, 0, 0.05),

toaster-bg: color-primary,
toaster-fg-default: color-inverse,
toaster-btn-close-bg: transparent,
toaster-btn-close-fg: toaster-fg-default,
toaster-shadow: shadow,

toaster-fg: color-white,
toaster-success: color-success,
toaster-info: color-info,
toaster-warning: color-warning,
toaster-wait: color-primary,
toaster-error: color-danger,

toastr-bg: color-bg,
toastr-padding: 1.125rem,
toastr-fg: color-fg-text,
Expand Down

0 comments on commit 026974e

Please sign in to comment.