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

Icons on md-tab-link and md-tab is not aligned #5728

Closed
sondreb opened this issue Jul 13, 2017 · 6 comments
Closed

Icons on md-tab-link and md-tab is not aligned #5728

sondreb opened this issue Jul 13, 2017 · 6 comments
Assignees

Comments

@sondreb
Copy link

sondreb commented Jul 13, 2017

Bug, feature request, or proposal:

Icons are not aligned when used together with md-tab-nav-bar and md-tab-link.

What is the expected behavior?

Expecting to see the icon aligned middle with the text.

What is the current behavior?

Icons is aligned too high.

What are the steps to reproduce?

Source:

<nav md-tab-nav-bar>
	<a md-tab-link>TEST</a>
	<a md-tab-link><md-icon>cloud</md-icon> TEST</a>
</nav>

Screenshot:
image

Source for inline tab:

<md-tab-group>
	<md-tab>
		<ng-template md-tab-label>
			<md-icon>cloud</md-icon> TEST
		</ng-template>
		<h1>Some tab content</h1>
	</md-tab>
	<md-tab label="TEST">
		<h1>Some more tab content</h1>
	</md-tab>
</md-tab-group>

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

Shouldn't need to write custom CSS to use icons on tabs or navigation.

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

Angular 4.2.5, Material beta 8, TypeScript 2.3.2, tested in Chrome.

@sondreb
Copy link
Author

sondreb commented Jul 13, 2017

Workaround:

.tab-icon {
	vertical-align: middle;
}

<md-icon class="tab-icon">date_range</md-icon> select a date</a>

Screenshot:

image

@crisbeto crisbeto self-assigned this Jul 14, 2017
@Robouste
Copy link

Robouste commented Jul 28, 2017

I think vertical-align: middle; is not good enough

image

Now, the icon is too low

@crisbeto
Copy link
Member

Should be fixed in master. Closing since it looks like I forgot to label #5771 properly.

@Robouste
Copy link

Robouste commented Jul 28, 2017

In wait for the fix, adding font-size: 20px; to vertical-align make it looks good

image

@brandon1525
Copy link

brandon1525 commented Sep 7, 2017

.tab-icon {
  vertical-align: middle;
}
.tab-text {
        margin-left: 5px;
        vertical-align: middle;
}

<nav md-tab-nav-bar>
  <div class="icon-text-inline" md-tab-link>
    <md-icon class="tab-icon">{{link.icon}}</md-icon>
    <span class="tab-text">{{link.title}}</span>
  </div>
</nav>

@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants