In my b-table i have a function that colors the rows based on a property :
<template>
<b-table sticky-header="70vh" bordered striped
:items="logs"
:fields="fields"
@row-clicked="showLogDetails"
selectable
select-mode="single"
:tbody-tr-class="colorRowByCode"/>
</template>
methods: {
colorRowByCode(item, type){
if (!item || type !== 'row') return
if(item.level === 'Critical') return 'table-danger'
if(item.level === 'Warning') return 'table-warning'
if(item.level === 'Error') return 'table-primary'
}
}
As you can see i return table-primary, let's say i wanna change this color to #FFDEB9
I followed these documentations : https://getbootstrap.com/docs/4.0/getting-started/theming/
https://github.com/bootstrap-vue/bootstrap-vue/issues/1395
https://bootstrap-vue.org/docs/reference/theming
So i created a custom.scss file in my assets
and added this to my App.vue :
<style lang="scss">
@import "assets/custom.scss";
@import "~bootstrap/scss/bootstrap.scss";
@import '~bootstrap-vue/dist/bootstrap-vue.css';
</style>
in my custom.scss i tried multiple things out like :
$table-primary: #FFDEB9 !default;
table-primary{
color: theme-colors(#FFDEB9);
}
$theme-colors: (
"primary": #FFDEB9,
"table-primary": #FFDEB9
);
table-primary{
color: #FFDEB9
}
without success, when i click on a row in the HTML explorer, all i see is that it has a class table-primary
How can i achieve this ? I really need differents colors for my table rows. Thanks a lot