I would like to be able to add a custom color as a background to my table in vue
This is my .vue file:
<template>
....
<b-table small :fields="fields" :items="items">
<template #cell(name)="data">
<b>{{ data.value.name }}</b>
</template>
....
</b-table>
....
<template>
<script>
export default {
data () {
return {
items: [
{ name: { name: '....', url: '....' }, utility: '....', icon: '../assets/.....png', _rowVariant: 'light' },
{ name: { name: '....', url: '....' }, utility: '....', icon: '../assets/.....png', _rowVariant: 'success' },
{ name: { name: '....', url: '....' }, utility: '....', icon: '../assets/.....png', _rowVariant: 'danger' },
{ name: { name: '....', url: '....' }, utility: '....', icon: '../assets/.....png', _rowVariant: 'custom-one' }
],
tableVariants: ['primary', 'secondary', 'info', 'danger', 'warning', 'success', 'light', 'dark','custom-one', 'custom-two', 'custom-three' ],
..........
</script>
<style lang="scss" scoped>
@import '../scss/custom.scss';
.........
</style>
As you can see i'm trying to import from the $theme-colors declaring within the Array tableVariant.
my custom.scss file:
$purple: #6f42c1 !default;
$porpora: #75151e !default;
$orange: #fd7e14 !default;
$theme-colors:(
"custom-one": $orange,
"custom-two": $purple,
"custom-three": $porpora
);
@import "../../node_modules/bootstrap/scss/bootstrap";
How can I add a _rowVariant custom color? Thanks!
custom.scssfile in a component, instead of globally?