-
Notifications
You must be signed in to change notification settings - Fork 212
feat(compass-components): add dark mode flag for using theme in components instead of darkreader COMPASS-5520 #2856
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
Merged
Conversation
This file contains hidden or 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
…er compass-components
mcasimir
approved these changes
Mar 2, 2022
packages/connection-form/src/components/advanced-options-tabs/general-tab/scheme-input.tsx
Outdated
Show resolved
Hide resolved
…o avoid inferred react props not matching typescript
Anemy
commented
Mar 3, 2022
// 2. Wrap the components that accept darkMode with Compass' theme. | ||
const Button = withTheme( | ||
LeafyGreenButton as React.ComponentType<typeof LeafyGreenButton> | ||
) as typeof LeafyGreenButton; |
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.
Working on a cleaner way to type the high order component that wraps these so we don't have to do this type casting.
We'll want to use this wrapper with some of our own custom components - checking to make sure those types work well too.
…theme wrapper definition
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
COMPASS-5520
This pr adds a
COMPASS_LG_DARKMODE
feature flag. When enabled this makes it so we theme Compass using our own components, and thedarkMode
parameter with leafygreen components, instead of usingdarkreader
to globally theme the entire page.Most of the changes in the pr are around wrapping the leafygreen components in
compass-components
with awithTheme
react high order components. How do y'all feel on how we're structuring these imports/exports now? Any suggestions or thoughts on improving?It doesn't look great with it on (yet 😉 ), but this give a way for us to test our theming overtime so we can move towards not needing
darkreader
for themes.dark.theme.with.env.mp4