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.

Cannot customize style of md-tabs

See original GitHub issue

Bug, feature request, or proposal:

Adding custom style to the tabs header

What is the expected behavior?

affect css style of header (font size, color, display…)

What is the current behavior?

Style is beeing totally ignored due to attribute selectors generated by the own element ignoring the styleUrls ones

What are the steps to reproduce?

Create a simple element (html):

<md-tab-group>
    <md-tab>
        <template md-tab-label>Personal info</template>
        <template md-tab-content>
            <h4>Name, address</h4>
            <div class="">
                Some data here
            </div>
        </template>
    </md-tab>

    <md-tab>
        <template md-tab-label>Payment</template>
        <template md-tab-content>

            <div class="">
                Payment setup
            </div>
        </template>
    </md-tab>
</md-tab-group>

Add this style in the .scss:

md-tab-group {
    .md-tab-header {
        font-size: 12px !important;
        display: flex;
        flex-flow: row wrap;
        align-items: center;
        .md-tab-label {
            flex: 1;
            min-width: 1px;
        }
    }
}

Plunk demo http://plnkr.co/edit/K1iVNV

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

Need to customize md tabs style/colors/responsive

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

Angular 2.0, Material alpha 8-2

Is there anything else we should know?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:27 (7 by maintainers)

github_iconTop GitHub Comments

17reactions
anderflashcommented, Sep 28, 2016

You need to use /deep/:

/deep/ md-tab-group {
...
9reactions
ivanntiscommented, Apr 20, 2017

I resolve my problem

/deep/ .mat-tab-label{ line-height: 28px !important; height: 28px !important;

} /deep/ .mat-tab-header { background-color: #0288D1; color: white; border-radius: 5px 5px 0px 0px; } /deep/ .mat-ink-bar { background-color: #d14b02 !important; min-width: 120px; }

result captura de pantalla 2017-04-20 a las 7 38 53 a m

Tankyou

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Cannot customize style of md-tabs - - Bountysource
Cannot customize style of md-tabs. ... Bug, feature request, or proposal: Adding custom style to the tabs header. What is the expected behavior?...
Read more >
md-tab styling (Angular 1.6). Is it even possible?
What I am trying to achieve is: use styles from material theme or colors from it (ng-colors); update background of active/inactive elements (as ......
Read more >
Kivy Mobile App #21 | Using Kivy MD Tabs to show Train Fares
We are going to use Kivy MD Tabs for different categories of user, such ... ... Your browser can't play this video.
Read more >
Tabs - KivyMD 1.1.1 documentation
Material Design spec, Tabs ... All tabs must be contained inside a MDTabs widget: Root: MDTabs: Tab: title: ... Declarative KV and imperative...
Read more >
@nativescript-community/ui-material-tabs - npm
Material Design Tabs organize content across different screens, ... TypeScript icon, indicating that this package has built-in type ...
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