question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Tabs] Labels reduce their width based on the screen rather than container

See original GitHub issue

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)

localhost-4200-workspaces-idwks0

Notice the way tabs are displayed on the left :

image

When I open the app on my mobile : localhost-4200-workspaces-idwks0 nexus 5x

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 :

git clone https://gitlab.com/victornoel/petals-cockpit.git
git checkout ee685d5
cd petals-cockpit/frontend
yarn
ng serve

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
codegastudiocommented, Jun 15, 2017

@andrewseguin md-stretch-tabs not working to stretch tabs in desktop browser with 2.0.0 beta.6 😕

3reactions
andrewseguincommented, Jan 27, 2017

This is due to the CSS rule in tab-header.scss:

@media ($md-xsmall) {
  .md-tab-label {
    min-width: 72px;
  }
}

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Proper way of reducing width of Angular Material's Tab labels?
Fixed tabs display all tabs on one screen, with each tab at a fixed width. The width of each tab is determined by...
Read more >
C38: Using CSS width, max-width and flexbox to fit labels and ...
Define the width and max-width property for labels and inputs so they enlarge or shrink in the available space and respond to zoom...
Read more >
tab-size - CSS: Cascading Style Sheets - MDN Web Docs
The tab-size CSS property is used to customize the width of tab characters (U+0009).
Read more >
Tabs - Material Design
The width of the widest tab label. When using fixed tabs, ensure they can all be seen on mobile, without truncating their text....
Read more >
Adjust the column size to see everything - Microsoft Support
You can adjust column widths in Excel so that every cell is wide enough to display its information, and so that you don't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found