2021-05-25 21:37:14 +02:00
|
|
|
import OpenColor from "open-color";
|
|
|
|
|
|
|
|
import "./Card.scss";
|
|
|
|
|
|
|
|
export const Card: React.FC<{
|
2021-12-15 15:31:44 +01:00
|
|
|
color: keyof OpenColor | "primary";
|
2021-05-25 21:37:14 +02:00
|
|
|
}> = ({ children, color }) => {
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className="Card"
|
|
|
|
style={{
|
2021-12-15 15:31:44 +01:00
|
|
|
["--card-color" as any]:
|
|
|
|
color === "primary" ? "var(--color-primary)" : OpenColor[color][7],
|
|
|
|
["--card-color-darker" as any]:
|
|
|
|
color === "primary"
|
|
|
|
? "var(--color-primary-darker)"
|
|
|
|
: OpenColor[color][8],
|
|
|
|
["--card-color-darkest" as any]:
|
|
|
|
color === "primary"
|
|
|
|
? "var(--color-primary-darkest)"
|
|
|
|
: OpenColor[color][9],
|
2021-05-25 21:37:14 +02:00
|
|
|
}}
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|