[英]How to add custom class to with @apply (Tailwind) in Angular project?
Hi everyone, I have error in css file, with custorm tailwind class. How to fix it?大家好,我在 css 文件中有错误,custorm tailwind class。如何解决?
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{html,ts}'],
theme: {
extend: {},
},
plugins: [],
}
If I delete focus:shadow-outline
code, it's begin working如果我删除focus:shadow-outline
代码,它就会开始工作
shadow-outline
is a custom class. shadow-outline
是自定义的 class。
You must first define it before using it like this:您必须先定义它,然后再像这样使用它:
@layer components {
.shadow-outline {
@apply w-auto /*some classes*/;
}
.button {
@apply block uppercase mx-auto shadow bg-indigo-800 hover:bg-indigo-700 focus:shadow-outline focus:outline-none text-white text-xs py-3 px-10 rounded;
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.