Konsta UI のマテリアルテーマには、マテリアルデザインのタッチリップル効果の実装が付属しています。
マテリアルテーマではデフォルトで有効になっています。
これらの追加のユーティリティクラスを使用して、タッチリップルの「波」の色を制御できます。
クラス | 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) | 指定された色のタッチリップルを作成します。 |
例
<template>
<!-- Makes button with red touch ripple -->
<k-button class="touch-ripple-red-500">Click me</k-button>
</template>
<script>
import { kButton } from 'konsta/vue';
export default {
components: {
kButton,
},
};
</script>