Skip to content

Commit 1cfa1a0

Browse files
authored
fix(ui-react): Add base bg color for the SearchField component button (#2431)
* fix(ui-react): Add base bg color for the SearchField component button
1 parent 8def8dc commit 1cfa1a0

File tree

6 files changed

+18
-1
lines changed

6 files changed

+18
-1
lines changed

.changeset/fast-mirrors-talk.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@aws-amplify/ui': patch
3+
---
4+
5+
This change adds a base background color for the SearchField component's button.

docs/src/pages/[platform]/components/searchfield/examples/SearchFieldThemeExample.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const theme: Theme = {
77
searchfield: {
88
button: {
99
color: { value: '{colors.blue.80}' },
10+
backgroundColor: { value: '{colors.blue.20}' },
1011
_focus: {
1112
backgroundColor: {
1213
value: '{colors.blue.60}',

packages/ui/src/theme/__tests__/defaultTheme.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ describe('@aws-amplify/ui', () => {
529529
--amplify-components-rating-empty-color: var(--amplify-colors-background-tertiary);
530530
--amplify-components-searchfield-color: var(--amplify-components-fieldcontrol-color);
531531
--amplify-components-searchfield-button-color: var(--amplify-components-button-color);
532+
--amplify-components-searchfield-button-background-color: var(--amplify-colors-background-primary);
532533
--amplify-components-searchfield-button-active-background-color: var(--amplify-components-button-active-background-color);
533534
--amplify-components-searchfield-button-active-border-color: var(--amplify-components-button-active-border-color);
534535
--amplify-components-searchfield-button-active-color: var(--amplify-components-button-active-color);

packages/ui/src/theme/__tests__/overrides.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ describe('@aws-amplify/ui', () => {
563563
--amplify-components-rating-empty-color: var(--amplify-colors-background-tertiary);
564564
--amplify-components-searchfield-color: var(--amplify-components-fieldcontrol-color);
565565
--amplify-components-searchfield-button-color: var(--amplify-components-button-color);
566+
--amplify-components-searchfield-button-background-color: var(--amplify-colors-background-primary);
566567
--amplify-components-searchfield-button-active-background-color: var(--amplify-components-button-active-background-color);
567568
--amplify-components-searchfield-button-active-border-color: var(--amplify-components-button-active-border-color);
568569
--amplify-components-searchfield-button-active-color: var(--amplify-components-button-active-color);

packages/ui/src/theme/css/component/searchField.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
);
55
&__search {
66
color: var(--amplify-components-searchfield-button-color);
7+
background-color: var(
8+
--amplify-components-searchfield-button-background-color
9+
);
710
&:active {
811
background-color: var(
912
--amplify-components-button-active-background-color

packages/ui/src/theme/tokens/components/searchField.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
import { ColorValue, DesignToken } from '../types/designToken';
1+
import {
2+
BackgroundColorValue,
3+
ColorValue,
4+
DesignToken,
5+
} from '../types/designToken';
26
import { StateTokens } from './button';
37

48
interface SearchTokens {
59
color: DesignToken<ColorValue>;
10+
backgroundColor: DesignToken<BackgroundColorValue>;
611
_active: StateTokens;
712
_disabled: StateTokens;
813
_focus: StateTokens;
@@ -18,6 +23,7 @@ export const searchfield: SearchFieldTokens = {
1823
color: { value: '{components.fieldcontrol.color.value}' },
1924
button: {
2025
color: { value: '{components.button.color.value}' },
26+
backgroundColor: { value: '{colors.background.primary.value}' },
2127
_active: {
2228
backgroundColor: {
2329
value: '{components.button._active.backgroundColor.value}',

0 commit comments

Comments
 (0)