Skip to content

Commit

Permalink
feat: add row color variants
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Oct 24, 2023
1 parent 46e814e commit 6a8072c
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
19 changes: 17 additions & 2 deletions packages/table/src/VDataTable.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ export const StickyColumn: StoryFn<typeof VDataTable> = (args) => ({
`,
});

export const DarkMode: Story<{}> = (args) => ({
export const DarkMode: StoryFn<typeof VDataTable> = (args) => ({
components: { VDataTable },
setup() {
return { args };
Expand All @@ -457,7 +457,22 @@ export const DarkMode: Story<{}> = (args) => ({
`,
});

export const ItemSlot: Story<{}> = (args) => ({
export const RowColors: StoryFn<typeof VDataTable> = (args) => ({
components: { VDataTable },
setup() {
return { args };
},
template: `
<VDataTable
v-bind="args"
:trClass="[
'v-table-tr--primary',
]"
/>
`,
});

export const ItemSlot: StoryFn<typeof VDataTable> = (args) => ({
components: { VDataTable },
setup() {
return { args };
Expand Down
28 changes: 28 additions & 0 deletions packages/themes/src/morpheme/_data-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,34 @@

&-tr {
background-color: var(--v-table-tr-bg-color);

&--primary {
--v-table-td-bg-color: var(--color-primary-50);
}

&--secondary {
--v-table-td-bg-color: var(--color-secondary-50);
}

&--success {
--v-table-td-bg-color: var(--color-success-50);
}

&--error {
--v-table-td-bg-color: var(--color-error-50);
}

&--warning {
--v-table-td-bg-color: var(--color-warning-50);
}

&--info {
--v-table-td-bg-color: var(--color-info-50);
}

&--dark {
--v-table-td-bg-color: var(--color-gray-50);
}
}

/* striped */
Expand Down

0 comments on commit 6a8072c

Please sign in to comment.