Skip to content

Commit

Permalink
fix: opacity style
Browse files Browse the repository at this point in the history
  • Loading branch information
Zephyruso committed Jan 6, 2025
1 parent 1bdcd15 commit 079fd45
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
29 changes: 18 additions & 11 deletions src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,37 @@
@layer components {
.card,
.collapse {
background-color: var(--fallback-b1, oklch(var(--b1)));
background-color: var(--fallback-b1, oklch(var(--b1) / var(--tw-bg-opacity, 1)));
@apply rounded-xl shadow-md;
}

.table tr {
@apply border-b-0;
}
}

@for $i from 0 to 100 {
.custom-background.custom-background-$(i) {
.bg-base-100,
.bg-base-200,
.bg-neutral,
.card,
.collapse,
.bg-base-100,
.table {
background-color: var(--fallback-b1, oklch(var(--b1) / calc($(i) / 100)));
.table,
.drawer-side,
.tabs,
.input,
.btn,
.select,
.menu .active,
.table tbody tr {
--tw-border-opacity: calc($(i) / 100);
--tw-bg-opacity: calc($(i) / 100);
}

.drawer-content.bg-base-200\/40 {
background-color: transparent;
}

.drawer-side,
.tabs,
.bg-base-200,
.table tbody tr:nth-child(even) {
background-color: var(--fallback-b2, oklch(var(--b2) / calc($(i) / 100)));
}
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/components/connections/ConnectionTable.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<template>
<div
ref="parentRef"
class="h-full overflow-y-auto p-2"
class="h-full overflow-y-auto bg-clip-content p-2"
>
<div :style="{ height: `${totalSize}px` }">
<table :class="`table table-zebra bg-base-100 ${sizeOfTable} rounded-none shadow-md`">
<table :class="`table table-zebra ${sizeOfTable} rounded-none shadow-md`">
<thead class="sticky -top-2 z-10 bg-base-100">
<tr
v-for="headerGroup in table.getHeaderGroups()"
v-for="headerGroup in tanstackTable.getHeaderGroups()"
:key="headerGroup.id"
>
<th
Expand Down Expand Up @@ -58,7 +58,7 @@
height: `${virtualRow.size}px`,
transform: `translateY(${virtualRow.start - index * virtualRow.size}px)`,
}"
class="hover:!bg-primary hover:text-primary-content"
class="bg-base-100 hover:!bg-primary hover:text-primary-content"
>
<td
v-for="cell in rows[virtualRow.index].getVisibleCells()"
Expand Down Expand Up @@ -321,7 +321,7 @@ const grouping = ref<GroupingState>([])
const expanded = ref<ExpandedState>({})
const sorting = useStorage<SortingState>('config/table-sorting', [])
const table = useVueTable({
const tanstackTable = useVueTable({
get data() {
return renderConnections.value
},
Expand Down Expand Up @@ -374,7 +374,7 @@ const table = useVueTable({
})
const rows = computed(() => {
return table.getRowModel().rows
return tanstackTable.getRowModel().rows
})
const parentRef = ref<HTMLElement | null>(null)
Expand Down

0 comments on commit 079fd45

Please sign in to comment.