From 1b1c13b8cf6b07fbefa7eccf48e5aa940b6ff090 Mon Sep 17 00:00:00 2001 From: Lucas Larroche Date: Mon, 8 Nov 2021 00:03:24 +0700 Subject: [PATCH] Fix: Exclude tooltip animation on touch screens --- scss/utilities/_tooltip.scss | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/scss/utilities/_tooltip.scss b/scss/utilities/_tooltip.scss index 16bd1a33..8c56c0b4 100644 --- a/scss/utilities/_tooltip.scss +++ b/scss/utilities/_tooltip.scss @@ -48,21 +48,29 @@ color: var(--tooltip-background-color); } + // Display &:focus, &:hover { &::before, &::after { opacity: 1; - - @if $enable-transitions { - animation-duration: .2s; - animation-name: slide; - } } + } - &::after { - @if $enable-transitions { - animation-name: slideCaret; + // Animations, excluding touch devices + @if $enable-transitions { + @media (hover: hover) and (pointer: fine) { + &:focus, + &:hover { + &::before, + &::after { + animation-duration: .2s; + animation-name: slide; + } + + &::after { + animation-name: slideCaret; + } } } }