File tree Expand file tree Collapse file tree 7 files changed +84
-6
lines changed Expand file tree Collapse file tree 7 files changed +84
-6
lines changed Original file line number Diff line number Diff line change 1
1
@charset " UTF-8" ;
2
2
3
+ $primary-color : #049cdb ;
4
+
5
+ .site-header {
6
+ position : relative ;
7
+ }
8
+
9
+ .search-container {
10
+ position : absolute ;
11
+ top : 0 ;
12
+ left : 0 ;
13
+ right : 0 ;
14
+ bottom : 0 ;
15
+ background-color : white ;
16
+ padding-top : 19px ;
17
+ padding-right : 15% ;
18
+
19
+ .search {
20
+ max-width : 500px ;
21
+ width : 100% ;
22
+ border-bottom : 2px solid $primary-color ;
23
+ float : right ;
24
+
25
+ .algolia-autocomplete {
26
+ width : calc (100% - 58px );
27
+ margin : 0 10px ;
28
+ }
29
+
30
+ input {
31
+ border : 0 ;
32
+ width : 100% ;
33
+ }
34
+ }
35
+ }
36
+
37
+ @media only screen and (max-width : $menu-collapse ) {
38
+ .search-container {
39
+ z-index : 20 ;
40
+ padding-right : 5px ;
41
+ padding-left : 5px ;
42
+ }
43
+ }
44
+
3
45
.hero {
4
46
background-color : #038FC7 ;
5
47
padding-bottom : 0 ;
Original file line number Diff line number Diff line change @@ -81,17 +81,23 @@ header .grid {
81
81
font-weight : normal ;
82
82
font-size : 14px ;
83
83
line-height : 1 ;
84
+
85
+ & .show-search {
86
+ padding-left : 0 ;
87
+ padding-right : 0 ;
88
+ }
84
89
}
85
90
86
91
.menu > li > a :hover , .menu > li > a :focus {
87
92
background : $site-background ;
88
93
box-shadow : inset 0px 5px $navigation-color ;
89
94
color : $navigation-color ;
90
- padding : 40px 12px 24px ;
95
+ padding-top : 40px ;
96
+ padding-bottom : 24px ;
91
97
}
92
98
93
- .toggle {
94
- z-index : 20 ;
99
+ .toggle {
100
+ z-index : 20 ;
95
101
}
96
102
97
103
@media only screen and (max-width : $menu-collapse ){
Original file line number Diff line number Diff line change 9
9
< nav >
10
10
{% include site/navigation.html %}
11
11
</ nav >
12
+
13
+ < div class ='search-container ' style ='display: none '>
14
+ < div class ='search '>
15
+ < i class ="icon-search "> </ i >
16
+ < input id ='search ' placeholder ='Search the docs… '>
17
+ < a href ='# ' class ='close '> < i class ="icon-remove-sign "> </ i > </ a >
18
+ </ div >
19
+ </ div >
12
20
</ div >
Original file line number Diff line number Diff line change 16
16
< li > < a href ="/developers/ "> Developers</ a > </ li >
17
17
< li > < a href ="/blog/ "> Blog</ a > </ li >
18
18
< li > < a href ="/help/ "> Need help?</ a > </ li >
19
+ < li > < a href ='# ' class ='show-search '> < i class ="icon-search "> </ i > </ a > </ li >
19
20
</ ul >
Original file line number Diff line number Diff line change
1
+ < link rel ="stylesheet " href ="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css " />
2
+ < script type ="text/javascript " src ="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js "> </ script >
3
+ < script type ="text/javascript ">
4
+ docsearch ( {
5
+ apiKey : 'ae96d94b201c5444c8a443093edf3efb' ,
6
+ indexName : 'home-assistant' ,
7
+ inputSelector : '#search' ,
8
+ debug : false // Set debug to true if you want to inspect the dropdown
9
+ } ) ;
10
+ document . querySelector ( '.search .close' ) . addEventListener ( 'click' , function ( ev ) {
11
+ ev . preventDefault ( ) ;
12
+ document . querySelector ( '.search-container' ) . style . display = 'none' ;
13
+ } ) ;
14
+ document . querySelector ( '.show-search' ) . addEventListener ( 'click' , function ( ev ) {
15
+ ev . preventDefault ( ) ;
16
+ document . querySelector ( '.search-container' ) . style . display = 'block' ;
17
+ document . getElementById ( 'toggle' ) . checked = false ;
18
+ document . querySelector ( '.search-container input' ) . focus ( ) ;
19
+ } ) ;
20
+ </ script >
Original file line number Diff line number Diff line change 5
5
6
6
{% include javascripts/google_analytics.html %}
7
7
{% include javascripts/disqus.html %}
8
+ {% include javascripts/algolia.html %}
8
9
9
10
{% if page.sidebar != false %}
10
11
{% include javascripts/github.html %}
11
12
{% include javascripts/delicious.html %}
12
- {% endif %}
13
+ {% endif %}
Original file line number Diff line number Diff line change 6
6
7
7
< body {% if page.body_id %} id ="{{ page.body_id }} "{% endif %} >
8
8
9
- < header >
9
+ < header class =' site-header ' >
10
10
{% include site/header.html %}
11
11
</ header >
12
12
42
42
43
43
{% include javascripts/scripts.html %}
44
44
</ body >
45
- </ html>
45
+ </ html>
You can’t perform that action at this time.
0 commit comments