-
Notifications
You must be signed in to change notification settings - Fork 97
feat(chrome): new light/dark mode colors #1849
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
Conversation
| <ThemeProvider | ||
| theme={parentTheme => ({ | ||
| ...parentTheme, | ||
| colors: { ...parentTheme.colors, base: isLight ? 'light' : 'dark' } | ||
| })} | ||
| > |
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.
Coerce dark vs. light mode for Nav components rather than ferrying isLight & isDark props through to the various styled components.
|
|
||
| const borderStyle = ({ | ||
| const colorStyles = ({ theme, isOpen }: IStyledSheetProps & ThemeProps<DefaultTheme>) => { | ||
| const backgroundColor = getColor({ theme, variable: 'background.raised' }); |
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.
i would say Sheet's background would be default, as it is supplementary view alongside main content.
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.
@steue yeah, agreed. Do we have corresponding designs for the Sheet component? Also, are the subtle borders still correct with the default background?
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.
@jzempel yeah! @'d you on Figma! πͺπ» good catch on the border treatment. like modals and pane, surrounding border is default, with the header/footer using subtle.
steue
left a comment
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.
made a comment/fix on sheet's bg treatment. aside from that everything looks great! ty!
|
|
||
| const isLight = hue ? isLightMemoized : false; | ||
| const isDark = hue ? !isLightMemoized : false; | ||
| const isLight = hue ? isLightMemoized : undefined; |
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.
To bette align with the IChromeContext type.
| const isLight = hue ? isLightMemoized : undefined; | |
| const isLight = hue ? isLightMemoized : false; |
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.
@ze-flo the isLight is either true (custom light nav hue), false (custom dark nav hue), or undefined (default chromeHue) βΒ in which case the data-test-light attribute should not be applied.
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.
Thanks for clarifying. π
|
|
||
| interface IChromeContext { | ||
| hue: string; | ||
| isLight?: boolean; |
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.
I think this key is always defined now.
| isLight?: boolean; | |
| isLight: boolean; |
| export const getFooterHeight = (theme: DefaultTheme) => `${theme.space.base * 20}px`; | ||
|
|
||
| export const getHeaderHeight = (theme: DefaultTheme) => `${theme.space.base * 13}px`; | ||
|
|
||
| export const getHeaderItemSize = (theme: DefaultTheme) => `${theme.space.base * 7.5}px`; | ||
|
|
||
| export const getNavItemHeight = (theme: DefaultTheme) => getHeaderHeight(theme); | ||
|
|
||
| export const getNavWidth = (theme: DefaultTheme) => `${theme.space.base * 15}px`; | ||
|
|
||
| export const getNavWidthExpanded = () => `200px`; | ||
|
|
||
| export const getProductColor = (product?: Product, fallback = 'inherit') => | ||
| product ? PALETTE.product[product] || fallback : fallback; |
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.
β€οΈ
ze-flo
left a comment
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.
LGTM! π₯
| } | ||
|
|
||
| return null; | ||
| }; |
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.
π₯ love a good reduction
Description
Completed recolor work for
ChromeandSheetcomponents/subcomponents. ποΈ Set the storybookNavcontrol tofalsein order to visually test<Header isStandalone>.Checklist
npm start)?bedrock)tested for WCAG 2.1 AA accessibility compliance