Skip to content

Commit

Permalink
fix: stripe table style for element plus, fixed: #4501 (#4503)
Browse files Browse the repository at this point in the history
  • Loading branch information
mynetfan authored Sep 25, 2024
1 parent bb6057c commit 476aa06
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/web-ele/src/views/demos/element/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
ElMessage,
ElNotification,
ElSpace,
ElTable,
} from 'element-plus';
type NotificationType = 'error' | 'info' | 'success' | 'warning';
Expand Down Expand Up @@ -38,6 +39,14 @@ function notify(type: NotificationType) {
type,
});
}
const tableData = [
{ prop1: '1', prop2: 'A' },
{ prop1: '2', prop2: 'B' },
{ prop1: '3', prop2: 'C' },
{ prop1: '4', prop2: 'D' },
{ prop1: '5', prop2: 'E' },
{ prop1: '6', prop2: 'F' },
];
</script>

<template>
Expand Down Expand Up @@ -74,5 +83,11 @@ function notify(type: NotificationType) {
<ElButton type="success" @click="notify('success')"> 成功 </ElButton>
</ElSpace>
</ElCard>
<ElCard class="mb-5">
<ElTable :data="tableData" stripe>
<ElTable.TableColumn label="测试列1" prop="prop1" />
<ElTable.TableColumn label="测试列2" prop="prop2" />
</ElTable>
</ElCard>
</Page>
</template>
1 change: 1 addition & 0 deletions internal/tailwind-config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const shadcnUiColors = {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))',
hover: 'hsl(var(--accent-hover))',
lighter: 'has(val(--accent-lighter))',
},
background: {
deep: 'hsl(var(--background-deep))',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

/* Used for accents such as hover effects on <DropdownMenuItem>, <SelectItem>...etc */
--accent: 216 5% 19%;
--accent-lighter: 216 5% 11%;
--accent-hover: 216 5% 24%;
--accent-foreground: 0 0% 98%;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@

/* Used for accents such as hover effects on <DropdownMenuItem>, <SelectItem>...etc */
--accent: 240 5% 96%;
--accent-lighter: 240 0% 98%;
--accent-hover: 200deg 10% 90%;
--accent-foreground: 240 6% 10%;

Expand Down
1 change: 1 addition & 0 deletions packages/effects/hooks/src/use-design-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ export function useElementPlusDesignTokens() {
'--el-fill-color': getCssVariableValue('--accent'),
'--el-fill-color-blank': background,
'--el-fill-color-light': getCssVariableValue('--accent'),
'--el-fill-color-lighter': getCssVariableValue('--accent-lighter'),
'--el-text-color-primary': getCssVariableValue('--foreground'),

'--el-text-color-regular': getCssVariableValue('--foreground'),
Expand Down

0 comments on commit 476aa06

Please sign in to comment.