📅  最后修改于: 2022-03-11 14:48:15.938000             🧑  作者: Mango
const StyledComponent = styled.div`
background: black;
color: white;
`;
const StyledComponentWithParams = styled.div<{ color?: string }>`
background: yellow;
color: ${(color) => (color ? "yellow" : "white")};
`;
const StyledComponentDefaultValueParams = styled.div<{ color?: string }>`
background: yellow;
color: ${(color = "white") => (color)};
`;