Skip to content

Remove SearchField border on gray background #2464

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

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

bryancunningham-okta
Copy link
Contributor

@bryancunningham-okta bryancunningham-okta commented Jan 16, 2025

…highContrast style

DES-7007

Summary

  • Makes SearchField contrastMode aware
  • Removes border when SearchField is rendered on a gray background

Testing & Screenshots

  • I have confirmed this change with my designer and the Odyssey Design Team.

@bryancunningham-okta bryancunningham-okta requested a review from a team as a code owner January 16, 2025 21:49
renderFieldComponent={renderFieldComponent}
/>
<StyledContainerToEnsureThemeProviderDivIsFullWidth>
<OdysseyThemeProvider>
Copy link
Contributor

@benschell-okta benschell-okta Jan 17, 2025

Choose a reason for hiding this comment

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

out of personal curiosity: is it not required that folks have an <OdysseyProvider> (which includes <OdysseyThemeProvider>) wrapping their usage of this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a better question: is this the new pattern for contrast-aware components, that they have to include an <OdysseyThemeProvider> to enable that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@benschell-okta Yes, adding the OdysseyThemeProvider here scopes the ContrastModeProvider down to this component's parent background color. Ideally this would be more intuitive/be a different provider. Something that at a glance you can tell why it's there/what it's doing fo ryou

Copy link
Contributor Author

@bryancunningham-okta bryancunningham-okta Jan 17, 2025

Choose a reason for hiding this comment

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

I believe, In it's current state, without adding this provider here, the 'awareness' would be based on the background color of the html element

Copy link
Contributor

Choose a reason for hiding this comment

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

That last point was the exact kernel I needed. This localizes the context that is computed within and that makes perfect sense

Comment on lines +38 to +41
const StyledContainerToEnsureThemeProviderDivIsFullWidth = styled("div")({
width: "100%",
});

Copy link
Contributor

Choose a reason for hiding this comment

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

We discussed possible other solutions for this. Not 100% sure the solution, but one is putting width: "inherit" on OdysseyThemeProvider's div, and another is putting a flex-basis: "100%" on this one.

@oktapp-aperture-okta oktapp-aperture-okta bot merged commit 9530b71 into main Jan 22, 2025
1 check passed
@oktapp-aperture-okta oktapp-aperture-okta bot deleted the DES-6984-topnav-search-field branch January 22, 2025 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants