File tree Expand file tree Collapse file tree 10 files changed +115
-34
lines changed
lib/ex_doc/formatter/html/templates Expand file tree Collapse file tree 10 files changed +115
-34
lines changed Original file line number Diff line number Diff line change 1
1
.autocomplete {
2
2
display : none;
3
- height : 0 ;
4
- margin-right : 32px ;
5
- overflow : visible;
6
- position : relative;
3
+ position : absolute;
4
+ width : 84% ;
5
+ top : 55px ;
7
6
}
8
7
9
8
.autocomplete .triangle {
36
35
.autocomplete-results .show {
37
36
white-space : normal;
38
37
overflow-x : hidden;
39
- width : 62 % ;
38
+ width : 84 % ;
40
39
}
41
40
42
41
.autocomplete-results .bold {
135
134
}
136
135
137
136
@media (max-width : 480px ) {
137
+
138
+ .autocomplete {
139
+ width : 90% ;
140
+ }
141
+
138
142
.autocomplete .triangle {
139
143
left : 27% ;
140
144
}
141
145
}
142
146
147
+ @media (min-width : 481px ) and (max-width : 767px ) {
148
+
149
+ .autocomplete {
150
+ width : 95% ;
151
+ }
152
+
153
+ .autocomplete .triangle {
154
+ left : 17% ;
155
+ }
156
+ }
157
+
143
158
@media (max-width : 767px ) {
159
+ .autocomplete {
160
+ top : 50px ;
161
+ left : 0 ;
162
+ right : 0 ;
163
+ z-index : 200 ;
164
+ }
165
+
144
166
.autocomplete .triangle {
145
167
left : 17% ;
146
168
}
147
169
}
148
170
149
- @media (max-width : 1024 px ) {
171
+ @media (max-width : 1023 px ) {
150
172
.autocomplete-results {
151
173
gap : 0 ;
152
174
}
Original file line number Diff line number Diff line change @@ -35,13 +35,13 @@ body {
35
35
position : fixed;
36
36
top : 0 ;
37
37
left : 0 ;
38
- z-index : 4 ;
38
+ z-index : 100 ;
39
39
}
40
40
41
41
.sidebar-button {
42
42
--sidebarButtonRightOpen : 4px ;
43
43
position : fixed;
44
- z-index : 99 ;
44
+ z-index : 200 ;
45
45
left : 0 ;
46
46
transition : all var (--sidebarTransitionDuration ) ease-in-out;
47
47
will-change : transform;
53
53
left : var (--sidebarWidth );
54
54
height : 100% ;
55
55
position : absolute;
56
- z-index : 3 ;
57
56
}
58
57
59
58
.content-inner {
@@ -124,19 +123,22 @@ body.sidebar-closed .sidebar-button {
124
123
}
125
124
126
125
@media screen and (max-width : 768px ) {
127
- .content ,
126
+ .content ,
128
127
body .sidebar-opening .content {
129
128
left : 0 ;
130
129
width : 100% ;
131
130
}
132
131
133
132
.content-inner {
134
- padding-top : 13 px ;
133
+ padding-top : 43 px ;
135
134
padding-bottom : 26px ;
136
135
overflow-x : auto;
136
+
137
137
}
138
138
139
139
body .sidebar-closed .sidebar-button {
140
- position : absolute;
140
+ position : fixed;
141
+ left : 0 ;
142
+ transition : top 0.9s ;
141
143
}
142
- }
144
+ }
Original file line number Diff line number Diff line change
1
+ .background-layer {
2
+ display : none;
3
+ position : fixed;
4
+ top : 0 ;
5
+ left : 0 ;
6
+ right : 0 ;
7
+ height : 70px ;
8
+ background-color : var (--background );
9
+ }
10
+
1
11
.top-search {
2
12
margin-top : 10px ;
3
13
}
6
16
display : flex;
7
17
column-gap : 12px ;
8
18
align-items : center;
19
+ width : 100% ;
9
20
}
10
21
11
22
.search-bar {
12
23
border : 1px solid var (--searchBarBorder );
13
24
border-radius : 8px ;
14
25
height : 48px ;
15
26
position : relative;
16
- flex-grow : 1 ;
27
+ width : 100 % ;
17
28
}
18
29
19
30
.top-search .search-bar .search-input {
56
67
position : absolute;
57
68
top : 60% ;
58
69
transform : translateY (-60% );
59
- z-index : 2 ;
70
+ z-index : 99 ;
60
71
}
61
72
62
73
.top-search .search-bar .selected .search-button ,
80
91
transform : scaleY (0 );
81
92
top : calc (50% - 11px );
82
93
transition : 0.15s transform ease-out;
83
- z-index : 2 ;
94
+ z-index : 99 ;
84
95
}
85
96
86
97
.top-search .search-bar .search-close-button : hover {
114
125
115
126
@media (max-width : 480px ) or ((min-width : 481px ) and (max-width : 768px )) {
116
127
.search-bar {
117
- margin-left : 35 px ;
128
+ margin-left : 0 px ;
118
129
}
119
130
}
120
131
121
132
@media (max-width : 768px ) {
133
+ .background-layer {
134
+ display : block;
135
+ z-index : 10 ;
136
+ transition : top 0.3s ;
137
+ }
138
+
122
139
.top-search {
123
140
margin-top : 0 ;
141
+ position : fixed;
142
+ top : 13px ;
143
+ left : 56px ;
144
+ right : 20px ;
145
+ transition : top 0.3s ;
146
+ z-index : 99 ;
147
+ }
148
+
149
+ .search-settings {
150
+ width : 100% ;
151
+ box-sizing : border-box;
124
152
}
125
153
}
126
154
Original file line number Diff line number Diff line change @@ -141,3 +141,29 @@ function hideAutocomplete () {
141
141
function isMacOS ( ) {
142
142
return / ( M a c | i P h o n e | i P o d | i P a d ) / i. test ( navigator . platform )
143
143
}
144
+
145
+ let lastScrollTop = window . scrollY
146
+ const topSearch = document . querySelector ( '.top-search' )
147
+ const sidebarMenu = document . getElementById ( 'sidebar-menu' )
148
+ const backgroundLayer = document . querySelector ( '.background-layer' )
149
+
150
+ window . addEventListener ( 'scroll' , function ( ) {
151
+ const currentScroll = window . scrollY
152
+
153
+ if ( currentScroll > lastScrollTop ) {
154
+ // Scrolling down
155
+ topSearch . style . top = '-50px'
156
+ backgroundLayer . style . top = '-70px'
157
+ // Only hide sidebarMenu if aria-expanded is not true
158
+ if ( sidebarMenu . getAttribute ( 'aria-expanded' ) !== 'true' ) {
159
+ sidebarMenu . style . display = 'none'
160
+ }
161
+ } else {
162
+ // Scrolling up
163
+ topSearch . style . top = '11px'
164
+ backgroundLayer . style . top = '0px'
165
+ sidebarMenu . style . display = 'block'
166
+ }
167
+
168
+ lastScrollTop = currentScroll <= 0 ? 0 : currentScroll
169
+ } , false )
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
<div class="main">
2
2
3
- <button class="sidebar-button sidebar-toggle" aria-label="toggle sidebar" aria-controls="sidebar">
3
+ <button id="sidebar-menu" class="sidebar-button sidebar-toggle" aria-label="toggle sidebar" aria-controls="sidebar">
4
4
<i class="ri-menu-line ri-lg" title="Collapse/expand sidebar"></i>
5
5
</button>
6
6
7
+ <div class="background-layer"></div>
8
+
7
9
<nav id="sidebar" class="sidebar">
8
10
<% url = config.homepage_url || "#{config.main}.html" %>
9
11
<div class="sidebar-header">
82
84
<i class="ri-close-line ri-lg" title="Cancel search"></i>
83
85
</button>
84
86
</form>
87
+ <div class="autocomplete">
88
+ </div>
85
89
<button class="icon-settings display-settings">
86
90
<i class="ri-settings-3-line"></i>
87
91
<span class="sr-only">Settings</span>
88
92
</button>
89
93
</div>
90
- </div>
91
- <div class="autocomplete">
94
+
92
95
</div>
You can’t perform that action at this time.
0 commit comments