TailwindCSS 中如何设置多个背景色

Tags
Published
Author
tailwind 在写使用了背景图和全局设置的背景色时,我们最好这么来写,网上提供的方法不是很方便。
<script setup lang="ts"></script> <template> <section class="text-center text-white"> <div class="container"> <div class="py-16" :class="$style.bg" > <slot /> </div> </div> </section> </template> <style module> .bg { background: url('~/assets/images/products/contactus-bg.svg') no-repeat center/cover, theme('backgroundImage.gradient-bg-deep-blue-45'); } </style>