-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
feat(toast): add icon property to show icon at start of toast content #23596
Conversation
Maybe better to use |
You can already use custom icons with the For example in Angular. You can automatically copy your custom icons with the build. angular.json
{
"glob": "**/*.svg",
"input": "src/assets/custom-icons",
"output": "./svg"
} Place e.g. an icon like <ion-icon name="custom-my-icon"></ion-icon> We could replace We probably should also complete the |
As far as i understand the |
Ok I replaced the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! I have included comments regarding changes which are required in order for this feature to get merged.
Additionally, can you please add some usage examples in the usage
directory? You will need to update the angular.md
, javascript.md
, react.md
, stencil.md
, and vue.md
files, run npm run build
, and then push that result.
I think we can add the icon example inside of the existing presentToastWithOptions
function in these usage files.
core/src/components/toast/toast.scss
Outdated
/* stylelint-disable property-blacklist */ | ||
margin-left: 15px; | ||
|
||
padding: 10px; | ||
/* stylelint-enable property-blacklist */ | ||
|
||
font-size: 1.4em; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* stylelint-disable property-blacklist */ | |
margin-left: 15px; | |
padding: 10px; | |
/* stylelint-enable property-blacklist */ | |
font-size: 1.4em; | |
@include margin(0, 0, 0, 15px); | |
@include padding(10px, 10px, 10px, 10px); |
We need to include the mixins here to account for RTL mode. Currently, the styles are not consistent between LTR and RTL modes, but the mixins will handle this switch for us.
Also, no need to add the font size here as it should apply in the same block as .toast-button-icon
(see my other comment)
Ok, change requests pushed... I just wonder:
Nothing important. I'm just wondering. |
Sorry I had two different PRs open and was referencing the wrong one 🤦 . Ignore the The Since the |
Ok, please let me know if there are any pending change requests. All change requests were implemented. Or did I miss something? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a small docs change from me to reflect the switch from name
to icon
.
Co-authored-by: William Martin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! We are good to merge when the tests finish.
Merged. Thank you! |
Pull request checklist
fixes #23524
Please check if your PR fulfills the following requirements:
npm run build
) was run locally and any changes were pushednpm run lint
) has passed locally and any fixes were made for failuresPull request type
Please check the type of change your PR introduces:
What is the current behavior?
The toast does not allow to display an icon.
What is the new behavior?
You can now optionally specify an icon to show with the toast message.
md
ios
Does this introduce a breaking change?
Other information
I added linter ignore blacklist property comment to allow
padding
andmargin-left
. Feel free to change it. I don't know what you prefer.Should be available in Ionic 5.x