@@ -67,10 +67,12 @@ const supportingTextStyles = css`
6767const SupportingBenefits = ( {
6868 benefitsLabel,
6969 benefits,
70+ benefitsTickColour,
7071 choiceCardDesignSettings,
7172} : {
7273 benefitsLabel ?: string ;
7374 benefits : ChoiceCard [ 'benefits' ] ;
75+ benefitsTickColour ?: string ;
7476 choiceCardDesignSettings ?: ChoiceCardDesignSettings ;
7577} ) => {
7678 const showTicks = benefits . length > 1 ;
@@ -94,6 +96,7 @@ const SupportingBenefits = ({
9496 size = "xsmall"
9597 theme = { {
9698 fill :
99+ benefitsTickColour ??
97100 choiceCardDesignSettings ?. buttonSelectMarkerColour ??
98101 palette . brand [ 400 ] ,
99102 } }
@@ -187,16 +190,19 @@ export const ThreeTierChoiceCards = ({
187190 palette . brand [ 400 ] ,
188191 } ;
189192
193+ const getPillBackgroundColour = (
194+ pill : NonNullable < ChoiceCard [ 'pill' ] > ,
195+ ) : string => {
196+ if ( choiceCardDesignSettings ?. pillBackgroundColour ) {
197+ return choiceCardDesignSettings . pillBackgroundColour ;
198+ }
199+ if ( pill . backgroundColour ) {
200+ return hexColourToString ( pill . backgroundColour as HexColour ) ;
201+ }
202+ return palette . brandAlt [ 400 ] ;
203+ } ;
204+
190205 const pillStyles = ( pill : NonNullable < ChoiceCard [ 'pill' ] > ) => {
191- const buildBackgroundColour = ( ) : string => {
192- if ( choiceCardDesignSettings ?. pillBackgroundColour ) {
193- return choiceCardDesignSettings . pillBackgroundColour ;
194- }
195- if ( pill . backgroundColour ) {
196- return hexColourToString ( pill . backgroundColour as HexColour ) ;
197- }
198- return palette . brandAlt [ 400 ] ;
199- } ;
200206 const buildTextColour = ( ) : string => {
201207 if ( choiceCardDesignSettings ?. pillTextColour ) {
202208 return choiceCardDesignSettings . pillTextColour ;
@@ -210,7 +216,7 @@ export const ThreeTierChoiceCards = ({
210216 return css `
211217 bor der- radius: 4px;
212218 padding: ${ space [ 1 ] } px ${ space [ 2 ] } px;
213- background- color : ${ buildBackgroundColour ( ) } ;
219+ background- color : ${ getPillBackgroundColour ( pill ) } ;
214220 ${ textSansBold14 } ;
215221 color : ${ buildTextColour ( ) } ;
216222 position: absolute;
@@ -343,6 +349,13 @@ export const ThreeTierChoiceCards = ({
343349 | undefined
344350 }
345351 benefits = { benefits }
352+ benefitsTickColour = {
353+ pill
354+ ? getPillBackgroundColour (
355+ pill ,
356+ )
357+ : undefined
358+ }
346359 choiceCardDesignSettings = {
347360 choiceCardDesignSettings
348361 }
0 commit comments