Skip to content

Commit c5db4e3

Browse files
authored
Merge pull request #321 from MITLibraries/use-302
USE-302: First pass updates to result styling for visual clarity
2 parents 8cd82e3 + c4a6281 commit c5db4e3

File tree

7 files changed

+117
-54
lines changed

7 files changed

+117
-54
lines changed

app/assets/stylesheets/partials/_buttons.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111

1212
&:hover {
1313
background-color: $color-blue-25;
14+
color: $color-blue-500;
1415
}
1516
}

app/assets/stylesheets/partials/_results.scss

Lines changed: 106 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
.results-list.use {
4848
list-style-type: none;
4949
padding: 0;
50+
margin-bottom: 0;
5051
}
5152

5253
// --------------------------------------
@@ -139,10 +140,19 @@
139140
// --------------------------------------
140141

141142
.result.use, .result.primo {
142-
margin-bottom: 48px;
143-
padding: 0;
143+
padding: 48px 0;
144+
margin: 0;
145+
border-bottom: 1px solid $color-gray-400;
144146
border-top: none;
147+
148+
&:first-child {
149+
padding-top: 0;
150+
}
145151

152+
&:last-child {
153+
border-bottom: none;
154+
}
155+
146156
&:hover,
147157
&:focus {
148158
background-color: transparent;
@@ -169,25 +179,71 @@
169179

170180
.pub-info {
171181
font-size: $fs-base;
172-
color: $color-text-secondary;
173-
span:first-child:after {
174-
content: "";
175-
color: $color-text-disabled;
182+
183+
span {
184+
&::before, &:last-child::before {
185+
content: "";
186+
color: $color-text-disabled;
187+
}
188+
189+
&:first-child::before {
190+
content: " ";
191+
}
192+
193+
// Override the default separator
194+
&::after, &:first-child::after {
195+
content: " ";
196+
}
197+
176198
}
199+
177200
margin-bottom: 1em;
178201
margin-top: 0;
179202
}
180203

204+
.result-subjects, .result-summary, .result-container {
205+
font-size: 1.4rem;
206+
margin-bottom: 8px;
207+
color: $color-text-secondary;
208+
}
209+
210+
.result-subjects {
211+
color: $color-text-secondary;
212+
213+
ul {
214+
line-clamp: 1;
215+
-webkit-line-clamp: 1;
216+
217+
li {
218+
margin-bottom: 0;
219+
220+
&::after {
221+
content: "";
222+
color: $color-text-disabled;
223+
}
224+
225+
&:last-child::after {
226+
content: " ";
227+
}
228+
229+
}
230+
}
231+
232+
}
233+
181234
.result-highlights.use {
182235
margin-top: 0;
183236

237+
h4, strong {font-weight: $fw-medium;}
238+
184239
ul {
185240
list-style: disc outside;
186241
padding-left: 16px;
242+
margin-bottom: 0;
187243

188244
li {
189245
margin-left: 0.6rem;
190-
font-size: 1.6rem;
246+
font-size: 1.4rem;
191247
}
192248
}
193249
}
@@ -196,62 +252,62 @@
196252
background-color: $color-highlight;
197253
}
198254

199-
&.use, &.primo {
200-
.result-metadata {
201-
margin-bottom: 16px;
202-
}
255+
.result-metadata {
256+
margin-bottom: 16px;
257+
}
203258

204-
.pub-info {
205-
margin-bottom: 4px;
206-
}
259+
.pub-info {
260+
margin-bottom: 4px;
261+
}
207262

208-
ul.contributors {
209-
li {
210-
font-weight: $fw-normal;
263+
ul.contributors {
264+
line-clamp: 1;
265+
-webkit-line-clamp: 1;
266+
margin-bottom: 12px;
211267

212-
a {
213-
color: $color-text-secondary;
214-
text-decoration: none;
268+
li {
269+
font-weight: $fw-normal;
215270

216-
&:hover {
217-
text-decoration: underline;
218-
}
271+
a {
272+
text-decoration: none;
273+
274+
&:hover {
275+
text-decoration: underline;
219276
}
220277
}
221278
}
279+
}
222280

223-
.inner-heading {
224-
font-size: 1.6rem;
225-
font-family: $base-font; // Since we're using 16px, override to use body font
226-
}
227-
228-
.result-get {
229-
display: flex;
230-
align-items: center;
231-
gap: 24px;
232-
}
233-
234-
// Make result buttons present as underlined links
235-
a.button {
236-
@include underlinedLinks;
237-
font-weight: $fw-medium;
238-
font-size: 1.6rem;
239-
}
281+
.inner-heading {
282+
font-size: 1.6rem;
283+
font-family: $base-font; // Since we're using 16px, override to use body font
284+
}
240285

241-
// Except the first button, which should present as a secondary button
242-
.result-get > a.button:first-child {
243-
@include buttonSecondary;
244-
}
286+
.result-get {
287+
display: flex;
288+
align-items: center;
289+
gap: 24px;
290+
}
245291

246-
// Loading skeleton when a button isn't available
247-
span.skeleton-loader {
248-
@include skeleton-loader(112px);
249-
}
292+
// Make result buttons present as underlined links
293+
a.button {
294+
@include underlinedLinks;
295+
font-weight: $fw-medium;
296+
font-size: 1.6rem;
297+
}
250298

251-
.truncate-list li:last-child {margin-bottom: 0;}
299+
// Except the first button, which should present as a secondary button
300+
.result-get > a.button:first-child {
301+
@include buttonSecondary;
302+
}
252303

304+
// Loading skeleton when a button isn't available
305+
span.skeleton-loader {
306+
@include skeleton-loader(112px);
253307
}
254308

309+
.truncate-list li:last-child {margin-bottom: 0;}
310+
255311
.availability {
256312
color: $color-text-secondary;
257313

@@ -300,7 +356,7 @@
300356

301357
.results-context-description {
302358
color: $color-text-secondary;
303-
margin-bottom: 32px;
359+
margin-bottom: 40px;
304360
}
305361

306362
#results-section {

app/assets/stylesheets/partials/_search.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@
218218
margin: 0;
219219
max-width: 760px;
220220
padding: 3.5rem 0 2rem;
221+
222+
a {
223+
@include underlinedLinks;
224+
font-weight: $fw-medium;
225+
}
221226
}
222227

223228
/* primo continuation partial */

app/assets/stylesheets/partials/_variables.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ $color-gray-100: #F2F2F2;
99
$color-gray-200: #e6e6e6;
1010
$color-gray-300: #ccc;
1111
$color-gray-400: #b3b3b3;
12-
$color-gray-500: #999 ;
12+
$color-gray-500: #999;
13+
$color-gray-600: #808080;
1314
$color-gray-700: #666;
1415
$color-gray-900: #333;
1516
$color-gray-950: #1a1a1a;

app/views/search/_highlights.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<% highlights = trim_highlights(result) %>
22
<% return unless highlights&.any? %>
33

4-
<h4 class="inner-heading">See full record for all matches to your search terms:</h4>
4+
<h4 class="inner-heading">Search term found in:</h4>
55
<ul class="list-unbulleted truncate-list">
66
<% highlights.each do |h| %>
77
<% h['matchedPhrases'].each do |phrase| %>

app/views/search/_result.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<% if result[:subjects].present? %>
3838
<div class="result-subjects truncate-list">
3939
<span class="sr">Subjects: </span>
40-
<ul>
40+
<ul class="list-inline truncate-list subjects">
4141
<% result[:subjects].each do |subject| %>
4242
<li><%= subject %></li>
4343
<% end %>

app/views/search/_result_primo.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<% if result[:subjects].present? %>
4545
<div class="result-subjects truncate-list">
4646
<span class="sr">Subjects: </span>
47-
<ul>
47+
<ul class="list-inline truncate-list subjects">
4848
<% result[:subjects].each do |subject| %>
4949
<li><%= subject %></li>
5050
<% end %>

0 commit comments

Comments
 (0)