Skip to content

Commit

Permalink
feat: Apply shadow to SquareAppIcon title only on inverted theme
Browse files Browse the repository at this point in the history
The applied shadow is here to improve readability on dark backgrounds
but is not needed on light backgrounds

So we want to use it only on inverted theme
  • Loading branch information
Ldoppea committed May 12, 2023
1 parent 43364e7 commit 8c16952
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions react/SquareAppIcon/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const useStyles = makeStyles(theme => ({
fontSize: '0.875rem',
lineHeight: '1.188rem',
margin: '0.5rem 0.25rem 0 0.25rem',
textShadow: theme.textShadows[1],
lineClamp: '2',
boxOrient: 'vertical',
display: '-webkit-box',
Expand All @@ -41,6 +40,9 @@ const useStyles = makeStyles(theme => ({
height: '2rem'
}
},
nameInverted: {
textShadow: theme.textShadows[1]
},
squareAppIconGhost: {
backgroundColor: alpha(
theme.palette.primary.main,
Expand Down Expand Up @@ -193,7 +195,11 @@ export const SquareAppIcon = ({
</InfosBadge>
</CozyTheme>
<Typography
className={cx(classes.name, 'u-spacellipsis')}
className={cx(
classes.name,
{ [classes.nameInverted]: theme === 'inverted' },
'u-spacellipsis'
)}
variant="h6"
align="center"
>
Expand Down

0 comments on commit 8c16952

Please sign in to comment.