Skip to content

Commit f79ca88

Browse files
committed
refactor(style): improve secondary nav styling
1 parent 57a4dc8 commit f79ca88

9 files changed

+112
-13
lines changed

src/app/forms/forms.component.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h4> Forms Component </h4>
2-
<ul class="nav nav-pills">
2+
<ul class="nav nav-tabs">
33
<li class="nav-item">
44
<a class="nav-link" routerLink="template" routerLinkActive="active">Template Driven</a>
55
</li>
@@ -10,11 +10,11 @@ <h4> Forms Component </h4>
1010
<a class="nav-link" routerLink="model-form-builder" routerLinkActive="active">Model Driven - Form Builder</a>
1111
</li>
1212
</ul>
13+
<br>
14+
<div style="max-width: 42em;">
15+
16+
<router-outlet></router-outlet>
17+
<br><br>
18+
Angular Forms (Template Driven and Model Driven)
1319

14-
<div class="card" style="max-width: 42em;">
15-
<div class="card-block">
16-
<router-outlet></router-outlet>
17-
<br><br>
18-
Angular Forms (Template Driven and Model Driven)
19-
</div>
2020
</div>

src/app/forms/forms.component.scss

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.nav-tabs {
2+
border-bottom: 1px solid #eee;
3+
}
4+
5+
.nav-tabs> li {
6+
padding: 0;
7+
// font-size: smaller;
8+
}
9+
10+
.nav-tabs> li.active> a,
11+
.nav-tabs> li.active> a:focus,
12+
.nav-tabs> li.active> a:hover {
13+
border-width: 0;
14+
}
15+
16+
.nav-tabs> li> a {
17+
border: none;
18+
color: #666;
19+
padding: 0.125rem 1rem;
20+
}
21+
22+
.nav-tabs> li> a:hover {
23+
border-bottom: solid 2px lighten($color: #4285F4, $amount: 20%);
24+
background: transparent;
25+
}
26+
27+
.nav-tabs> li> a.active,
28+
.nav-tabs> li> a:hover .active {
29+
border-bottom: solid 2px #4285F4;
30+
color: #4285F4;
31+
background: transparent;
32+
}

src/app/forms/forms.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Component } from '@angular/core';
22

33
@Component({
44
selector: 'labs-forms',
5-
templateUrl: 'forms.component.html'
5+
templateUrl: 'forms.component.html',
6+
styleUrls: ['forms.component.scss']
67
})
78
export class FormsComponent {}

src/app/forms/forms.routes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ModelBuilderModule } from './model-builder';
77
const ROUTES: Route[] = [
88
{ path: '', component: FormsComponent,
99
children: [
10-
{ path: '', pathMatch: 'full' },
10+
{ path: '', redirectTo: 'template' },
1111
{ path: 'template', loadChildren: () => TemplateModule },
1212
{ path: 'model-form-controls', loadChildren: () => ModelControlsModule },
1313
{ path: 'model-form-builder', loadChildren: () => ModelBuilderModule }

src/app/lazy/lazy.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h4> Lazy Component </h4>
2-
<ul class="nav nav-pills">
2+
<ul class="nav nav-tabs">
33
<li class="nav-item">
44
<a class="nav-link" routerLink="." routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" >Lazy</a>
55
</li>

src/app/lazy/lazy.component.scss

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
11
.card {
22
max-width: 32em;
3-
}
3+
}
4+
5+
.nav-tabs {
6+
border-bottom: 1px solid #eee;
7+
}
8+
9+
.nav-tabs> li {
10+
padding: 0;
11+
// font-size: smaller;
12+
}
13+
14+
.nav-tabs> li.active> a,
15+
.nav-tabs> li.active> a:focus,
16+
.nav-tabs> li.active> a:hover {
17+
border-width: 0;
18+
}
19+
20+
.nav-tabs> li> a {
21+
border: none;
22+
color: #666;
23+
padding: 0.125rem 1rem;
24+
}
25+
26+
.nav-tabs> li> a:hover {
27+
border-bottom: solid 2px lighten($color: #4285F4, $amount: 20%);
28+
background: transparent;
29+
}
30+
31+
.nav-tabs> li> a.active,
32+
.nav-tabs> li> a:hover .active {
33+
border-bottom: solid 2px #4285F4;
34+
color: #4285F4;
35+
background: transparent;
36+
}

src/app/masonry/masonry-demo.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
width and number of columns are adjusted based on screen size
55
</p>
66

7-
<ul class="nav nav-pills">
7+
<ul class="nav nav-tabs">
88
<li class="nav-item">
99
<a class="nav-link" routerLink="markup" routerLinkActive="active">Markup based</a>
1010
</li>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.nav-tabs {
2+
border-bottom: 1px solid #eee;
3+
}
4+
5+
.nav-tabs> li {
6+
padding: 0;
7+
// font-size: smaller;
8+
}
9+
10+
.nav-tabs> li.active> a,
11+
.nav-tabs> li.active> a:focus,
12+
.nav-tabs> li.active> a:hover {
13+
border-width: 0;
14+
}
15+
16+
.nav-tabs> li> a {
17+
border: none;
18+
color: #666;
19+
padding: 0.125rem 1rem;
20+
}
21+
22+
.nav-tabs> li> a:hover {
23+
border-bottom: solid 2px lighten($color: #4285F4, $amount: 20%);
24+
background: transparent;
25+
}
26+
27+
.nav-tabs> li> a.active,
28+
.nav-tabs> li> a:hover .active {
29+
border-bottom: solid 2px #4285F4;
30+
color: #4285F4;
31+
background: transparent;
32+
}

src/app/masonry/masonry-demo.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Component } from '@angular/core';
22

33
@Component({
44
selector: 'labs-masonry-demo',
5-
templateUrl: 'masonry-demo.component.html'
5+
templateUrl: 'masonry-demo.component.html',
6+
styleUrls: [ 'masonry-demo.component.scss' ]
67
})
78
export class MasonryDemoComponent {}

0 commit comments

Comments
 (0)