🎨 (Table) Add contrast color for table
This commit is contained in:
@@ -63,7 +63,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot v-if="foot">
|
<tfoot v-if="foot">
|
||||||
<tr class="is-selected">
|
<tr
|
||||||
|
class="is-selected"
|
||||||
|
:style="{
|
||||||
|
'background-color': account.color,
|
||||||
|
color: findContrastColor(account.color)
|
||||||
|
}"
|
||||||
|
>
|
||||||
<td colspan="2" class="total">total</td>
|
<td colspan="2" class="total">total</td>
|
||||||
<td class="numeric">
|
<td class="numeric">
|
||||||
{{ total | moneypad(account.mainCurrency) }}
|
{{ total | moneypad(account.mainCurrency) }}
|
||||||
@@ -79,6 +85,7 @@
|
|||||||
import { Component, Prop, Vue } from 'vue-property-decorator'
|
import { Component, Prop, Vue } from 'vue-property-decorator'
|
||||||
import IAccount from '@/models/IAccount'
|
import IAccount from '@/models/IAccount'
|
||||||
import ITransaction from '@/models/ITransaction'
|
import ITransaction from '@/models/ITransaction'
|
||||||
|
import { findContrastColor } from '@/utils'
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
export default class AccountTransactionList extends Vue {
|
export default class AccountTransactionList extends Vue {
|
||||||
@@ -93,6 +100,7 @@ export default class AccountTransactionList extends Vue {
|
|||||||
@Prop({ type: Boolean, default: false })
|
@Prop({ type: Boolean, default: false })
|
||||||
public foot!: boolean
|
public foot!: boolean
|
||||||
public filteredBy: string = ''
|
public filteredBy: string = ''
|
||||||
|
public findContrastColor = findContrastColor
|
||||||
|
|
||||||
public get total(): number {
|
public get total(): number {
|
||||||
return this.transactions.reduce(
|
return this.transactions.reduce(
|
||||||
@@ -136,11 +144,6 @@ export default class AccountTransactionList extends Vue {
|
|||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
table tr.is-selected {
|
|
||||||
background-color: var(--primary-color);
|
|
||||||
color: var(--primary-font-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.multiline {
|
.multiline {
|
||||||
line-height: 15px;
|
line-height: 15px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user