Skip to content

Commit

Permalink
style(autocomplete): add missing global styles
Browse files Browse the repository at this point in the history
add css classes to restore the autocomplete widget style when the global style option of the EuiProvider is removed. As a proof of concept that this approach might work for all widgets.

related to #144
  • Loading branch information
jusa3 committed Jan 13, 2025
1 parent 5a9070e commit 2be1e16
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .storybook/react/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const queryClient = new QueryClient();
export const decorators = [
(Story) => (
<>
<EuiProvider colorMode="light">
<EuiProvider colorMode="light" globalStyles={false}>
<QueryClientProvider client={queryClient}>
{Story()}
</QueryClientProvider>
Expand Down
13 changes: 13 additions & 0 deletions src/style/autocompleteStyles.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
.custom-autocomplete-style * {
font-size: 18px !important;
font-family: 'Inter',BlinkMacSystemFont,Helvetica,Arial,sans-serif;
}

.custom-autocomplete-style input,
.custom-autocomplete-style .euiComboBox__inputWrap{
background-color: #edc4c4 !important;
}

.custom-autocomplete-style button {
background: none;
border: none;
}

.euiComboBoxOptionsList * {
border: none;
background-color: inherit;
}

.euiComboBoxOptionsList__empty {
font-family: 'Inter',BlinkMacSystemFont,Helvetica,Arial,sans-serif;
}

0 comments on commit 2be1e16

Please sign in to comment.