Skip to content

Commit 371fd37

Browse files
committed
Custom class for tooltip to avoid overrides if v-tooltip it's been used in the proyect where the component is installed
1 parent cd5c79f commit 371fd37

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/FAB.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
>
1515
<template v-if="action.tooltip">
1616
<li v-if="toggle" :style="{ 'background-color': action.color || bgColor }"
17-
v-tooltip="{ content: action.tooltip, placement: tooltipPosition }"
17+
v-tooltip="{ content: action.tooltip, placement: tooltipPosition, classes: 'fab-tooltip' }"
1818
@click="toParent(action.name)" class="pointer">
1919
<i class="material-icons">{{action.icon}}</i>
2020
</li>
@@ -33,7 +33,7 @@
3333
<template v-if="rippleShow">
3434
<template v-if="mainTooltip">
3535
<div v-ripple="rippleColor == 'light' ? 'rgba(255, 255, 255, 0.35)' : ''" @click="toggle = !toggle"
36-
v-tooltip="{ content: mainTooltip, placement: tooltipPosition }"
36+
v-tooltip="{ content: mainTooltip, placement: tooltipPosition, classes: 'fab-tooltip' }"
3737
class="fab pointer" :style="{ 'background-color': bgColor }"
3838
>
3939
<i class="material-icons md-36 main" :class="{ rotate: toggle }">{{mainIcon}}</i>
@@ -51,7 +51,7 @@
5151
</template>
5252
<template v-else>
5353
<template v-if="mainTooltip">
54-
<div v-bind:v-tooltip="{ content: mainTooltip, placement: tooltipPosition }"
54+
<div v-bind:v-tooltip="{ content: mainTooltip, placement: tooltipPosition, classes: 'fab-tooltip'}"
5555
class="fab pointer" :style="{ 'background-color': bgColor }"
5656
>
5757
<i class="material-icons md-36 main" :class="{ rotate: toggle }">{{mainIcon}}</i>
@@ -218,30 +218,30 @@
218218
</script>
219219

220220
<style>
221-
.tooltip {
221+
.fab-tooltip.tooltip {
222222
display: block !important;
223223
padding: .5rem 1rem;
224224
z-index: 10000;
225225
}
226226
227-
.tooltip .tooltip-inner {
227+
.fab-tooltip.tooltip .tooltip-inner {
228228
background: #333333;
229229
font-size: .85rem;
230230
color: white;
231231
padding: .2rem 1rem;
232232
}
233233
234-
.tooltip .tooltip-arrow{
234+
.fab-tooltip.tooltip .tooltip-arrow{
235235
display: none;
236236
}
237237
238-
.tooltip[aria-hidden='true'] {
238+
.fab-tooltip.tooltip[aria-hidden='true'] {
239239
visibility: hidden;
240240
opacity: 0;
241241
transition: opacity .15s, visibility .15s;
242242
}
243243
244-
.tooltip[aria-hidden='false'] {
244+
.fab-tooltip.tooltip[aria-hidden='false'] {
245245
visibility: visible;
246246
opacity: 1;
247247
transition: opacity .15s;

0 commit comments

Comments
 (0)