-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathHeader.css.ts
More file actions
47 lines (44 loc) · 1.29 KB
/
Header.css.ts
File metadata and controls
47 lines (44 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { ComplexStyleRule } from "@vanilla-extract/css";
import { recipe, RecipeVariants } from "@vanilla-extract/recipes";
import { color } from "../../theme/color.css";
import { toRem } from "../../theme/util";
import { DefaultReset } from "../reset.css";
import { ContainerColor } from "../types";
const getVariant = (variant: ContainerColor): ComplexStyleRule => ({
color: color[variant].OnContainer,
border: `0 solid ${color[variant].ContainerLine}`,
});
export const Header = recipe({
base: [
DefaultReset,
{
display: "flex",
alignItems: "center",
flexShrink: 0,
},
],
variants: {
variant: {
Background: getVariant("Background"),
Surface: getVariant("Surface"),
SurfaceVariant: getVariant("SurfaceVariant"),
Primary: getVariant("Primary"),
Secondary: getVariant("Secondary"),
Success: getVariant("Success"),
Warning: getVariant("Warning"),
Critical: getVariant("Critical"),
},
size: {
"300": { height: toRem(32) },
"400": { height: toRem(40) },
"500": { height: toRem(48) },
"600": { height: toRem(54) },
"700": { height: toRem(64) },
},
},
defaultVariants: {
variant: "Surface",
size: "400",
},
});
export type HeaderVariants = RecipeVariants<typeof Header>;