-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: Dark Mode #718
feat: Dark Mode #718
Changes from 11 commits
eb69b11
9152ddf
eb7080f
0e70163
589c5cd
8166de1
dcbdbfb
b04c0e7
cf8b16c
1e6b38f
871bc04
1c71d4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,7 +94,7 @@ export const Title - styled(Typography)` | |
```ts | ||
import { css, SerializedStyles } from "@emotion/react"; | ||
import { styled } from '@mui/material/styles'; | ||
import { getColors, getCorners } from "@czi-sds/components"; | ||
import { getColors, getSpaces } from "@czi-sds/components"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just fixing a typo in the README |
||
|
||
export const Tag = styled("div")` | ||
// This is a callback function that returns more CSS rules, but the only way | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ import { | |
getIconSizes, | ||
getSpaces, | ||
} from "../styles"; | ||
import { defaultTheme } from "../styles/common/defaultTheme"; | ||
|
||
interface CalloutExtraProps extends CommonThemeProps { | ||
collapsed?: boolean; | ||
|
@@ -39,12 +38,13 @@ export const StyledCallout = styled(Alert, { | |
// any buttom margin | ||
const titleBottomMargin = props.collapsed ? "margin-bottom: 0;" : ""; | ||
|
||
// TODO: Theme shouldn't be saying it might be null | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type issue, needs to be addressed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this TODO is a little right and a little wrong, looking at it again. The At runtime, I'm sure we could do a bit of type juggling we could do to make it defined, but I think we'd want to do that in other components that are extending Given this PR is more targeted at making dark mode work, I'm inclined to live with the untrue |
||
return ` | ||
background-color: ${backgroundColor}; | ||
width: 360px; | ||
margin: ${spacings?.m}px 0; | ||
border-radius: ${corners?.m}px; | ||
color: ${defaultTheme.palette.text.primary}; | ||
color: ${props.theme?.palette.text.primary}; | ||
padding: ${spacings?.m}px; | ||
background-color: ${calloutColor}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,11 @@ export const StyledDialogTitle = styled(DialogTitle)` | |
export const Title = styled(Typography)` | ||
${fontHeaderXl} | ||
|
||
color: black; | ||
${(props) => { | ||
return ` | ||
color: ${props.theme.palette.text.primary}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just thinking about this a bit... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for paving the way for our components to be runtime theme aware 💡 !! Yeah using semantic There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, going to remove the color entirely for |
||
`; | ||
}} | ||
`; | ||
|
||
export const Subtitle = styled(Typography)` | ||
|
@@ -34,7 +38,7 @@ export const Subtitle = styled(Typography)` | |
const colors = getColors(props); | ||
|
||
return ` | ||
color: ${colors?.gray[500]}; | ||
color: ${props.theme.palette.text.secondary}; | ||
`; | ||
}} | ||
`; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,9 @@ export const StyledTabs = styled(TempTabs, { | |
return ` | ||
margin-top: ${isLarge ? spaces?.l : spaces?.m}px; | ||
margin-bottom: ${isLarge ? spaces?.xl : spaces?.m}px; | ||
border-bottom: ${underlined ? `2px solid ${colors?.gray[200]};` : "none"}; | ||
border-bottom: ${ | ||
underlined ? `2px solid ${props.theme.palette.divider};` : "none" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. super nice! |
||
}; | ||
`; | ||
}} | ||
`; | ||
|
@@ -89,26 +91,26 @@ export const StyledTab = styled(RawTab, { | |
// (thuang): Large Tab height is 30px, the offset is 4px | ||
height: ${isLarge ? 26 : 22}px; | ||
|
||
color: ${colors?.gray[500]}; | ||
color: ${props.theme.palette.text.secondary}; | ||
|
||
&:hover, :focus { | ||
color: black; | ||
color: ${props.theme.palette.text.primary}; | ||
} | ||
|
||
&.Mui-selected { | ||
color: black; | ||
color: ${props.theme.palette.text.primary}; | ||
|
||
&:hover { | ||
color: black; | ||
color: ${props.theme.palette.text.primary}; | ||
} | ||
} | ||
|
||
&:active { | ||
color: black; | ||
color: ${props.theme.palette.text.primary}; | ||
} | ||
|
||
&:disabled { | ||
color: ${colors?.gray[200]}; | ||
color: ${props.theme.palette.text.disabled}; | ||
} | ||
`; | ||
}} | ||
|
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.
Turns out I'm on the latest version of
yarn
which hasn't been used by this project yet so I was getting tons of added files fromyarn
's cache. This ensures the latestyarn
doesn't causegit
annoyances in the future 😄