我是tailwind.config.js
这样使用的:
export default {
theme: {
extend: {
fontSize: {
'heading-banner-title': ['88px', { lineHeight: '100px', fontWeight: '700' }],
},
},
},
};
现在我想在 Tailwind v4 中使用相同的配置,但使用@theme
:
@theme {
--text-heading-banner-title: 88px; /* I also want to add line-height and font-weight */
}
以前,我使用以下风格:
.text-heading-banner-title {
@apply text-[88px] leading-[100px] font-bold;
}
但是,当使用此方法时,响应前缀(例如sm:text-heading-banner-title
)无法按预期工作。