fix(SW-719): title font colors
This commit is contained in:
@@ -116,10 +116,6 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.heading {
|
|
||||||
color: var(--font-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.bodyText {
|
.bodyText {
|
||||||
color: var(--font-color);
|
color: var(--font-color);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import Button from "@/components/TempDesignSystem/Button"
|
|||||||
import BiroScript from "@/components/TempDesignSystem/Text/BiroScript"
|
import BiroScript from "@/components/TempDesignSystem/Text/BiroScript"
|
||||||
import Body from "@/components/TempDesignSystem/Text/Body"
|
import Body from "@/components/TempDesignSystem/Text/Body"
|
||||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||||
|
import { getFontColor } from "@/utils/cardFontColor"
|
||||||
import { getTheme } from "@/utils/cardTheme"
|
import { getTheme } from "@/utils/cardTheme"
|
||||||
|
|
||||||
import { cardVariants } from "./variants"
|
import { cardVariants } from "./variants"
|
||||||
@@ -29,6 +30,9 @@ export default function Card({
|
|||||||
onSecondaryButtonClick,
|
onSecondaryButtonClick,
|
||||||
}: CardProps) {
|
}: CardProps) {
|
||||||
const buttonTheme = getTheme(theme)
|
const buttonTheme = getTheme(theme)
|
||||||
|
const titleFontColor = getFontColor(theme)
|
||||||
|
|
||||||
|
console.log("woop woop", titleFontColor)
|
||||||
|
|
||||||
imageHeight = imageHeight || 320
|
imageHeight = imageHeight || 320
|
||||||
|
|
||||||
@@ -71,10 +75,10 @@ export default function Card({
|
|||||||
) : null}
|
) : null}
|
||||||
<Title
|
<Title
|
||||||
as="h4"
|
as="h4"
|
||||||
className={styles.heading}
|
|
||||||
level="h3"
|
level="h3"
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
textTransform="regular"
|
textTransform="regular"
|
||||||
|
color={titleFontColor}
|
||||||
>
|
>
|
||||||
{heading}
|
{heading}
|
||||||
</Title>
|
</Title>
|
||||||
|
|||||||
16
utils/cardFontColor.ts
Normal file
16
utils/cardFontColor.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { CardProps } from "@/components/TempDesignSystem/Card/card"
|
||||||
|
|
||||||
|
import { headingVariants } from "../components/TempDesignSystem/Text/Title/variants"
|
||||||
|
|
||||||
|
import type { VariantProps } from "class-variance-authority"
|
||||||
|
|
||||||
|
export function getFontColor(theme: CardProps["theme"]) {
|
||||||
|
let color: VariantProps<typeof headingVariants>["color"]
|
||||||
|
|
||||||
|
switch (theme) {
|
||||||
|
case "primaryDark":
|
||||||
|
return (color = "pale")
|
||||||
|
default:
|
||||||
|
return (color = "burgundy")
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user