Skip to content
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

Merged
merged 1 commit into from
Apr 3, 2025
Merged

alerts: use chonk colors #88688

merged 1 commit into from
Apr 3, 2025

Conversation

JonasBa
Copy link
Member

@JonasBa JonasBa commented Apr 3, 2025

Cleared with Jesse that elements that need contrast from the base should use chonk colors

@JonasBa JonasBa requested review from a team as code owners April 3, 2025 16:03
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 3, 2025
Comment on lines +145 to +162
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)};
`;

Copy link
Member Author

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
Copy link
Contributor

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.

Copy link
Member Author

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

@JonasBa JonasBa merged commit 47671dc into master Apr 3, 2025
42 checks passed
@JonasBa JonasBa deleted the jb/alerts/dirt-yellow branch April 3, 2025 16:39
andrewshie-sentry pushed a commit that referenced this pull request Apr 8, 2025
Cleared with Jesse that elements that need contrast from the base should
use chonk colors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants