File tree Expand file tree Collapse file tree 4 files changed +19
-14
lines changed
Expand file tree Collapse file tree 4 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -645,7 +645,7 @@ export const FeatureCard = ({
645645 < StarRating
646646 rating = { starRating }
647647 size = { starRatingSize }
648- useDarkTheme = { true }
648+ useAlternativeTheme = { true }
649649 />
650650 ) : (
651651 < div css = { starRatingWrapper } >
Original file line number Diff line number Diff line change 11import type { Meta , StoryObj } from '@storybook/react-webpack5' ;
2-
32import { type Props , StarRating } from './StarRating' ;
43
54const meta = {
@@ -61,9 +60,9 @@ export const StarsWithLargePadding: Story = {
6160 } ,
6261} ;
6362
64- export const StarsWithDarkTheme : Story = {
63+ export const StarsWithAlternativeTheme : Story = {
6564 args : {
6665 size : 'large' ,
67- useDarkTheme : true ,
66+ useAlternativeTheme : true ,
6867 } ,
6968} ;
Original file line number Diff line number Diff line change @@ -23,8 +23,8 @@ const emptyStarColor = css`
2323 background-color : ${ palette ( '--star-rating-empty-background' ) } ;
2424` ;
2525
26- const emptyStarDarkColor = css `
27- background-color : ${ palette ( '--star-rating-empty-dark -background' ) } ;
26+ const emptyStarAltColor = css `
27+ background-color : ${ palette ( '--star-rating-empty-alt -background' ) } ;
2828` ;
2929
3030const determineSize = ( size : RatingSizeType ) => {
@@ -108,15 +108,19 @@ export type Props = {
108108 rating : Rating ;
109109 size : RatingSizeType ;
110110 paddingSize ?: PaddingSizeType ;
111- /** The dark theme is to account for star ratings that appear on lighter / translucent backgrounds (eg feature cards). The dark theme ensures we meet AA accessibility standard*/
112- useDarkTheme ?: boolean ;
111+ /**
112+ * The alternative theme is to account for star ratings that appear on
113+ * lighter / translucent backgrounds (e.g. feature cards).
114+ * The alternative theme ensures we meet AA accessibility standards.
115+ */
116+ useAlternativeTheme ?: boolean ;
113117} ;
114118
115119export const StarRating = ( {
116120 rating,
117121 size,
118122 paddingSize = 'small' ,
119- useDarkTheme = false ,
123+ useAlternativeTheme = false ,
120124} : Props ) => (
121125 < div
122126 css = { [ determineSize ( size ) , determinePaddingTop ( paddingSize ) , container ] }
@@ -131,7 +135,9 @@ export const StarRating = ({
131135 key = { i }
132136 css = { [
133137 starBackground ,
134- useDarkTheme ? emptyStarDarkColor : emptyStarColor ,
138+ useAlternativeTheme
139+ ? emptyStarAltColor
140+ : emptyStarColor ,
135141 ] }
136142 >
137143 < SvgStarOutline />
Original file line number Diff line number Diff line change @@ -7963,12 +7963,12 @@ const paletteColours = {
79637963 light : starRatingBackgroundColourLight ,
79647964 dark : starRatingBackgroundColourDark ,
79657965 } ,
7966- '--star-rating-empty-background' : {
7967- light : starRatingEmptyBackgroundColourLight ,
7966+ '--star-rating-empty-alt- background' : {
7967+ light : starRatingEmptyBackgroundColourDark ,
79687968 dark : starRatingEmptyBackgroundColourDark ,
79697969 } ,
7970- '--star-rating-empty-dark- background' : {
7971- light : starRatingEmptyBackgroundColourDark ,
7970+ '--star-rating-empty-background' : {
7971+ light : starRatingEmptyBackgroundColourLight ,
79727972 dark : starRatingEmptyBackgroundColourDark ,
79737973 } ,
79747974 '--star-rating-fill' : {
You can’t perform that action at this time.
0 commit comments