[英]vscode tailwind CSS how to have all colors in intellisense? (like `bg-sky`)
您可以通过将这些顺风 colors 导入并将它们添加到tailwind.config
中的默认调色板来获得智能感知,如下所示:
const colors = require('tailwindcss/colors')
module.exports = {
theme: {
colors: {
transparent: 'transparent',
current: 'currentColor',
black: colors.black,
white: colors.white,
gray: colors.slate,
green: colors.emerald,
purple: colors.violet,
yellow: colors.amber,
pink: colors.fuchsia,
},
},
}
有关参考,请参阅https://tailwindcss.com/docs/customizing-colors#aliasing-color-names
如果需要,您还可以扩展这些 colors,这样您就不必将每种颜色都添加到默认值中。
module.exports = {
theme: {
extend: {
colors: {
sky: colors.sky
}
},
},
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.