Skip to content

Commit 3d625c0

Browse files
table improved for dark theme
1 parent 6c5f8a1 commit 3d625c0

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

demo/assets/index-50296fb8.js renamed to demo/assets/index-fb2f02ba.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77

88
<title>Vue 3 Tailwind Components</title>
9-
<script type="module" crossorigin src="./assets/index-50296fb8.js"></script>
9+
<script type="module" crossorigin src="./assets/index-fb2f02ba.js"></script>
1010
<link rel="stylesheet" href="./assets/index-869e2aea.css">
1111
</head>
1212
<body class="">

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue3-tailwind-components",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "A library of Vue 3 components that use Tailwind",
55
"keywords": [
66
"vue3",

src/components/collapse/TwCollapse.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</div>
1919
<!-- Panel -->
2020
<div v-if="open"
21-
class="z-50 bg-white mt-1 animate-in slide-in-from-top-16 fade-in-20 text-left text-sm ">
21+
class="z-50 mt-1 animate-in slide-in-from-top-16 fade-in-20 text-left text-sm ">
2222
<slot>
2323

2424
</slot>

src/components/table/TwTable.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
2-
<table class="border-collapse table-auto w-full text-sm">
3-
<thead :class="headingClass" class=" text-gray-800 ">
2+
<table class="border-collapse table-auto w-full text-sm bo">
3+
<thead :class="headingClass" class=" text-primary-800 ">
44
<tr>
55
<th class="p-2 font-normal" v-for="h in headings">{{ h.label }}</th>
66
</tr>
77
</thead>
8-
<tbody class="text-gray-600">
8+
<tbody class="text-primary-600 dark:text-primary-100">
99
<tr v-for="(item,index) in items" :key="index" :class="rowClass(index)" class="transition-colors" >
10-
<td :class="boarderClass" class=" p-2" v-for="cell in headings">
10+
<td :class="boarderClass" class="p-2 text-primary-600 dark:text-primary-100" v-for="cell in headings">
1111
<slot :name="cell.field" :item="item">
1212
{{ item[cell.field] }}
1313
</slot>
@@ -69,17 +69,17 @@ export default {
6969
},
7070
computed: {
7171
headingClass() {
72-
return 'bg-'+this.headingColor+'-200 dark:bg-'+this.headingColor+'-900 dark:text-'+this.headingColor+'-200'
72+
return 'bg-'+this.headingColor+'-200 dark:bg-'+this.headingColor+'-700 dark:text-'+this.headingColor+'-200'
7373
},
7474
boarderClass() {
75-
return this.border ? 'border border-' + this.borderColor+'-200 dark:border-'+this.borderColor+'-900': '';
75+
return this.border ? 'border border-' + this.borderColor+'-200 dark:border-'+this.borderColor+'-700': '';
7676
},
7777
},
7878
methods: {
7979
rowClass(ndx) {
8080
let h = this.hover ?' hover:bg-'+this.hoverColor+'-300 dark:hover:bg-'+this.hoverColor+'-700 dark:hover:text-white':''
8181
if(this.selectedIndex === ndx) h = ' bg-'+this.selectColor+'-300 dark:bg-'+this.selectColor+'-400'
82-
if(this.striped && this.selectedIndex !== ndx) return ndx % 2 !== 0 ? 'bg-'+this.stripeColor+'-100 dark:bg-'+this.stripeColor+'-800 dark:text-gray-200'+h: ' dark:text-gray-700 '+h;
82+
if(this.striped && this.selectedIndex !== ndx) return ndx % 2 !== 0 ? 'bg-'+this.stripeColor+'-100 dark:bg-'+this.stripeColor+'-800 dark:text-primary-200'+h: ' dark:text-primary-700 '+h;
8383
8484
return h+' dark:text-gray-700'
8585
}

0 commit comments

Comments
 (0)