Skip to content

Commit b8f4a53

Browse files
author
Guillaume Chau
committed
Updated CSS examples with tooltip arrow
1 parent b82c880 commit b8f4a53

File tree

1 file changed

+132
-4
lines changed

1 file changed

+132
-4
lines changed

README.md

Lines changed: 132 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ VTooltip.enabled = window.innerWidth > 768
197197
```less
198198
.tooltip {
199199
display: block !important;
200-
padding: 4px;
201200
z-index: 10000;
202201

203202
.tooltip-inner {
@@ -208,7 +207,72 @@ VTooltip.enabled = window.innerWidth > 768
208207
}
209208

210209
.tooltip-arrow {
211-
display: none;
210+
width: 0;
211+
height: 0;
212+
border-style: solid;
213+
position: absolute;
214+
margin: 5px;
215+
border-color: black;
216+
}
217+
218+
&[x-placement^="top"] {
219+
margin-bottom: 5px;
220+
221+
.tooltip-arrow {
222+
border-width: 5px 5px 0 5px;
223+
border-left-color: transparent !important;
224+
border-right-color: transparent !important;
225+
border-bottom-color: transparent !important;
226+
bottom: -5px;
227+
left: calc(50% - 5px);
228+
margin-top: 0;
229+
margin-bottom: 0;
230+
}
231+
}
232+
233+
&[x-placement^="bottom"] {
234+
margin-top: 5px;
235+
236+
.tooltip-arrow {
237+
border-width: 0 5px 5px 5px;
238+
border-left-color: transparent !important;
239+
border-right-color: transparent !important;
240+
border-top-color: transparent !important;
241+
top: -5px;
242+
left: calc(50% - 5px);
243+
margin-top: 0;
244+
margin-bottom: 0;
245+
}
246+
}
247+
248+
&[x-placement^="right"] {
249+
margin-left: 5px;
250+
251+
.tooltip-arrow {
252+
border-width: 5px 5px 5px 0;
253+
border-left-color: transparent !important;
254+
border-top-color: transparent !important;
255+
border-bottom-color: transparent !important;
256+
left: -5px;
257+
top: calc(50% - 5px);
258+
margin-left: 0;
259+
margin-right: 0;
260+
}
261+
}
262+
263+
&[x-placement^="left"] {
264+
margin-right: 5px;
265+
266+
.tooltip-arrow {
267+
border-width: 5px 0 5px 5px;
268+
border-top-color: transparent !important;
269+
border-right-color: transparent !important;
270+
border-bottom-color: transparent !important;
271+
right: -5px;
272+
top: calc(50% - 5px);
273+
margin-left: 0;
274+
margin-right: 0;
275+
}
212276
}
213277

214278
&[aria-hidden='true'] {
@@ -230,7 +294,6 @@ VTooltip.enabled = window.innerWidth > 768
230294
```css
231295
.tooltip {
232296
display: block !important;
233-
padding: 4px;
234297
z-index: 10000;
235298
}
236299

@@ -242,7 +305,72 @@ VTooltip.enabled = window.innerWidth > 768
242305
}
243306

244307
.tooltip .tooltip-arrow {
245-
display: none;
308+
width: 0;
309+
height: 0;
310+
border-style: solid;
311+
position: absolute;
312+
margin: 5px;
313+
border-color: black;
314+
}
315+
316+
.tooltip[x-placement^="top"] {
317+
margin-bottom: 5px;
318+
}
319+
320+
.tooltip[x-placement^="top"] .tooltip-arrow {
321+
border-width: 5px 5px 0 5px;
322+
border-left-color: transparent !important;
323+
border-right-color: transparent !important;
324+
border-bottom-color: transparent !important;
325+
bottom: -5px;
326+
left: calc(50% - 5px);
327+
margin-top: 0;
328+
margin-bottom: 0;
329+
}
330+
331+
.tooltip[x-placement^="bottom"] {
332+
margin-top: 5px;
333+
}
334+
335+
.tooltip[x-placement^="bottom"] .tooltip-arrow {
336+
border-width: 0 5px 5px 5px;
337+
border-left-color: transparent !important;
338+
border-right-color: transparent !important;
339+
border-top-color: transparent !important;
340+
top: -5px;
341+
left: calc(50% - 5px);
342+
margin-top: 0;
343+
margin-bottom: 0;
344+
}
345+
346+
.tooltip[x-placement^="right"] {
347+
margin-left: 5px;
348+
}
349+
350+
.tooltip[x-placement^="right"] .tooltip-arrow {
351+
border-width: 5px 5px 5px 0;
352+
border-left-color: transparent !important;
353+
border-top-color: transparent !important;
354+
border-bottom-color: transparent !important;
355+
left: -5px;
356+
top: calc(50% - 5px);
357+
margin-left: 0;
358+
margin-right: 0;
359+
}
360+
361+
.tooltip[x-placement^="left"] {
362+
margin-right: 5px;
363+
}
364+
365+
.tooltip[x-placement^="left"] .tooltip-arrow {
366+
border-width: 5px 0 5px 5px;
367+
border-top-color: transparent !important;
368+
border-right-color: transparent !important;
369+
border-bottom-color: transparent !important;
370+
right: -5px;
371+
top: calc(50% - 5px);
372+
margin-left: 0;
373+
margin-right: 0;
246374
}
247375

248376
.tooltip[aria-hidden='true'] {

0 commit comments

Comments
 (0)