我想创建一个组件
const StyledDiv = styled.div`
width: 10rem;
height: 3rem;
border-radius: 0.2rem;
background-color: ${({ theme, colorVariant, colorType }) => theme.colors[colorType].
[colorVariant]}
`;
但显示错误
类型“Pick,“slot”| 上不存在属性“colorVariant” “风格”| “标题” | ... 252 更多... | “css”> & { ...; } & ThemeProps<...>'.
这是我设置的主题
export default {
'colors' : {
'blue' : {
'100' : '#232f3e',
'200' : '#233d51',
'300' : '#006170',
'400' : '#008296',
'450' : '#008091',
'500' : '#d4e4e6',
'600' : '#e5f2f3',
},
'grey' : {
'600' : '#8ca1a3',
'700' : '#768283',
'800' : '#e7e9e9',
'900' : '#ffffff',
},
'red' : {
'1000' : '#b40909',
},
'green' : {
'1100' : '#417505',
},
'yellow' : {
'1200' : '#f5a623',
}
}
};