-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
fix(feedback): Improve CSS theme variable names and layout #11964
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a476d4f
fix(feedback): Improve CSS theme variable names and layout
ryan953 43b66f2
fix border in dark mode
ryan953 ff2f6f5
be consistent about setting color and fill for icons
ryan953 d8cf4aa
Apply suggestions from code review
ryan953 4fdfdf8
fix some types
ryan953 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,58 @@ | ||
const LIGHT_BACKGROUND = '#ffffff'; | ||
const INHERIT = 'inherit'; | ||
const SUBMIT_COLOR = 'rgba(108, 95, 199, 1)'; | ||
const PURPLE = 'rgba(88, 74, 192, 1)'; | ||
const PURPLE_HOVER = 'rgba(108, 95, 199, 1)'; | ||
|
||
export const LIGHT_THEME = { | ||
fontFamily: "system-ui, 'Helvetica Neue', Arial, sans-serif", | ||
fontSize: '14px', | ||
|
||
foreground: '#2b2233', | ||
background: LIGHT_BACKGROUND, | ||
success: '#268d75', | ||
error: '#df3338', | ||
|
||
zIndex: 100000, | ||
successForeground: '#268d75', | ||
errorForeground: '#df3338', | ||
background: '#ffffff', | ||
border: '1.5px solid rgba(41, 35, 47, 0.13)', | ||
boxShadow: '0px 4px 24px 0px rgba(43, 34, 51, 0.12)', | ||
|
||
backgroundHover: '#f6f6f7', | ||
borderRadius: '25px', | ||
|
||
formBorderRadius: '20px', | ||
formContentBorderRadius: '6px', | ||
|
||
submitForeground: LIGHT_BACKGROUND, | ||
submitBackground: 'rgba(88, 74, 192, 1)', | ||
submitForegroundHover: LIGHT_BACKGROUND, | ||
submitBackgroundHover: SUBMIT_COLOR, | ||
submitBorder: SUBMIT_COLOR, | ||
inputForeground: INHERIT, | ||
inputBackground: INHERIT, | ||
inputBackgroundHover: INHERIT, | ||
inputBackgroundFocus: INHERIT, | ||
inputBorder: 'var(--border)', | ||
inputBorderRadius: '6px', | ||
inputOutlineFocus: PURPLE_HOVER, | ||
|
||
buttonForeground: INHERIT, | ||
buttonForegroundHover: INHERIT, | ||
buttonBackground: 'var(--background)', | ||
buttonBackgroundHover: '#f6f6f7', | ||
buttonBorder: 'var(--border)', | ||
buttonOutlineFocus: 'var(--input-outline-focus)', | ||
|
||
submitForeground: '#ffffff', | ||
submitForegroundHover: '#ffffff', | ||
submitBackground: PURPLE, | ||
submitBackgroundHover: PURPLE_HOVER, | ||
submitBorder: PURPLE_HOVER, | ||
submitBorderRadius: 'var(--button-border-radius)', | ||
submitOutlineFocus: '#29232f', | ||
|
||
cancelForeground: 'var(--foreground)', | ||
cancelBackground: 'transparent', | ||
cancelForegroundHover: 'var(--foreground)', | ||
cancelBackgroundHover: 'var(--background-hover)', | ||
cancelBorder: 'var(--border)', | ||
cancelOutlineFocus: 'var(--input-outline-focus)', | ||
triggerBackground: 'var(--background)', | ||
triggerBackgroundHover: 'var(--button-background-hover)', | ||
triggerBorderRadius: '1.7em/50%', | ||
|
||
inputBackground: INHERIT, | ||
inputForeground: INHERIT, | ||
inputBorder: 'var(--border)', | ||
inputOutlineFocus: SUBMIT_COLOR, | ||
dialogBackground: 'var(--background)', | ||
dialogBorderRadius: '20px', | ||
}; | ||
|
||
export const DEFAULT_THEME = { | ||
light: LIGHT_THEME, | ||
dark: { | ||
...LIGHT_THEME, | ||
|
||
background: '#29232f', | ||
backgroundHover: '#352f3b', | ||
foreground: '#ebe6ef', | ||
border: '1.5px solid rgba(235, 230, 239, 0.15)', | ||
successForeground: '#2da98c', | ||
errorForeground: '#f55459', | ||
background: '#29232f', | ||
border: '1.5px solid rgba(235, 230, 239, 0.5)', | ||
boxShadow: '0px 4px 24px 0px rgba(43, 34, 51, 0.12)', | ||
|
||
success: '#2da98c', | ||
error: '#f55459', | ||
buttonBackgroundHover: '#352f3b', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we removing this as available customization options from constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ya, it wasn't on docs.sentry.io, and font stuff wasn't possible to override. So i pulled it out, but it's easy to add back.
I think i'd like a general-theme section in there that's neither dark or light mode. In my testing i screwed up a couple times by setting something like
themeLight: { foreground: 'red' }
then rendering in dark mode i was confused why i couldn't see my color change. It wouldn't be great to have to specify font in both places, or only in one place and have it copied around imo.So i was thinking, shorter term at least, we lean into css variables more in the docs, so that's the first stop for people. And that's where everything is available. https://github.com/getsentry/sentry-docs/pull/9961/files