Skip to content

Commit

Permalink
Merge pull request #20169 from julien-deramond/next-jd-theming-add-ba…
Browse files Browse the repository at this point in the history
…r-hover-color

Theming: Add `barHoverColor`
  • Loading branch information
ndelangen authored Sep 11, 2023
2 parents 7a33f70 + b244926 commit b67f9f4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions code/lib/theming/src/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const convert = (inherit: ThemeVars = themes[getPreferredColorScheme()]):
textColor,
textInverseColor,
barTextColor,
barHoverColor,
barSelectedColor,
barBg,
buttonBg,
Expand Down Expand Up @@ -157,6 +158,7 @@ export const convert = (inherit: ThemeVars = themes[getPreferredColorScheme()]):

// Toolbar default/active colors
barTextColor,
barHoverColor: barHoverColor || colorSecondary,
barSelectedColor: barSelectedColor || colorSecondary,
barBg,

Expand Down
1 change: 1 addition & 0 deletions code/lib/theming/src/themes/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const theme: ThemeVars = {

// Toolbar default and active colors
barTextColor: '#798186',
barHoverColor: color.secondary,
barSelectedColor: color.secondary,
barBg: '#292C2E',

Expand Down
1 change: 1 addition & 0 deletions code/lib/theming/src/themes/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const theme: ThemeVars = {

// Toolbar default and active colors
barTextColor: color.mediumdark,
barHoverColor: color.secondary,
barSelectedColor: color.secondary,
barBg: color.lightest,

Expand Down
2 changes: 2 additions & 0 deletions code/lib/theming/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface ThemeVarsColors {

// Toolbar default and active colors
barTextColor: string;
barHoverColor: string;
barSelectedColor: string;
barBg: string;

Expand Down Expand Up @@ -87,6 +88,7 @@ export interface StorybookTheme {

// Toolbar default/active colors
barTextColor: string;
barHoverColor: string;
barSelectedColor: string;
barBg: string;

Expand Down
4 changes: 2 additions & 2 deletions code/ui/components/src/components/bar/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const IconButton = styled(ButtonOrLink, { shouldForwardProp: isPropValid
active
? {
backgroundColor: theme.background.hoverable,
color: theme.color.secondary,
color: theme.barSelectedColor,
}
: {},
({ disabled, theme }) =>
Expand All @@ -128,7 +128,7 @@ export const IconButton = styled(ButtonOrLink, { shouldForwardProp: isPropValid
: {
'&:hover, &:focus-visible': {
background: transparentize(0.88, theme.color.secondary),
color: theme.color.secondary,
color: theme.barHoverColor,
},
'&:focus-visible': {
outline: auto, // Ensures links have the same focus style
Expand Down

0 comments on commit b67f9f4

Please sign in to comment.