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

stepper dependency on material icons #7384

Closed
janisp opened this issue Sep 28, 2017 · 19 comments · Fixed by #7482
Closed

stepper dependency on material icons #7384

janisp opened this issue Sep 28, 2017 · 19 comments · Fixed by #7482
Assignees
Labels
P2 The issue is important to a large percentage of users, with a workaround

Comments

@janisp
Copy link

janisp commented Sep 28, 2017

Bug, feature request, or proposal:

bug

What is the expected behavior?

Texts are not printed on the screen instead of the icons if the icon set is not present.

Brownie points:
I can set up another icons from another icon sets (e.g. FontAwesome)

What is the current behavior?

stepper component has the dependency on material icons. If material icons are not used, it's rendered as text on the screen.

image

What are the steps to reproduce?

Index.html line 24 adds the necessary icons. If that line is commented out, icons will faill and text is printed on screen instead of icon.
Plunker template: https://plnkr.co/edit/n4ry3CkDsvV22aX4h5lo?p=preview

What is the use-case or motivation for changing an existing behavior?

I want to use FontAwesome icons (and I don't want to bundle the Material icons just for this one component)

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Material 2.0.0-beta.11
Angular 4.4.3

Is there anything else we should know?

Thanks for the Stepper component!

@jlkeiper
Copy link

I would be okay with a svgIcon input, or a way to inject a template to be used in place of the icon.

@josephperrott josephperrott added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent help wanted The team would appreciate a PR from the community to address this issue labels Sep 28, 2017
@jelbourn jelbourn added P2 The issue is important to a large percentage of users, with a workaround and removed help wanted The team would appreciate a PR from the community to address this issue P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Sep 28, 2017
@crisbeto crisbeto self-assigned this Oct 2, 2017
@crisbeto crisbeto added the has pr label Oct 2, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 2, 2017
Currently users are locked into using the Material `create` and `done` icon for the step headers. These changes add the ability to customize the icons by providing an `ng-template` with an override.

Fixes angular#7384.
crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 3, 2017
Currently users are locked into using the Material `create` and `done` icon for the step headers. These changes add the ability to customize the icons by providing an `ng-template` with an override.

Fixes angular#7384.
@sam-lex
Copy link

sam-lex commented Oct 9, 2017

or an option to keep the numbers (no icon change).

@josehernandezv
Copy link

Any news on this?

@dfront
Copy link

dfront commented Oct 24, 2017

you can set [completed]="false" on md-step and you will have only numbers instead of icons!!

@josehernandezv
Copy link

But that would make every step look like incompleted (with the gray color), even the ones already completed.

@sam-lex
Copy link

sam-lex commented Oct 28, 2017

I was a bit reluctant on trying [completed]="false" suggested by @dfront, after reading that it would make it look like uncompleted. But it's actually not that bad 😅

of course, it would've been better if it could be colored, since I'm using linear mode.

screen shot 2017-10-28 at 10 06 49 am

@xaviervansteene
Copy link

xaviervansteene commented Nov 3, 2017

to replace the word "create" with the pen icon you need to add the google material font icon link <link href="https://fonts.googleapis.com/icon?family=Material+Icons"rel="stylesheet">

crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 13, 2017
Currently users are locked into using the Material `create` and `done` icon for the step headers. These changes add the ability to customize the icons by providing an `ng-template` with an override.

Fixes angular#7384.
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 13, 2017
Currently users are locked into using the Material `create` and `done` icon for the step headers. These changes add the ability to customize the icons by providing an `ng-template` with an override.

Fixes angular#7384.
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 19, 2017
Currently users are locked into using the Material `create` and `done` icon for the step headers. These changes add the ability to customize the icons by providing an `ng-template` with an override.

Fixes angular#7384.
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 20, 2017
Currently users are locked into using the Material `create` and `done` icon for the step headers. These changes add the ability to customize the icons by providing an `ng-template` with an override.

Fixes angular#7384.
@ssgriffen
Copy link

Would someone mind please posting an example of overriding the create icon that shows for an editable step on the material 2 stepper. I've been struggling for hours trying to follow the docs and can't make it work so far @crisbeto

@cfremgen
Copy link

@ssgriffen

Here's .scss version:

::ng-deep mat-step-header {
    &:nth-of-type(2) {
        .mat-step-icon {
            * {
                display: none;
            }

            &:after {
                content: "1";
            }
        }
    }
}

@ssgriffen
Copy link

@cfremgen I appreciate the example. However I am looking to only override the 'edit' icon when the step is in the edit state. The docs show a way to do this somwthing like this below

 <mat-horizontal-stepper>
 +      <ng-template matStepperIcon="edit">Custom edit</ng-template>
 +      <ng-template matStepperIcon="done">Custom done</ng-template>
 +
 +      <mat-step>Content 1</mat-step>
 +      <mat-step>Content 2</mat-step>
 +      <mat-step>Content 3</mat-step>
 +    </mat-horizontal-stepper>

but I haven't had success in implementing yet... @cfremgen @crisbeto

@cfremgen
Copy link

cfremgen commented Dec 22, 2017

I believe this is the commit you'll need crisbeto@8cc1aff

But it's not in release yet.

Better off waiting until this is in release, but if you need to you should be able to use my example as a starting point and only override if edit styles are applied. I am not sure though, I haven't encountered the exact scenario you're talking about.

@ssgriffen
Copy link

@cfremgen okay, thank you, I didn't notice it wasnt released yet

@sevdashubham
Copy link

any update on this?

crisbeto added a commit to crisbeto/material2 that referenced this issue Jan 14, 2018
Currently users are locked into using the Material `create` and `done` icon for the step headers. These changes add the ability to customize the icons by providing an `ng-template` with an override.

Fixes angular#7384.
tinayuangao pushed a commit that referenced this issue Jan 30, 2018
Currently users are locked into using the Material `create` and `done` icon for the step headers. These changes add the ability to customize the icons by providing an `ng-template` with an override.

Fixes #7384.
@invingagan1
Copy link

is any one has example to use svg-icon in mat-icon for stepper.

@fableplay13
Copy link

fableplay13 commented Nov 6, 2018

with this I overwrite the material font:

button,select,html,textarea,input,md-bottom-sheet .md-subheader,.md-chips { font-family: Roboto, "Helvetica Neue", sans-serif; } *:not(.material-icons):not(.fa):not(b):not(strong) { font-family: $fontstandard !important; }

with this I overwrite the contents of the icons with the font custom:

::ng-deep mat-step-header { &:nth-of-type(1) { counter-reset: step-counter; } position: relative; .mat-step-icon { * { display: none; } &:after { content: counter(step-counter); counter-increment: step-counter; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } } }

this works for my case also on IE11

@anandbabud1987
Copy link

you can set [completed]="false" on md-step and you will have only numbers instead of icons!!

this worked like charm

@Rouhollah
Copy link

probably you use another font-family instead default.
you can solve this issue with fix 'Material Icon' for font-family in pages that use stepper.

:host /deep/ .material-icons {
  font-family: 'Material Icons' !important;
}

@vksingh225
Copy link

vksingh225 commented Jul 23, 2019

to replace the word "create" with the pen icon you need to add the google material font icon link <link href="https://fonts.googleapis.com/icon?family=Material+Icons"rel="stylesheet">

I think this is the best solution to utilize. Bcoz setting completed = "false" doesn't gives a nice UX.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.