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

fix: text visibility issues in error page in dark mode #30408

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ui/components/component-library/textarea/textarea.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
.mm-textarea {
$resize: none, both, horizontal, vertical, initial, inherit;

max-width: 100%;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes issue with Textarea component extending beyond container

Before

Screenshot 2025-02-16 at 10 11 19 AM

After

Screenshot 2025-02-18 at 8 58 19 AM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing !


&--is-disabled,
&:disabled {
opacity: var(--opacity-disabled);
Expand Down
3 changes: 3 additions & 0 deletions ui/css/base-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ body {

html {
min-height: 500px;
}

html,
body {
Copy link
Contributor Author

@georgewrmarshall georgewrmarshall Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to include body here so it inherits the color styles for text at the moment we are setting it to text/default which defaults to grey

after.body720.mov

@include design-system.screen-sm-max {
&:not([data-theme]) {
background-color: var(--color-background-default);
Expand Down
26 changes: 22 additions & 4 deletions ui/pages/error-page/error-page.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,27 @@ const ErrorPage: React.FC<ErrorPageProps> = ({ error }) => {
size={IconSize.Xl}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page will be rendered outside of the theme provider so we need to ensure it works by changing all text components to inherit the text color from html/body

color={IconColor.warningDefault}
/>
<Text variant={TextVariant.headingMd} marginBottom={4}>
<Text
color={TextColor.inherit}
variant={TextVariant.headingMd}
marginBottom={4}
>
{t('errorPageTitle')}
</Text>
</Box>

<div className="error-page__banner-wrapper">
<BannerAlert marginBottom={4}>{t('errorPageInfo')}</BannerAlert>
<BannerAlert
childrenWrapperProps={{ color: TextColor.inherit }}
marginBottom={4}
>
{t('errorPageInfo')}
</BannerAlert>
</div>

<Text variant={TextVariant.bodyMd}>{t('errorPageMessageTitle')}</Text>
<Text color={TextColor.inherit} variant={TextVariant.bodyMd}>
{t('errorPageMessageTitle')}
</Text>

<Box
borderRadius={BorderRadius.LG}
Expand All @@ -136,6 +147,7 @@ const ErrorPage: React.FC<ErrorPageProps> = ({ error }) => {
variant={TextVariant.bodyXs}
marginBottom={2}
data-testid="error-page-error-message"
color={TextColor.inherit}
>
{t('errorMessage', [error.message])}
</Text>
Expand All @@ -145,6 +157,7 @@ const ErrorPage: React.FC<ErrorPageProps> = ({ error }) => {
variant={TextVariant.bodyXs}
marginBottom={2}
data-testid="error-page-error-code"
color={TextColor.inherit}
>
{t('errorCode', [error.code])}
</Text>
Expand All @@ -154,13 +167,18 @@ const ErrorPage: React.FC<ErrorPageProps> = ({ error }) => {
variant={TextVariant.bodyXs}
marginBottom={2}
data-testid="error-page-error-name"
color={TextColor.inherit}
>
{t('errorName', [error.name])}
</Text>
) : null}
{error.stack ? (
<>
<Text variant={TextVariant.bodyXs} marginBottom={2}>
<Text
color={TextColor.inherit}
variant={TextVariant.bodyXs}
marginBottom={2}
>
{t('errorStack')}
</Text>
<pre
Expand Down
Loading