Skip to content

Commit ab5d2e6

Browse files
committed
Adds initial work on theme structure.
Adds initial work theme colors, spacing, radius and typography.
1 parent e6c7394 commit ab5d2e6

File tree

6 files changed

+147
-0
lines changed

6 files changed

+147
-0
lines changed

theme/colors.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { ColorStates } from "./constants";
2+
3+
interface ColorPalette extends ColorStates {
4+
default: string;
5+
hover: string;
6+
pressed: string;
7+
}
8+
9+
interface BackgroundPalette extends ColorStates {
10+
default: string;
11+
hover: string;
12+
disabled: string;
13+
}
14+
15+
interface Palette {
16+
brand: string;
17+
primary: ColorPalette;
18+
secondary: ColorPalette;
19+
success: string;
20+
warning: string;
21+
danger: string;
22+
stroke: string;
23+
background: BackgroundPalette;
24+
}
25+
26+
const BRAND_COLOR = "";
27+
const PRIMARY_COLOR = "";
28+
const PRIMARY_COLOR_HOVER = "";
29+
const PRIMARY_COLOR_PRESSED = "";
30+
const SECONDARY_COLOR = "";
31+
const SECONDARY_COLOR_HOVER = "";
32+
const SECONDARY_COLOR_PRESSED = "";
33+
const BACKGROUND_COLOR = "";
34+
const BACKGROUND_COLOR_HOVER = "";
35+
const BACKGROUND_COLOR_DISABLED = "";
36+
const SUCCESS_COLOR = "";
37+
const WARNING_COLOR = "";
38+
const DANGER_COLOR = "";
39+
const STROKE_LINE_COLOR = "";
40+
41+
const palette: Palette = {
42+
brand: BRAND_COLOR,
43+
primary: {
44+
default: PRIMARY_COLOR,
45+
hover: PRIMARY_COLOR_HOVER,
46+
pressed: PRIMARY_COLOR_PRESSED
47+
},
48+
secondary: {
49+
default: SECONDARY_COLOR,
50+
hover: SECONDARY_COLOR_HOVER,
51+
pressed: SECONDARY_COLOR_PRESSED
52+
},
53+
success: SUCCESS_COLOR,
54+
warning: WARNING_COLOR,
55+
danger: DANGER_COLOR,
56+
stroke: STROKE_LINE_COLOR,
57+
background: {
58+
default: BACKGROUND_COLOR,
59+
hover: BACKGROUND_COLOR_HOVER,
60+
disabled: BACKGROUND_COLOR_DISABLED
61+
}
62+
};
63+
64+
export { Palette, palette };

theme/constants.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
interface ColorStates {
2+
hover?: string;
3+
pressed?: string;
4+
disabled?: string;
5+
}
6+
7+
export { ColorStates };

theme/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Palette, palette } from "./colors";
2+
import { Shadows, shadows } from "./shadows";
3+
import { Units, units } from "./units";
4+
import { Typography, typography } from "./typography";
5+
6+
interface Theme {
7+
palette: Palette;
8+
units: Units;
9+
shadows: Shadows;
10+
typography: Typography;
11+
}
12+
13+
const theme: Theme = {
14+
palette,
15+
units,
16+
shadows,
17+
typography
18+
};
19+
20+
export { Theme, theme };

theme/shadows.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
interface Shadows {
2+
default: string;
3+
hover: string;
4+
}
5+
6+
const SHADOW_DEFAULT = "0px 1px 3px rgba(0, 0, 0, 0.07)";
7+
const SHADOW_HOVER = "0px 5px 10px rgba(0, 0, 0, 0.1)";
8+
9+
const shadows: Shadows = {
10+
default: SHADOW_DEFAULT,
11+
hover: SHADOW_HOVER
12+
};
13+
14+
export { Shadows, shadows };

theme/typography.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { ColorStates } from "./constants";
2+
3+
interface TextPalette extends ColorStates {
4+
primary: string;
5+
secondary: string;
6+
disabled: string;
7+
pressed: string;
8+
}
9+
10+
interface Typography {
11+
palette: TextPalette;
12+
}
13+
14+
const PRIMARY_TEXT_COLOR = "";
15+
const SECODARY_TEXT_COLOR = "";
16+
const PRESSED_TEXT_COLOR = "";
17+
const DISABLED_TEXT_COLOR = "";
18+
19+
const typography: Typography = {
20+
palette: {
21+
primary: PRIMARY_TEXT_COLOR,
22+
secondary: SECODARY_TEXT_COLOR,
23+
disabled: DISABLED_TEXT_COLOR,
24+
pressed: PRESSED_TEXT_COLOR
25+
}
26+
};
27+
28+
export { Typography, typography };

theme/units.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
interface Units {
2+
spacing: number;
3+
radius: number;
4+
}
5+
6+
const SPACING_UNIT = 5;
7+
const BORDER_RADIUS_UNIT = 6;
8+
9+
const units: Units = {
10+
spacing: SPACING_UNIT,
11+
radius: BORDER_RADIUS_UNIT
12+
};
13+
14+
export { Units, units };

0 commit comments

Comments
 (0)