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

[pull] trunk from WordPress:trunk #140

Merged
merged 1 commit into from
Jan 6, 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 packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
- `Navigation`: Upsize back buttons ([#68157](https://github.com/WordPress/gutenberg/pull/68157)).
- `Heading`: Fix text contrast for dark mode ([#68349](https://github.com/WordPress/gutenberg/pull/68349)).
- `Text`: Fix text contrast for dark mode ([#68349](https://github.com/WordPress/gutenberg/pull/68349)).
- `Heading`: Revert text contrast fix for dark mode with optimizeReadabilityFor ([#68472](https://github.com/WordPress/gutenberg/pull/68472)).
- `Text`: Revert text contrast fix for dark mode with optimizeReadabilityFor ([#68472](https://github.com/WordPress/gutenberg/pull/68472)).

### Deprecations

Expand Down
5 changes: 3 additions & 2 deletions packages/components/src/text/hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ export default function useText(
const isOptimalTextColorDark =
getOptimalTextShade( optimizeReadabilityFor ) === 'dark';

// Should not use theme colors
sx.optimalTextColor = isOptimalTextColorDark
? css( { color: COLORS.theme.foreground } )
: css( { color: COLORS.theme.foregroundInverted } );
? css( { color: COLORS.gray[ 900 ] } )
: css( { color: COLORS.white } );
}

return cx(
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/text/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe( 'Text', () => {
</Text>
);
expect( screen.getByRole( 'heading' ) ).toHaveStyle( {
color: 'rgb( 255, 255, 255 )',
color: COLORS.white,
} );
} );

Expand Down
Loading