You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mobile/components/Constants.tsx

100 lines
1.9 KiB

export type Size =
| "xs"
| "md"
| "lg"
| "xl"
| "2xl"
| "3xl"
| "4xl"
| "5xl"
| "6xl"
| "7xl"
| "8xl"
| "9xl";
export type Color = "black" | "white" | "orange" | "red" | "blue";
export type Weight = "thin" | "normal" | "bold" | "extrabold";
export type Position = "left" | "center" | "right";
export function toTextSize(size: Size): string {
switch (size) {
case "xs":
return "text-xs";
case "md":
return "text-md";
case "lg":
return "text-lg";
case "xl":
return "text-xl";
case "2xl":
return "text-2xl";
case "3xl":
return "text-3xl";
case "4xl":
return "text-4xl";
case "5xl":
return "text-5xl";
case "6xl":
return "text-6xl";
case "7xl":
return "text-7xl";
case "8xl":
return "text-8xl";
case "9xl":
return "text-9xl";
}
}
export function toBgColor(color: Color): string {
switch (color) {
case "black":
return "bg-black";
case "white":
return "bg-white";
case "orange":
return "bg-orange-500";
case "red":
return "bg-red-500";
case "blue":
return "bg-blue-200";
}
}
export function toTextColor(color: Color): string {
switch (color) {
case "black":
return "text-black";
case "white":
return "text-white";
case "orange":
return "text-orange-500";
case "red":
return "text-red-500";
case "blue":
return "text-blue-500";
}
}
export function toTextWeight(weight: Weight): string {
switch (weight) {
case "thin":
return "font-thin";
case "normal":
return "font-normal";
case "bold":
return "font-bold";
case "extrabold":
return "font-extrabold";
}
}
export function toTextPosition(position: Position): string {
switch (position) {
case "left":
return "text-left";
case "center":
return "text-center";
case "right":
return "text-right";
}
}