-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Centered tabs #1992
Comments
On line 48 of https://github.com/angular/material/blob/master/src/components/tabs/tabs.scss, I have no time to try it right now, but I would like if you give me some feedback if you test it, thank you. |
I think you can "only" stretch them, see the doc. So maybe you can place them into another fixed-width container that is centered (think flexbox), so the tabs do not stretch on all the topnav's width, like in the example you are showing. |
OK I think I have it. See this codepen and please let me know. |
Should we keep this issue open and tagged as improvement? |
I'm not sure. We could contribute by making a md-centered-tabs attribute following the "wrapped-inside-centered-container" method in the codepen above and request a pull. But I think the md-stretch-tabs attribute already does the job. |
Maybe you could tagged the issue as improvement for the demos ? Many devs would like the centered tabs option displayed as an example. Can we fork the docs a make a pull request on the demos? |
I tried to write a simple md-centered-tabs directive, but it is not simple. I gave up. Your solution, @bonatoc, should be kept somewhere. She's very useful. |
Support for centered tabs is on my list, and I will be hopefully getting to this today. |
Awesome @robertmesserle. And again, thanks @bonatoc. |
Awesome @robertmesserle @remicastaing , you're welcome. I was on the same issue myself. |
both codepens don't work for me so can i use centered tabs? |
@super-coder — if you're super, please provide more info: version, specific problem? |
md-center-tabs="true" did the trick just like that FYI |
i submitted an issue #7695, tabs are hidden after reload on IE on XS screen |
@super-coder — Please provide IE version. |
@bonatoc what do you mean? you don't understand how code doesn't work in IE?? There is no IE version |
"There is no IE version" - I beg your pardon? |
Like tagged: "need more info". |
added more info there |
just for you to know this works wonders as well |
here's the working code |
replace ({lorem}} by the content of your choice of course |
Just add md-center-tabs="true" in md-tabs is OK, jonathanmeguira's code doesn't work because he spell mistake 'center'. |
my bad @TXZdream |
open angular.material.js and search for: material.components.tabs Source Code build* EXAMPLE: |
Is there a way to center tabs like in G+?
The text was updated successfully, but these errors were encountered: