I'm trying to fit an image into Vuetify's VBtn
component, like this-
<template>
<v-btn>
<img class="img-in-btn" src="@/assets/my-image.png">
</v-btn>
</template>
If I use the v-img
and do it like-
<v-img :src="my-img" height="100%" width="100%" />
It still results in a very wide button and a huge image.
My current attempt is to grab VBtn
's dimensions directly from Vuetify's stylesheet, and apply it directly to image class selector like this-
<style lang="scss" scoped>
@import '~vuetify/src/components/VBtn/_variables.scss';
.img-in-btn {
height: $btn-sizes;
object-fit: contain;
}
</style>
But this throws an error-
SassError: ("x-small": 20, "small": 28, "default": 36, "large": 44, "x-large": 52) isn't a valid CSS value.
What's the proper way of doing this?