Skip to content

Commit 4babd02

Browse files
authored
docs(feedback): Add more themeables + improve/fix inconsistencies (#9429)
* Adds themeable options for submit/cancel/input * Make css vars + theme vars consistent * Fix incorrect defaults
1 parent 6dc1952 commit 4babd02

File tree

1 file changed

+36
-21
lines changed

1 file changed

+36
-21
lines changed

packages/feedback/README.md

+36-21
Original file line numberDiff line numberDiff line change
@@ -87,23 +87,26 @@ Most text that you see in the default Feedback widget can be customized.
8787

8888
| key | default | description |
8989
| --------- | ------- | ----------- |
90-
| `buttonLabel` | `"Feedback"` | The label of the widget button. |
91-
| `submitButtonLabel` | `"Send Feedback"` | The label of the submit button used in the feedback form dialog. |
92-
| `cancelButtonLabel` | `"Cancel"` | The label of the cancel button used in the feedback form dialog. |
93-
| `formTitle` | `"Send Feedback"` | The title at the top of the feedback form dialog. |
94-
| `nameLabel` | `"Full Name"` | The label of the name input field. |
95-
| `namePlaceholder` | `"Full Name"` | The placeholder for the name input field. |
96-
| `emailLabel` | `"Email"` | The label of the email input field. ||
97-
| `emailPlaceholder` | `"Email"` | The placeholder for the email input field. |
98-
| `messageLabel` | `"Description"` | The label for the feedback description input field. |
99-
| `messagePlaceholder` | `"What's the issue? What did you expect?"` | The placeholder for the feedback description input field. |
100-
| `successMessageText` | `"Thank you for your report!"` | The message to be displayed after a succesful feedback submission. |
90+
| `buttonLabel` | `Report a Bug` | The label of the widget button. |
91+
| `submitButtonLabel` | `Send Bug Report` | The label of the submit button used in the feedback form dialog. |
92+
| `cancelButtonLabel` | `Cancel` | The label of the cancel button used in the feedback form dialog. |
93+
| `formTitle` | `Report a Bug` | The title at the top of the feedback form dialog. |
94+
| `nameLabel` | `Name` | The label of the name input field. |
95+
| `namePlaceholder` | `Your Name` | The placeholder for the name input field. |
96+
| `emailLabel` | `Email` | The label of the email input field. ||
97+
| `emailPlaceholder` | `[email protected]` | The placeholder for the email input field. |
98+
| `messageLabel` | `Description` | The label for the feedback description input field. |
99+
| `messagePlaceholder` | `What's the bug? What did you expect?` | The placeholder for the feedback description input field. |
100+
| `successMessageText` | `Thank you for your report!` | The message to be displayed after a succesful feedback submission. |
101+
102+
103+
Example of customization
101104

102105
```javascript
103106
new Feedback({
104-
buttonLabel: 'Bug Report',
105-
submitButtonLabel: 'Send Report',
106-
formTitle: 'Send Bug Report',
107+
buttonLabel: 'Feedback',
108+
submitButtonLabel: 'Send Feedback',
109+
formTitle: 'Send Feedback',
107110
});
108111
```
109112

@@ -112,13 +115,25 @@ Colors can be customized via the Feedback constructor or by defining CSS variabl
112115

113116
| key | css variable | light | dark | description |
114117
| --- | --- | --- | --- | --- |
115-
| `background` | `--bg-color` | `#ffffff` | `#29232f` | Background color of the widget actor and dialog. |
116-
| `backgroundHover` | `--bg-hover-color` | `#f6f6f7` | `#352f3b` | The background color of widget actor when in a hover state |
117-
| `foreground` | `--fg-color` | `#2b2233` | `#ebe6ef` | The foreground color, e.g. text color |
118-
| `error` | `--error-color` | `#df3338` | `#f55459` | Color used for error related components (e.g. text color when there was an error submitting feedback) |
119-
| `success` | `--success-color` | `#268d75` | `#2da98c` | Color used for success-related components (e.g. text color when feedback is submitted successfully) |
118+
| `background` | `--background` | `#ffffff` | `#29232f` | Background color of the widget actor and dialog |
119+
| `backgroundHover` | `--background-hover` | `#f6f6f7` | `#352f3b` | Background color of widget actor when in a hover state |
120+
| `foreground` | `--foreground` | `#2b2233` | `#ebe6ef` | Foreground color, e.g. text color |
121+
| `error` | `--error` | `#df3338` | `#f55459` | Color used for error related components (e.g. text color when there was an error submitting feedback) |
122+
| `success` | `--success` | `#268d75` | `#2da98c` | Color used for success-related components (e.g. text color when feedback is submitted successfully) |
120123
| `border` | `--border` | `1.5px solid rgba(41, 35, 47, 0.13)` | `1.5px solid rgba(235, 230, 239, 0.15)` | The border style used for the widget actor and dialog |
121124
| `boxShadow` | `--box-shadow` | `0px 4px 24px 0px rgba(43, 34, 51, 0.12)` | `0px 4px 24px 0px rgba(43, 34, 51, 0.12)` | The box shadow style used for the widget actor and dialog |
125+
| `submitBackground` | `--submit-background` | `rgba(88, 74, 192, 1)` | `rgba(88, 74, 192, 1)` | Background color for the submit button |
126+
| `submitBackgroundHover` | `--submit-background-hover` | `rgba(108, 95, 199, 1)` | `rgba(108, 95, 199, 1)` | Background color when hovering over the submit button |
127+
| `submitBorder` | `--submit-border` | `rgba(108, 95, 199, 1)` | `rgba(108, 95, 199, 1)` | Border style for the submit button |
128+
| `submitForeground` | `--submit-foreground` | `#ffffff` | `#ffffff` | Foreground color for the submit button |
129+
| `cancelBackground` | `--cancel-background` | `transparent` | `transparent` | Background color for the cancel button |
130+
| `cancelBackgroundHover` | `--cancel-background-hover` | `var(--background-hover)` | `var(--background-hover)` | Background color when hovering over the cancel button |
131+
| `cancelBorder` | `--cancel-border` | `var(--border)` | `var(--border)` | Border style for the cancel button |
132+
| `cancelForeground` | `--cancel-foreground` | `var(--foreground)` | `var(--foreground)` | Foreground color for the cancel button |
133+
| `inputBackground` | `--input-background` | `inherit` | `inherit` | Background color for form inputs |
134+
| `inputForeground` | `--input-foreground` | `inherit` | `inherit` | Foreground color for form inputs |
135+
| `inputBorder` | `--input-border` | `var(--border)` | `var(--border)` | Border styles for form inputs |
136+
| `inputBorderFocus` | `--input-border-focus` | `rgba(108, 95, 199, 1)` | `rgba(108, 95, 199, 1)` | Border styles for form inputs when focused |
122137

123138
Here is an example of customizing only the background color for the light theme using the Feedback constructor configuration.
124139
```javascript
@@ -133,7 +148,7 @@ Or the same example above but using the CSS variables method:
133148

134149
```css
135150
#sentry-feedback {
136-
--bg-color: #cccccc;
151+
--background: #cccccc;
137152
}
138153
```
139154

@@ -188,7 +203,7 @@ feedback.attachTo(document.querySelector('#your-button'), {
188203
You can also bring your own widget and UI and simply pass a feedback object to the `sendFeedback()` function.
189204

190205
```html
191-
<form id="my-feedback-form>
206+
<form id="my-feedback-form">
192207
<input name="name" />
193208
<input name="email" />
194209
<textarea name="message" placeholder="What's the issue?" />

0 commit comments

Comments
 (0)