Hide tab bar on scroll down
Feature request:
I want to be able to hide the tab bar when the user scrolls down and make it reappear when the user scrolls up. I want to add a class (or a set of styles) to MdTabHeader defined inside MdTabGroup of angular/material2 in response to an event through a service. How do I achieve that in a proper way without using things like /deep/, getElementsByTagName, etc?
What is the expected behaviour?
The expected behaviour is to have a way of changing CSS styles without using deprecated methods like /deep/ and hacking into the angular material.
What is the current behaviour?
Not able to add CSS styles like position = "fixed" unless I mark it as important and use /deep/. And I also want to add a class through a service which I am unable to do.
What is the use-case or motivation for changing an existing behaviour?
This behaviour is used in many modern sites.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
All
Do you just want to make the tabs a child of the scrollable element?
Closing this since I think this is in user-space.
@jelbourn No, I don't want to make the tabs scrollable. I want this functionality : https://jsfiddle.net/mariusc23/s6mLJ/31/
@ubarsaiyan I think your best bet is to add a class to your containing component and select the tab-header from that. Use global styles to then style the header. You won't need /deep/ or !important
https://plnkr.co/edit/ck1dYNFPzuEAp42j9quX?p=preview
@willshowell I did just that with setting ViewEncapsulation to none.
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.