Skip to content

Commit 7a83876

Browse files
committed
First pass of updating search box to match designs
1 parent 22f5b1c commit 7a83876

File tree

4 files changed

+63
-11
lines changed

4 files changed

+63
-11
lines changed

app/assets/stylesheets/partials/_effects.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
@mixin set-focus-outline-dark() {
2020
*:focus-visible {
2121
outline: 2px solid $color-focus-dark;
22+
outline-offset: 2px;
2223
}
2324
}
2425

2526
@mixin set-focus-outline() {
2627
*:focus-visible {
2728
outline: 2px solid $color-focus;
29+
outline-offset: 2px;
2830
}
2931
}

app/assets/stylesheets/partials/_header.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@
3939
.wrapper {
4040
background: url("https://cdn.mitlibrary.net/files/branding/local/vi-shape7-tp.svg") no-repeat -48px -250px;
4141
padding-top: 32px;
42-
padding-bottom: 32px;
42+
padding-bottom: 0;
4343
}
4444

4545
.navigation-bar {
4646
display: flex;
47+
padding-bottom: 32px;
4748

4849
> h1 {
4950
display: flex;

app/assets/stylesheets/partials/_search.scss

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,60 @@
22
// #SEARCH BITS
33
// ------------------------
44

5+
/* New USE UI search styles */
6+
#search-form {
7+
margin: 0;
8+
padding-bottom: 24px;
9+
10+
h3 {
11+
font-size: 1.8rem;
12+
margin-bottom: 12px;
13+
}
14+
15+
.form-wrapper {
16+
display: flex;
17+
gap: 8px;
18+
19+
input, button {
20+
padding: 12px 20px;
21+
border-radius: 0;
22+
font-size: 1.8rem;
23+
font-weight: $fw-medium;
24+
25+
margin: 0;
26+
27+
&:hover:not(:focus) {
28+
outline: 2px solid $color-gray-700;
29+
outline-offset: 2px;
30+
}
31+
}
32+
33+
input {
34+
flex-grow: 1;
35+
color: $color-black;
36+
}
37+
38+
button {
39+
background-color: $color-red-600;
40+
border: none;
41+
}
42+
43+
}
44+
45+
.form-links {
46+
padding-top: 12px;
47+
48+
a {
49+
color: $color-white;
50+
text-decoration: none;
51+
border-bottom: 1px solid $color-red-500;
52+
font-size: 1.4rem;
53+
}
54+
55+
}
56+
57+
}
58+
559
/* basic search bar */
660
.search-form {
761
background-color: #989898;

app/views/search/_form.html.erb

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
<form id="search-form" class="form-horizontal search-form" action="<%= results_path %>" method="get" role="search">
2-
<div class="form-group">
3-
<input id="basic-search-main" type="search"
4-
class="field field-text basic-search-input" name="q"
5-
title="Keyword anywhere" placeholder="Enter your search"
6-
value="<%= params[:q] %>" required>
7-
8-
<div class="basic-search-submit">
9-
<button type="submit" class="btn button-primary">Search</button>
10-
</div>
1+
<form id="search-form" action="<%= results_path %>" method="get" role="search">
2+
<h3>What can we help you find?</h3>
3+
<div class="form-wrapper">
4+
<input id="basic-search-main" type="search" class="field field-text basic-search-input" name="q" title="Keyword anywhere" placeholder="Search for anything" value="<%= params[:q] %>" required>
5+
<button type="submit" class="btn button-primary">Search</button>
116
</div>
127
</form>
138

0 commit comments

Comments
 (0)