-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alerts: use chonk colors #88688
alerts: use chonk colors #88688
Conversation
function getColor(theme: Theme, type: 'critical' | 'warning' | 'success') { | ||
if (theme.isChonk) { | ||
return type === 'critical' | ||
? (theme as DO_NOT_USE_ChonkTheme).colors.chonk.red400 | ||
: type === 'warning' | ||
? (theme as DO_NOT_USE_ChonkTheme).colors.chonk.yellow400 | ||
: (theme as DO_NOT_USE_ChonkTheme).colors.chonk.green400; | ||
} | ||
return type === 'critical' | ||
? theme.errorText | ||
: type === 'warning' | ||
? theme.warningText | ||
: theme.successText; | ||
} | ||
const StyledIconDiamond = styled(IconDiamond)<{type: 'critical' | 'warning' | 'success'}>` | ||
fill: ${p => getColor(p.theme, p.type)}; | ||
`; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The IconDiamond is deprecated and will be removed in the future so I didnt bother making a dedicated component for it
@@ -40,7 +40,9 @@ const numericStyle = ( | |||
height: 24px; | |||
font-weight: ${theme.fontWeightNormal}; | |||
font-size: ${theme.fontSizeSmall}; | |||
background-color: ${theme.yellow300}; | |||
background-color: ${theme.isChonk | |||
? (theme as DO_NOT_USE_ChonkTheme).colors.chonk.yellow400 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let’s do the isChonkTheme
assert function to avoid the type assertion we need to do in a couple of places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let me followup with that and fix it in a bunch of other places too
Cleared with Jesse that elements that need contrast from the base should use chonk colors
Cleared with Jesse that elements that need contrast from the base should use chonk colors