Skip to content

Commit

Permalink
add primary style to VsTable
Browse files Browse the repository at this point in the history
  • Loading branch information
yeriiiii committed Jan 9, 2025
1 parent 5cb5958 commit 91b16dd
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
32 changes: 32 additions & 0 deletions packages/vlossom/src/components/vs-table/VsTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,38 @@ $tableBorder: var(--vs-table-border, 1px solid var(--vs-line-color));
}
}

.vs-table.vs-primary .vs-table-wrap .vs-table-table {
.vs-table-thead .vs-table-tr {
background-color: var(--vs-table-headerBackgroundColor, var(--vs-primary-comp-bg));

.vs-table-th {
color: var(--vs-table-headerFontColor, var(--vs-primary-comp-font));
border: var(--vs-table-headerBorder, 1px solid var(--vs-primary-comp-bg));

&.vs-table-selectable-th .vs-checkbox-input {
border: 1px dotted var(--vs-primary-comp-font);
}

.vs-table-search-icon {
color: var(--vs-primary-comp-font);
}
}
}

.vs-table-tbody .vs-table-tr {
.vs-table-td {
&.vs-table-expandable-td {
.vs-table-expand-button {
i {
color: var(--vs-table-headerFontColor, var(--vs-primary-comp-font));
}
background-color: var(--vs-table-headerBackgroundColor, var(--vs-primary-comp-bg));
}
}
}
}
}

@container (max-width: 640px) {
.vs-table.vs-responsive .vs-table-wrap {
.vs-table-table .vs-table-thead .vs-table-tr {
Expand Down
3 changes: 2 additions & 1 deletion packages/vlossom/src/components/vs-table/VsTable.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<vs-responsive
:class="['vs-table', colorSchemeClass, { 'vs-dense': dense, 'vs-responsive': responsive }]"
:class="['vs-table', colorSchemeClass, { 'vs-dense': dense, 'vs-responsive': responsive, 'vs-primary': primary }]"

Check warning on line 3 in packages/vlossom/src/components/vs-table/VsTable.vue

View workflow job for this annotation

GitHub Actions / lint

This line has a length of 122. Maximum allowed is 120
:style="computedStyleSet"
:width="width"
:grid="grid"
Expand Down Expand Up @@ -152,6 +152,7 @@ export default defineComponent({
default: () => DEFAULT_TABLE_PAGE_COUNT,
},
pageEdgeButtons: { type: Boolean, default: false },
primary: { type: Boolean, default: false },
search: { type: Boolean, default: false },
searchPlaceholder: { type: String, default: 'search' },
searchText: { type: String, default: '' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,28 @@ export const ResponsiveFalse: Story = {
},
};

export const Primary: Story = {
render: (args: any) => ({
components: { VsTable },
setup() {
return { args };
},
template: `
<div>
${getColorSchemeTemplate(`
<vs-table color-scheme="{{ color }}" v-bind="args" :style="{ marginBottom: '20px' }"/>
`)}
</div>
`,
}),
args: {
primary: true,
},
parameters: {
chromatic: chromaticParameters.theme,
},
};

export const StyleSet: Story = {
args: {
styleSet: {
Expand Down

0 comments on commit 91b16dd

Please sign in to comment.