🔥 認識我們的新專案 t0ggles - 您終極的專案管理工具! 🔥

觸控漣漪

Konsta UI 的 Material 主題包含了 Material Design 觸控漣漪效果的實作。

在 Material 主題中,它預設為啟用狀態。

透過這些額外的工具類別,我們可以控制觸控漣漪「波紋」的顏色

類別CSS
.touch-ripple-current--k-touch-ripple-color: rgba(0, 0, 0, 0.1)繼承父元素文字顏色的觸控漣漪顏色
.touch-ripple-black--k-touch-ripple-color: rgba(255, 255, 255, 0.15)將觸控漣漪設為黑色
.touch-ripple-white--k-touch-ripple-color: currentColor將觸控漣漪設為白色
.touch-ripple-[color]--k-touch-ripple-color: rgba([color], 0.25)將觸控漣漪設為指定的顏色

例如

<script>
  import { Button } from 'konsta/svelte';
</script>

<!-- Makes button with red touch ripple -->
<Button class="touch-ripple-red-500">Click me</Button>
程式碼授權於 MIT.
2022 © Konsta UI by nolimits4web.