Tailwind CSS的配置的时候
theme.extend可以增量设置,不会覆盖默认值
// tailwind.config.js
const { platformSelect } = require("nativewind/theme");
module.exports = {
theme: {
extend: {
colors: {
error: platformSelect({
ios: "red",
android: "blue",
default: "green",
}),
},
},
},
};
贴一个自己写html时候使用的
html
<script>
tailwind.config = {
theme: {
extend: {
colors: {
primary: '#FF7D00',
secondary: '#FF9A33',
accent: '#FFB766',
dark: '#333333',
light: '#ffffff'
},
fontFamily: {
sans: ['Inter', 'system-ui', 'sans-serif'],
},
},
}
}
</script>