【发布时间】:2021-03-04 03:10:25
【问题描述】:
如何使用插件重现以下 scss?
.large-title {
font-family: $font-family-2;
@apply leading-none;
color: $large-title-color;
@apply uppercase;
@apply text-xl;
// I don't know how to add these in the plugin
@apply sm:text-2xl;
@apply md:text-3xl;
@apply lg:text-4xl;
@apply xl:text-5xl;
}
在我的配置文件中,我目前有:
module.exports = {
[...]
plugins: [
require('@tailwindcss/forms'),
plugin(function({ addBase, config }) {
addBase({
'.large-title': {
fontFamily: [config('theme.fontFamily.family-2')],
fontSize: config('theme.fontSize.xl'),
lineHeight: config('theme.lineHeight.none'),
color: config('theme.colors.primary.900'),
textTransform: 'uppercase',
},
})
})
],
}
唯一缺少的是我不知道如何从插件中的类中添加响应式大小更改。
【问题讨论】:
-
也许这会有所帮助:Referencing the user's config
标签: tailwind-css