fix(SW-719): add colors for biroscript
This commit is contained in:
@@ -48,49 +48,34 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.themeOne {
|
.themeOne {
|
||||||
--script-color: var(--Primary-Light-On-Surface-Accent);
|
|
||||||
|
|
||||||
background: var(--Primary-Light-Surface-Normal);
|
background: var(--Primary-Light-Surface-Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
.themeTwo {
|
.themeTwo {
|
||||||
--script-color: var(--Secondary-Light-On-Surface-Accent);
|
|
||||||
|
|
||||||
background: var(--Secondary-Light-Surface-Normal);
|
background: var(--Secondary-Light-Surface-Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
.themeThree {
|
.themeThree {
|
||||||
--script-color: var(--Tertiary-Light-On-Surface-Accent);
|
|
||||||
|
|
||||||
background: var(--Tertiary-Light-Surface-Normal);
|
background: var(--Tertiary-Light-Surface-Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
.themePrimaryDark {
|
.themePrimaryDark {
|
||||||
--script-color: var(--Primary-Dark-On-Surface-Accent);
|
|
||||||
|
|
||||||
background: var(--Primary-Dark-Surface-Normal);
|
background: var(--Primary-Dark-Surface-Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
.themePrimaryDim {
|
.themePrimaryDim {
|
||||||
--script-color: var(--Primary-Dim-On-Surface-Accent);
|
|
||||||
|
|
||||||
background: var(--Primary-Dim-Surface-Normal);
|
background: var(--Primary-Dim-Surface-Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
.themePrimaryInverted {
|
.themePrimaryInverted {
|
||||||
--script-color: var(--Primary-Light-On-Surface-Accent);
|
|
||||||
|
|
||||||
background: var(--Base-Surface-Primary-light-Normal);
|
background: var(--Base-Surface-Primary-light-Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
.themePrimaryStrong {
|
.themePrimaryStrong {
|
||||||
--script-color: var(--Primary-Strong-On-Surface-Accent);
|
|
||||||
|
|
||||||
background: var(--Primary-Strong-Surface-Normal);
|
background: var(--Primary-Strong-Surface-Normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
.themeImage {
|
.themeImage {
|
||||||
--script-color: var(--Base-Text-Inverted);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.themeImage .content {
|
.themeImage .content {
|
||||||
@@ -103,7 +88,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.scriptedTitle {
|
.scriptedTitle {
|
||||||
color: var(--script-color);
|
|
||||||
padding: var(--Spacing-x1);
|
padding: var(--Spacing-x1);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 { getScriptFontColor } from "@/utils/cardScriptFontColor"
|
||||||
import { getTheme } from "@/utils/cardTheme"
|
import { getTheme } from "@/utils/cardTheme"
|
||||||
import { getFontColor } from "@/utils/cardTitleFontColor"
|
import { getFontColor } from "@/utils/cardTitleFontColor"
|
||||||
|
|
||||||
@@ -30,9 +31,8 @@ export default function Card({
|
|||||||
onSecondaryButtonClick,
|
onSecondaryButtonClick,
|
||||||
}: CardProps) {
|
}: CardProps) {
|
||||||
const buttonTheme = getTheme(theme)
|
const buttonTheme = getTheme(theme)
|
||||||
const titleFontColor = getFontColor(theme)
|
const fontColor = getFontColor(theme)
|
||||||
|
const scriptFontColor = getScriptFontColor(theme)
|
||||||
console.log("woop woop", titleFontColor)
|
|
||||||
|
|
||||||
imageHeight = imageHeight || 320
|
imageHeight = imageHeight || 320
|
||||||
|
|
||||||
@@ -68,6 +68,7 @@ export default function Card({
|
|||||||
className={styles.scriptedTitle}
|
className={styles.scriptedTitle}
|
||||||
type="two"
|
type="two"
|
||||||
tilted="small"
|
tilted="small"
|
||||||
|
color={scriptFontColor}
|
||||||
>
|
>
|
||||||
{scriptedTopTitle}
|
{scriptedTopTitle}
|
||||||
</BiroScript>
|
</BiroScript>
|
||||||
@@ -78,7 +79,7 @@ export default function Card({
|
|||||||
level="h3"
|
level="h3"
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
textTransform="regular"
|
textTransform="regular"
|
||||||
color={titleFontColor}
|
color={fontColor}
|
||||||
>
|
>
|
||||||
{heading}
|
{heading}
|
||||||
</Title>
|
</Title>
|
||||||
|
|||||||
@@ -77,3 +77,23 @@
|
|||||||
.pink {
|
.pink {
|
||||||
color: var(--Primary-Dark-On-Surface-Accent);
|
color: var(--Primary-Dark-On-Surface-Accent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.secondaryLight {
|
||||||
|
color: var(--Secondary-Light-On-Surface-Accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tertiaryLight {
|
||||||
|
color: var(--Tertiary-Light-On-Surface-Accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.primaryDim {
|
||||||
|
color: var(--Primary-Dim-On-Surface-Accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.primaryStrong {
|
||||||
|
color: var(--Primary-Strong-On-Surface-Accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
color: var(--Base-Text-Inverted);
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ const config = {
|
|||||||
primaryLightOnSurfaceAccent: styles.plosa,
|
primaryLightOnSurfaceAccent: styles.plosa,
|
||||||
red: styles.red,
|
red: styles.red,
|
||||||
pink: styles.pink,
|
pink: styles.pink,
|
||||||
|
secondaryLight: styles.secondaryLight,
|
||||||
|
tertiaryLight: styles.tertiaryLight,
|
||||||
|
primaryDim: styles.primaryDim,
|
||||||
|
primaryStrong: styles.primaryStrong,
|
||||||
|
image: styles.image,
|
||||||
},
|
},
|
||||||
textAlign: {
|
textAlign: {
|
||||||
center: styles.center,
|
center: styles.center,
|
||||||
|
|||||||
30
utils/cardScriptFontColor.ts
Normal file
30
utils/cardScriptFontColor.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { CardProps } from "@/components/TempDesignSystem/Card/card"
|
||||||
|
|
||||||
|
import { biroScriptVariants } from "../components/TempDesignSystem/Text/BiroScript/variants"
|
||||||
|
|
||||||
|
import type { VariantProps } from "class-variance-authority"
|
||||||
|
|
||||||
|
export function getScriptFontColor(theme: CardProps["theme"]) {
|
||||||
|
let color: VariantProps<typeof biroScriptVariants>["color"]
|
||||||
|
|
||||||
|
switch (theme) {
|
||||||
|
case "one":
|
||||||
|
return (color = "primaryLightOnSurfaceAccent")
|
||||||
|
case "two":
|
||||||
|
return (color = "secondaryLight")
|
||||||
|
case "three":
|
||||||
|
return (color = "tertiaryLight")
|
||||||
|
case "primaryDark":
|
||||||
|
return (color = "pink")
|
||||||
|
case "primaryDim":
|
||||||
|
return (color = "primaryDim")
|
||||||
|
case "primaryInverted":
|
||||||
|
return (color = "primaryLightOnSurfaceAccent")
|
||||||
|
case "primaryStrong":
|
||||||
|
return (color = "primaryStrong")
|
||||||
|
case "image":
|
||||||
|
return (color = "image")
|
||||||
|
default:
|
||||||
|
return "primaryLightOnSurfaceAccent"
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user