Skip to content

Commit

Permalink
Merge pull request #137 from nih-sparc/update-contant-tab-card-backgr…
Browse files Browse the repository at this point in the history
…ound

Updated content tab card background color
  • Loading branch information
egauzens authored Sep 30, 2023
2 parents 6143043 + b9294eb commit 0b58034
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 29 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nih-sparc/sparc-design-system-components",
"version": "0.27.2",
"version": "0.27.3",
"private": false,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
61 changes: 33 additions & 28 deletions src/components/ContentTabCard/src/ContentTabCard.vue
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
<template>
<div>
<div :class="[tabStyle]">
<span :class="[tabStyle, 'link-container']" v-for="tab in tabs" :key="tab.label">
<!-- Expect this to be either nuxt-link or router-link -->
<component v-if="linkComponent"
:is="linkComponent"
:to="{ query: queryParams(tab.id) }"
@click.native="$emit('tab-changed', tab)"
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link p-8']"
>
{{ tab.label }}
</component>
<a v-else-if="tab.href"
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link p-8']"
:href="tab.href"
target="_blank"
>
{{ tab.label }}
</a>
<a
v-else
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link p-8']"
@click.prevent="$emit('tab-changed', tab)"
>
{{ tab.label }}
</a>
</span>
</div>
<div class="card-container">
<span :class="[tabStyle, 'link-container']" v-for="tab in tabs" :key="tab.label">
<!-- Expect this to be either nuxt-link or router-link -->
<component v-if="linkComponent"
:is="linkComponent"
:to="{ query: queryParams(tab.id) }"
@click.native="$emit('tab-changed', tab)"
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link p-8']"
>
{{ tab.label }}
</component>
<a v-else-if="tab.href"
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link p-8']"
:href="tab.href"
target="_blank"
>
{{ tab.label }}
</a>
<a
v-else
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link p-8']"
@click.prevent="$emit('tab-changed', tab)"
>
{{ tab.label }}
</a>
</span>
<div class="content mt-8 p-16">
<slot />
</div>
Expand Down Expand Up @@ -106,6 +104,13 @@ export default {
}
.content {
border: 1px solid $lineColor1;
background-color: white;
overflow: auto;
}
.tab-link {
background-color: white;
}
.card-container {
line-height: normal;
}
</style>

0 comments on commit 0b58034

Please sign in to comment.