-
Notifications
You must be signed in to change notification settings - Fork 210
/
Copy pathtailwind_radix_map.py
33 lines (27 loc) · 1.05 KB
/
tailwind_radix_map.py
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
from reflex.constants.colors import ColorType
# Default Radix Colors
def create_colors_dict() -> dict:
colors_dict = {}
for color in ColorType.__args__:
if color not in ["black", "white"]:
colors_dict[color] = {
shade: f"var(--{'c-' if color in ['slate', 'violet'] else ''}{color}-{shade})"
for shade in range(1, 13)
}
# Append the alpha colors
colors_dict[f"{color}A"] = {
shade: f"var(--{color}-a{shade})" for shade in range(1, 13)
}
return colors_dict
# Custom Colors from the 'custom-colors.css' file
def create_custom_colors_dict() -> dict:
custom_colors_dict = {}
for color in ["slate", "violet"]:
custom_colors_dict[color] = {
shade: f"var(--c-{color}-{shade})" for shade in range(1, 13)
}
# Add the white color
custom_colors_dict["white"] = {1: "var(--c-white-1)"}
return custom_colors_dict
radix_colors_dict = create_colors_dict()
custom_colors_dict = create_custom_colors_dict()