From e5e02d4f88abbcc7dbc626db6d5adf4292d8e776 Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Mon, 30 Mar 2020 12:02:46 -0400 Subject: [PATCH] feat(toast): add white-space variable for toast message (#20729) fixes #20727 --- core/api.txt | 1 + core/src/components/toast/readme.md | 1 + core/src/components/toast/toast.scss | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/api.txt b/core/api.txt index bca44fa484..459ff4de8e 100644 --- a/core/api.txt +++ b/core/api.txt @@ -1237,6 +1237,7 @@ ion-toast,css-prop,--max-width ion-toast,css-prop,--min-height ion-toast,css-prop,--min-width ion-toast,css-prop,--start +ion-toast,css-prop,--white-space ion-toast,css-prop,--width ion-toggle,shadow diff --git a/core/src/components/toast/readme.md b/core/src/components/toast/readme.md index 00ddd20094..4a697a1d78 100644 --- a/core/src/components/toast/readme.md +++ b/core/src/components/toast/readme.md @@ -250,6 +250,7 @@ Type: `Promise` | `--min-height` | Minimum height of the toast | | `--min-width` | Minimum width of the toast | | `--start` | Position from the left if direction is left-to-right, and from the right if direction is right-to-left | +| `--white-space` | White space of the toast message | | `--width` | Width of the toast | diff --git a/core/src/components/toast/toast.scss b/core/src/components/toast/toast.scss index 7007839369..5158e8e0ba 100644 --- a/core/src/components/toast/toast.scss +++ b/core/src/components/toast/toast.scss @@ -13,6 +13,8 @@ * @prop --border-width: Border width of the toast * @prop --border-style: Border style of the toast * + * @prop --white-space: White space of the toast message + * * @prop --box-shadow: Box shadow of the toast * * @prop --min-width: Minimum width of the toast @@ -37,6 +39,7 @@ --min-height: auto; --height: auto; --max-height: auto; + --white-space: pre-wrap; @include position(0, null, null, 0); @@ -119,7 +122,7 @@ .toast-message { flex: 1; - white-space: pre-wrap; + white-space: var(--white-space); } .toast-button-group {