Reputation: 5366
I am using angular2-mdl (http://mseemann.io/angular2-mdl/) for styling in my angular cli project. I have added default css in my index.html as
<link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.indigo-pink.min.css" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Pacifico" rel="stylesheet">
My main content that defines header and navigation:
<div class="demo-container" mdl-shadow="2">
<mdl-layout mdl-layout-fixed-header mdl-layout-header-seamed>
<mdl-layout-header>
<mdl-layout-header-row>
<mdl-layout-title>AMM</mdl-layout-title>
<mdl-layout-spacer></mdl-layout-spacer>
<!-- Navigation. We hide it in small screens. -->
<nav class="mdl-navigation">
<!-- logout -->
<button mdl-button mdl-button mdl-button-type="icon" (click)="logout()">
<mdl-icon>exit_to_app</mdl-icon>
</button>
</nav>
</mdl-layout-header-row>
</mdl-layout-header>
<mdl-layout-content>
<!-- Your content goes here -->
<div class="mdl-grid">
</div>
</mdl-layout-content>
</mdl-layout>
</div>
I want to customize style for my header: I want to use custom color and I want to define my own height for it.
How can I achieve this? What and where I have to modify?
NOTE: I do not want to change the entire theme, I just need to modify my header.
Upvotes: 0
Views: 398
Reputation: 5366
I did override original css classes in style.css file, which worked fine
Upvotes: 0
Reputation: 1839
One way is to override the mdl-layout-header
for height and color. So add a custom class to it, and override its css
mdl-layout-header.custom{
min-height: 30px; //change this value for height
height: 30px;
background-color: red; // change this for color
}
mdl-layout-header.custom mdl-layout-header-row{
height: inherit;
}
Navbar code (html)
<mdl-layout-header class="custom">
<mdl-layout-header-row>
...
...
...
</mdl-layout-header-row>
</mdl-layout-header>
Upvotes: 1