diff options
Diffstat (limited to 'packages/excalidraw/components/Card.tsx')
| -rw-r--r-- | packages/excalidraw/components/Card.tsx | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/excalidraw/components/Card.tsx b/packages/excalidraw/components/Card.tsx new file mode 100644 index 0000000..2ba5a97 --- /dev/null +++ b/packages/excalidraw/components/Card.tsx @@ -0,0 +1,28 @@ +import OpenColor from "open-color"; + +import "./Card.scss"; + +export const Card: React.FC<{ + color: keyof OpenColor | "primary"; + children?: React.ReactNode; +}> = ({ children, color }) => { + return ( + <div + className="Card" + style={{ + ["--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], + }} + > + {children} + </div> + ); +}; |
