Skip to content

Commit c831eee

Browse files
committed
Add accentBackground and accentForeground colors
1 parent c05fc5f commit c831eee

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed

packages/core/src/js/feedback/FeedbackWidget.styles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ const defaultStyles: FeedbackWidgetStyles = {
6363
fontSize: 16,
6464
},
6565
submitButton: {
66-
backgroundColor: getTheme().accent,
66+
backgroundColor: getTheme().accentBackground,
6767
paddingVertical: 15,
6868
borderRadius: 5,
6969
alignItems: 'center',
7070
marginBottom: 10,
7171
},
7272
submitText: {
73-
color: getTheme().background,
73+
color: getTheme().accentForeground,
7474
fontSize: 18,
7575
},
7676
cancelButton: {
@@ -113,7 +113,7 @@ export const defaultButtonStyles: FeedbackButtonStyles = {
113113
shadowRadius: 3,
114114
flexDirection: 'row',
115115
borderWidth: 1,
116-
borderColor: BORDER_COLOR,
116+
borderColor: getTheme().border,
117117
},
118118
triggerText: {
119119
color: getTheme().foreground,

packages/core/src/js/feedback/FeedbackWidget.theme.ts

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,45 @@ export function getTheme(): FeedbackWidgetTheme {
1414
}
1515

1616
export interface FeedbackWidgetTheme {
17-
accent: string;
17+
/**
18+
* Background color for surfaces
19+
*/
1820
background: string;
21+
22+
/**
23+
* Foreground color (i.e. text color)
24+
*/
1925
foreground: string;
20-
border: string;
26+
27+
/**
28+
* Foreground color for accented elements
29+
*/
30+
accentForeground?: string;
31+
32+
/**
33+
* Background color for accented elements
34+
*/
35+
accentBackground?: string;
36+
37+
/**
38+
* Border color
39+
*/
40+
border?: string;
41+
42+
/**
43+
* Color for feedback icon
44+
*/
2145
feedbackIcon?: string;
46+
47+
/**
48+
* Color for Sentry logo
49+
*/
2250
sentryLogo?: string;
2351
}
2452

2553
export const LightTheme: FeedbackWidgetTheme = {
26-
accent: 'rgba(88, 74, 192, 1)',
54+
accentBackground: 'rgba(88, 74, 192, 1)',
55+
accentForeground: '#ffffff',
2756
foreground: '#2b2233',
2857
background: '#ffffff',
2958
border: 'rgba(41, 35, 47, 0.13)',
@@ -32,7 +61,8 @@ export const LightTheme: FeedbackWidgetTheme = {
3261
};
3362

3463
export const DarkTheme: FeedbackWidgetTheme = {
35-
accent: 'rgba(88, 74, 192, 1)',
64+
accentBackground: 'rgba(88, 74, 192, 1)',
65+
accentForeground: '#ffffff',
3666
foreground: '#ebe6ef',
3767
background: '#29232f',
3868
border: 'rgba(235, 230, 239, 0.15)',

0 commit comments

Comments
 (0)