Skip to content

Commit

Permalink
Merge branch 'master' into mp/fix/headerbar-theme-padding-none
Browse files Browse the repository at this point in the history
  • Loading branch information
mperrotti authored Jul 12, 2019
2 parents e576f34 + 838cb80 commit 583f487
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/appChrome/stories/AppChrome.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ storiesOf("AppChrome", module)
<ThemeProvider theme={CustomTheme}>
<Sidebar isOpen={true}>
<SidebarSection label={sectionHeader}>
<SidebarItem onClick={action("clicked a nav item")}>
<SidebarItem isActive={true} onClick={action("clicked a nav item")}>
<SidebarItemLabel>Lorem Ipsum</SidebarItemLabel>
</SidebarItem>
<SidebarItem onClick={action("clicked a nav item")}>
Expand Down
13 changes: 11 additions & 2 deletions packages/appChrome/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import {
spaceXl,
themeBgSelected,
themeBgHover,
themeBgHoverInverted
themeBgHoverInverted,
themeTextColorPrimary,
themeTextColorPrimaryInverted
} from "../design-tokens/build/js/designTokens";
import { padding } from "../shared/styles/styleUtils";
import { pickHoverBg } from "../shared/styles/color";
import { pickHoverBg, pickReadableTextColor } from "../shared/styles/color";
import getCSSVarValue from "../utilities/components/getCSSVarValue";

const iconSize = "24px";
Expand Down Expand Up @@ -62,6 +64,13 @@ export const sidebarSectionList = css`
export const sidebarNavItem = (isActive: boolean, sidebarBgColor: string) => {
return css`
background-color: ${isActive ? themeBgSelected : "transparent"};
color: ${isActive
? pickReadableTextColor(
sidebarBgColor,
themeTextColorPrimary,
themeTextColorPrimaryInverted
)
: null};
cursor: pointer;
text-transform: capitalize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ exports[`Sidebar SidebarSubMenu renders 1`] = `
</SidebarItemLabel>
</div>
}
labelClassName="css-1beii4s"
labelClassName="css-193h9wh"
>
<ul
className="emotion-0"
Expand Down

0 comments on commit 583f487

Please sign in to comment.