File tree 4 files changed +112
-16
lines changed
4 files changed +112
-16
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,50 @@ $icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/';
14
14
Note: This Component has ViewEncapsulation.None so the styles will bleed out
15
15
16
16
*/
17
+ @media (max-width : 767px ) {
18
+ body {
19
+ background : #f1f1f1 ;
20
+ line-height : 18px ;
21
+ padding-top : 30px ;
22
+ }
23
+
24
+ h1 {
25
+ border-bottom : 3px #4189C7 solid ;
26
+ font-size : 24px ;
27
+ }
28
+
29
+ h2 {
30
+ font-size : 20px ;
31
+ }
32
+
33
+ h1 , h2 , h3 {
34
+ padding : 3px 0 ;
35
+ }
36
+ }
37
+
38
+ @media (min-width : 768px ) {
39
+ body {
40
+ background : #f1f1f1 ;
41
+ line-height : 18px ;
42
+ padding-top : 0px ;
43
+ }
44
+
45
+ h1 {
46
+ border-bottom : 5px #4189C7 solid ;
47
+ font-size : 36px ;
48
+ }
49
+
50
+ h2 {
51
+ font-size : 30px ;
52
+ }
53
+
54
+ h1 , h2 , h3 {
55
+ padding : 10px 0 ;
56
+ }
57
+ }
17
58
18
- body { background : #f1f1f1 ; line-height : 18px ; }
19
59
ul { padding : 10px 25px ; }
20
60
ul li { padding : 5px 0 ; }
21
61
22
- h1 { border-bottom : 5px #4189C7 solid ; }
23
- h1 , h2 , h3 { padding : 10px 0 ; }
24
-
25
62
blockquote { margin : 25px 10px ; padding : 10px 35px 10px 10px ; border-left : 10px #158a15 solid ; background : #edffed ; }
26
63
blockquote a , blockquote a :hover { color : #068006 ; }
Original file line number Diff line number Diff line change 1
- li .glyphicon {
1
+ li .glyphicon {
2
2
margin-right : 10px ;
3
3
}
4
4
@@ -19,17 +19,65 @@ li.link-active a:focus {
19
19
z-index : 1 ;
20
20
}
21
21
22
+ .icon-bar {
23
+ background-color : # 4189C7 ;
24
+ }
25
+
26
+
27
+ @media (max-width : 767px ) {
28
+ /* Apply for small displays */
29
+ .main-nav {
30
+ width : 100% ;
31
+ }
32
+
33
+ .navbar-brand {
34
+ font-size : 14px ;
35
+ background-color : # f1f1f1 ;
36
+ }
37
+ .navbar-toggle {
38
+ padding : 0px 5px ;
39
+ margin-top : 0px ;
40
+ height : 26px ;
41
+ }
42
+
43
+ .navbar-link {
44
+ margin-top : 4px ;
45
+ margin-left : 45px ;
46
+ position : fixed;
47
+ }
48
+
49
+ .navbar-collapse {
50
+ background-color : white;
51
+ }
52
+
53
+ .navbar a {
54
+ /* If a menu item's text is too long, truncate it */
55
+ white-space : nowrap;
56
+ overflow : hidden;
57
+ text-overflow : ellipsis;
58
+ padding-right : 5px ;
59
+ }
60
+ }
61
+
22
62
@media (min-width : 768px ) {
23
63
/* On small screens, convert the nav menu to a vertical sidebar */
24
64
.main-nav {
25
65
height : 100% ;
66
+ max-width : 330px ;
26
67
width : calc (25% - 20px );
27
68
}
28
69
.navbar {
29
70
border-radius : 0px ;
30
71
border-width : 0px ;
31
72
height : 100% ;
32
73
}
74
+ .navbar-brand {
75
+ width : 100% ;
76
+ }
77
+ .navbar-link {
78
+ display : block;
79
+ width : 100%
80
+ }
33
81
.navbar-header {
34
82
float : none;
35
83
}
@@ -51,7 +99,6 @@ li.link-active a:focus {
51
99
}
52
100
.navbar a {
53
101
/* If a menu item's text is too long, truncate it */
54
- width : 100% ;
55
102
white-space : nowrap;
56
103
overflow : hidden;
57
104
text-overflow : ellipsis;
Original file line number Diff line number Diff line change 1
- < div class ='main-nav '>
1
+ < div class ='main-nav '>
2
2
< div class ='navbar '>
3
3
< div class ='navbar-header '>
4
- < button type ='button ' class ='navbar-toggle ' data-toggle ='collapse ' data-target ='.navbar-collapse '>
5
- < span class ='sr-only '> Toggle navigation</ span >
6
- < span class ='icon-bar '> </ span >
7
- < span class ='icon-bar '> </ span >
8
- < span class ='icon-bar '> </ span >
9
- </ button >
10
- < a class ='navbar-brand ' [routerLink] ="['/home'] "> Angular 4 Universal & ASP.NET Core </ a >
4
+ < div class ='navbar-brand '>
5
+ < button type ='button ' class ='navbar-toggle ' (click) ="collapseNavbar() ">
6
+ < span class ='sr-only '> Toggle navigation</ span >
7
+ < span class ='icon-bar '> </ span >
8
+ < span class ='icon-bar '> </ span >
9
+ < span class ='icon-bar '> </ span >
10
+ </ button >
11
+ < a [routerLink] ="['/home'] " class ='navbar-link '> Angular 4 Universal & ASP.NET Core</ a >
12
+ </ div >
11
13
</ div >
12
14
< div class ='clearfix '> </ div >
13
- < div class ='navbar-collapse collapse '>
15
+ < div class ='navbar-collapse {{ collapse}} '>
14
16
< ul class ='nav navbar-nav '>
15
17
< li [routerLinkActive] ="['link-active'] ">
16
18
< a [routerLink] ="['/home'] ">
Original file line number Diff line number Diff line change 1
- import { Component } from '@angular/core' ;
1
+ import { Component } from '@angular/core' ;
2
2
3
3
@Component ( {
4
4
selector : 'nav-menu' ,
5
5
templateUrl : './navmenu.component.html' ,
6
6
styleUrls : [ './navmenu.component.css' ]
7
7
} )
8
+
8
9
export class NavMenuComponent {
10
+ collapse : string = "collapse" ;
11
+
12
+ collapseNavbar ( ) : void {
13
+ if ( this . collapse . length > 1 ) {
14
+ this . collapse = "" ;
15
+ } else {
16
+ this . collapse = "collapse" ;
17
+ }
18
+ }
9
19
}
You can’t perform that action at this time.
0 commit comments