Skip to content

Commit 6143043

Browse files
authored
Merge pull request #136 from nih-sparc/Update-content-tab-card
Updated content tab card style
2 parents e2f75c5 + d9b28a6 commit 6143043

File tree

4 files changed

+14
-41
lines changed

4 files changed

+14
-41
lines changed

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nih-sparc/sparc-design-system-components",
3-
"version": "0.27.1",
3+
"version": "0.27.2",
44
"private": false,
55
"scripts": {
66
"serve": "vue-cli-service serve",
@@ -61,9 +61,6 @@
6161
"vue-cli-plugin-storybook": "~1.3.0",
6262
"vue-template-compiler": "^2.6.11"
6363
},
64-
"peerDependencies": {
65-
"vue": "^2.6.11"
66-
},
6764
"eslintConfig": {
6865
"root": true,
6966
"env": {

src/components/ContentTabCard/src/ContentTabCard.vue

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
<template>
22
<div>
3-
<el-row :class="[tabStyle, 'tabs-container']">
4-
<el-col class="tabs-column">
3+
<div :class="[tabStyle]">
54
<span :class="[tabStyle, 'link-container']" v-for="tab in tabs" :key="tab.label">
65
<!-- Expect this to be either nuxt-link or router-link -->
76
<component v-if="linkComponent"
87
:is="linkComponent"
98
:to="{ query: queryParams(tab.id) }"
109
@click.native="$emit('tab-changed', tab)"
11-
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link px-8']"
10+
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link p-8']"
1211
>
1312
{{ tab.label }}
1413
</component>
1514
<a v-else-if="tab.href"
16-
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link px-8']"
15+
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link p-8']"
1716
:href="tab.href"
1817
target="_blank"
1918
>
2019
{{ tab.label }}
2120
</a>
2221
<a
2322
v-else
24-
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link px-8']"
23+
:class="[{ active: tab.id === activeTabId }, tabStyle, tabClass, 'tab-link p-8']"
2524
@click.prevent="$emit('tab-changed', tab)"
2625
>
2726
{{ tab.label }}
2827
</a>
2928
</span>
30-
</el-col>
31-
</el-row>
32-
<div class="content pt-16">
29+
</div>
30+
<div class="content mt-8 p-16">
3331
<slot />
3432
</div>
3533
</div>
@@ -84,26 +82,20 @@ export default {
8482

8583
<style lang="scss" scoped>
8684
@import '../../../assets/_variables.scss';
87-
85+
.style1 {
86+
line-height: normal;
87+
}
8888
.tab-link {
8989
text-decoration: none;
9090
flex-wrap: nowrap;
91+
border: 1px solid $lineColor1;
9192
cursor: pointer;
92-
&.style1, &.style3 {
93-
border-bottom: .125em solid $lineColor1;
94-
}
95-
&.style1, &.style2 {
96-
margin-right: 2rem;
97-
padding-bottom: .12em;
98-
}
99-
&.style3 {
100-
margin-right: .5rem;
101-
padding-bottom: .2em;
102-
}
10393
&:hover, &.active {
10494
&.style1, &.style3 {
95+
border: 1px solid $purple;
10596
border-bottom: .125em solid $purple;
10697
color: $purple;
98+
background-color: #f9f2fc;
10799
font-weight: 500;
108100
}
109101
&.style2 {
@@ -112,22 +104,8 @@ export default {
112104
}
113105
}
114106
}
115-
.tabs-column {
116-
.link-container:last-child > .tab-link {
117-
margin-right: 0;
118-
}
119-
}
120-
.tabs-container {
121-
display: block;
122-
&.style1, &.style3 {
123-
border-bottom: .125em solid $lineColor1;
124-
}
125-
&.style2 {
126-
background-color: $darkBlue;
127-
padding: 1.5rem;
128-
}
129-
}
130107
.content {
108+
border: 1px solid $lineColor1;
131109
overflow: auto;
132110
}
133111
</style>

src/stories/contentTabCard/contentTabCard.stories.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const createDemo = (contentTabCardItem) => {
2828
<div
2929
v-for="tab in tabs"
3030
:key="tab.id"
31-
class="m-8"
3231
>
3332
<div
3433
v-show="activeTabId === tab.id"

src/stories/contentTabCard/contentTabCard.stories.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ methods: {
7171
<div
7272
v-for="tab in tabs"
7373
:key="tab.id"
74-
class="m-8"
7574
>
7675
<div
7776
v-show="activeTabId === tab.id"

0 commit comments

Comments
 (0)