-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
[Tabs] Labels reduce their width based on the screen rather than container #2829
Comments
This is due to the CSS rule in tab-header.scss:
We say that if the screen is small, then the labels should change their min-width from 160px to 72px. I would say that rather than looking at the screen width, we should look at the tab header width instead. For now to fix your issue, you can set your own custom CSS rule that always sets the min-width as 72px. We will consider how to modify this rule in the library so that it will use the tab header's width rather than the screen. |
@andrewseguin I have problems to set the labels width for a specific component. |
This is an issue with view encapsulation in Angular. The tab component dynamically adds in some of its own templating, and it won't be able to use your CSS defined in your component. To resolve this, you can either place your styles in a stylesheet outside of your Angular app (this is what I do in my apps), or you can turn off view encapsulation in your component containing the tabs (encapsulation: ViewEncapsulation.None). Both in my opinion are not ideal but it's what we have to work with right now |
Additionally, in your case you probably just want to use the md-stretch-tabs feature in tabs: http://plnkr.co/edit/DIjIoK8byvQdaVUsF0Sw?p=preview |
@andrewseguin can you explain what would need to be done to close this issue? The problem seems rather undefined / un-reproducible, are you opening a Pr to close this issue? |
@andrewseguin md-stretch-tabs not working to stretch tabs in desktop browser with 2.0.0 beta.6 :/ |
Temporary fix : .html
.scss
Related #5286 |
Closing this since I believe it's working as intended; the behavior falls into the category of "do something different on desktop/mobile" |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
Probably a bug (?)
What is the current behavior?
Here's my app in desktop mode : (sidenav has a fixed width : 320px)
Notice the way tabs are displayed on the left :
When I open the app on my mobile :
1 or 2 versions of material2 before, tabs where displaying the same way.
I didn't take the time to open this issue before.
What is the expected behavior?
I'd like to have smaller tabs on desktop mode
What are the steps to reproduce?
Here's the funniest part : I tried to reproduce with a Plunkr : http://plnkr.co/edit/aGPvdK8qUL1jEBWXxYn4?p=preview
It's working as expected and not like on my site.
Still, I'm opening this issue in case there's some edge case you may be aware of.
Feel free to close it as I couldn't reproduce.
I didn't apply custom css so I don't understand where this is coming from.
If you really want to repro my problem, you can launch those commands to setup my project and you'll be running the app in a minute :
Then go to http://localhost:4200/workspaces/idWks0
Which versions of Angular, Material, OS, browsers are affected?
Material 2.0.0-beta.1
Ubuntu 16.10
Chromium 55.0.2883.87
The text was updated successfully, but these errors were encountered: