File tree Expand file tree Collapse file tree 4 files changed +59
-18
lines changed Expand file tree Collapse file tree 4 files changed +59
-18
lines changed Original file line number Diff line number Diff line change @@ -117,16 +117,18 @@ module.exports = async (request, response) => {
117
117
<link rel="stylesheet" href="/style.css" />
118
118
</head>
119
119
<body>
120
- <h1>octokit.rest</h1>
120
+ <header>
121
+ <h2>octokit.rest</h2>
122
+ </header>
121
123
122
124
<div id="search">
123
125
${ search ( { query : `${ endpoint . method } ${ endpoint . url } ` } ) }
124
126
</div>
125
127
126
- <div id="details">
128
+ <main id="details" class ="details">
127
129
128
130
<section>
129
- <h2>${ endpoint . name } (<code> ${ route } </code>) </h2>
131
+ <h2>${ endpoint . name } </h2>
130
132
131
133
${ markdown . render ( endpoint . description ) }
132
134
</section>
@@ -177,7 +179,7 @@ module.exports = async (request, response) => {
177
179
endpoint . documentationUrl
178
180
} ">GitHub developer guides</a></p>
179
181
180
- </div >
182
+ </main >
181
183
182
184
<script type="module" src="/detail.js"></script>
183
185
<script type="module" src="/search.js"></script>
Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ module.exports = async (request, response) => {
57
57
<link rel="stylesheet" href="/style.css" />
58
58
</head>
59
59
<body>
60
- <h1>octokit.rest</h1>
60
+ <header>
61
+ <h2>octokit.rest</h2>
62
+ </header>
61
63
62
64
<div id="search">
63
65
${ search ( { query, results } ) }
Original file line number Diff line number Diff line change @@ -6,15 +6,17 @@ export function search({ query, results }) {
6
6
const resultsHTML = searchResults ( { query, results } ) ;
7
7
8
8
return `
9
- <form action="/">
10
- <label>
11
- What would you like to request?<br />
12
- <input type="text" value="${ query } " name="query" autocomplete="off" />
13
- </label>
9
+ <form action="/" class="search">
10
+ <h1>
11
+ <label class="has-placeholder">
12
+ <span>What would you like to request?</span><br />
13
+ <input type="text" value="${ query } " name="query" placeholder="Type your search here" autocomplete="off" />
14
+ </label>
15
+ </h1>
14
16
<button type="submit">Go</button>
15
17
</form>
16
18
17
- <div id="results">
19
+ <div id="results" class="results" >
18
20
${ resultsHTML }
19
21
</div>
20
22
` ;
Original file line number Diff line number Diff line change @@ -11,20 +11,14 @@ body {
11
11
font-family : "Helvetica Neue" , Helvetica, sans-serif;
12
12
font-size : 100% ;
13
13
line-height : 1.5 ;
14
+ padding : 3vw ;
14
15
}
15
16
16
17
/* Color */
17
18
a {
18
19
color : hsl (210 , 53% , 51% );
19
20
}
20
21
21
- /* Layout */
22
- body > * {
23
- margin : 3rem auto;
24
- padding : 1.5rem ;
25
- max-width : 45rem ;
26
- }
27
-
28
22
/* Form */
29
23
input {
30
24
font-size : inherit;
@@ -37,13 +31,24 @@ input {
37
31
input {
38
32
margin-top : 0.375em ;
39
33
}
34
+ input : focus ::placeholder {
35
+ color : hsl (0 , 0% , 75% );
36
+ }
40
37
button {
41
38
font-size : inherit;
42
39
font-family : inherit;
43
40
border : 1px solid hsl (0 , 0% , 75% );
44
41
padding : 0.375em 0.75em ;
45
42
}
46
43
44
+
45
+ label .has-placeholder > span ,
46
+ label .has-placeholder > br {
47
+ /* @hidden-accessible */
48
+ position : absolute;
49
+ left : -9999px ;
50
+ }
51
+
47
52
/* Code */
48
53
pre {
49
54
border : 1px solid hsl (0 , 0% , 79% );
@@ -129,3 +134,33 @@ td {
129
134
.note > : last-child {
130
135
margin-bottom : 0 ;
131
136
}
137
+
138
+ /* Header */
139
+ body > header {
140
+ /* @hidden-accessible */
141
+ position : absolute;
142
+ left : -9999px ;
143
+ }
144
+ form h1 {
145
+ font : inherit;
146
+ margin : 0 ;
147
+ display : inline;
148
+ }
149
+
150
+ /* Search */
151
+ .search {
152
+ font-size : 3vw ;
153
+ margin-bottom : 1.5em ;
154
+ margin-left : calc (-0.75em - 1px );
155
+ }
156
+
157
+ /* Details */
158
+ .details {
159
+ margin-left : -1.5rem ;
160
+ margin-right : -1.5rem ;
161
+ }
162
+ .details > * {
163
+ margin : 3rem auto;
164
+ padding : 1.5rem ;
165
+ max-width : 45rem ;
166
+ }
You can’t perform that action at this time.
0 commit comments