Skip to content

Commit 63524f1

Browse files
authored
Merge pull request #268 from MITLibraries/use-61-tabs
Style tabs to match designs
2 parents 131dabf + a81db4d commit 63524f1

File tree

3 files changed

+62
-12
lines changed

3 files changed

+62
-12
lines changed

app/assets/stylesheets/partials/_search.scss

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,52 @@
197197
color: #fff;
198198
}
199199

200-
/* temp style to visualize active tab. Save us from this Dave! */
201-
#tabs .active{
202-
background-color: red;
203-
}
200+
/* =========== */
201+
/* New Tab Bar */
202+
/* =========== */
203+
204+
#tabs {
205+
margin-top: 0;
206+
207+
ul {
208+
list-style-type: none;
209+
padding: 0;
210+
margin: 0;
211+
display: flex;
212+
gap: 4px;
213+
}
214+
215+
a {
216+
padding: 12px 20px 16px;
217+
background-color: transparent;
218+
color: $color-text-oncolor;
219+
display: inline-block;
220+
font-weight: $fw-medium;
221+
222+
border: 2px solid transparent;
223+
border-bottom: 0;
224+
225+
text-decoration: underline;
226+
text-decoration-color: $color-red-500;
227+
text-underline-offset: 0.5rem;
228+
229+
&:hover {
230+
border-color: $color-gray-700;
231+
background-color: $color-gray-900;
232+
}
233+
234+
&.active {
235+
background-color: $color-white;
236+
color: $color-text-primary;
237+
text-decoration: none;
238+
239+
&:hover {
240+
color: $color-text-primary;
241+
border-color: transparent;
242+
}
243+
}
244+
245+
246+
}
247+
248+
}

app/assets/stylesheets/partials/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ $color-text-primary: $color-gray-950;
4141
$color-text-secondary: $color-gray-700;
4242
$color-text-placeholder: $color-gray-500;
4343
$color-text-disabled: $color-gray-400;
44+
$color-text-oncolor: $color-white;
4445

4546
// FOCUS
4647
$color-focus: $color-cyan-700;
Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
<!-- Tab Navigation -->
2-
<div id="tabs" class="tab-navigation top-space">
3-
<%= link_to "Primo", results_path(params.permit(:q, :per_page, :booleanType, :tab).merge(tab: 'primo')),
4-
class: "tab-link #{'active' if @active_tab == 'primo'}",
5-
data: { turbo_frame: "search-results", turbo_action: "advance" } %>
6-
<%= link_to "TIMDEX", results_path(params.permit(:q, :per_page, :booleanType, :tab).merge(tab: 'timdex')),
7-
class: "tab-link #{'active' if @active_tab == 'timdex'}",
8-
data: { turbo_frame: "search-results", turbo_action: "advance" } %>
9-
</div>
2+
<nav id="tabs" class="tab-navigation" aria-label="Result type navigation">
3+
<ul>
4+
<li>
5+
<%= link_to "Primo", results_path(params.permit(:q, :per_page, :booleanType, :tab).merge(tab: 'primo')),
6+
class: "tab-link #{'active' if @active_tab == 'primo'}",
7+
data: { turbo_frame: "search-results", turbo_action: "advance" } %></li>
8+
<li>
9+
<%= link_to "TIMDEX", results_path(params.permit(:q, :per_page, :booleanType, :tab).merge(tab: 'timdex')),
10+
class: "tab-link #{'active' if @active_tab == 'timdex'}",
11+
data: { turbo_frame: "search-results", turbo_action: "advance" } %></li>
12+
</ul>
13+
</nav>
1014

0 commit comments

Comments
 (0)