Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "dropdown style bug fix for high contrast themes",
"packageName": "@fluentui/azure-themes",
"email": "[email protected]",
"dependentChangeType": "patch"
}
36 changes: 36 additions & 0 deletions packages/azure-themes/src/azure/AzureColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,15 @@ export const DarkSemanticColors: IAzureSemanticColors = {
},
focus: BaseColors.GRAY_A19F9D,
},
dropDown: {
background: {
rest: BaseColors.GRAY_252423,
hover: BaseColors.GRAY_323130,
},
text: {
hovered: BaseColors.WHITE,
},
},
item: {
hover: BaseColors.GRAY_323130,
select: BaseColors.GRAY_3B3A39,
Expand Down Expand Up @@ -554,6 +563,15 @@ export const HighContrastDarkSemanticColors: IAzureSemanticColors = {
},
focus: BaseColors.GRAY_A19F9D,
},
dropDown: {
background: {
rest: BaseColors.GRAY_1B1A19,
hover: BaseColors.TRANSPARENT,
},
text: {
hovered: BaseColors.WHITE,
},
},
item: {
hover: BaseColors.BLUE_00FFFF,
select: BaseColors.GRAY_808080_050,
Expand Down Expand Up @@ -808,6 +826,15 @@ export const LightSemanticColors: IAzureSemanticColors = {
},
focus: BaseColors.GRAY_605E5C,
},
dropDown: {
background: {
rest: BaseColors.WHITE,
hover: BaseColors.GRAY_F3F2F1,
},
text: {
hovered: BaseColors.GRAY_302928,
},
},
item: {
hover: BaseColors.GRAY_F3F2F1,
select: BaseColors.GRAY_EDEBE9,
Expand Down Expand Up @@ -1062,6 +1089,15 @@ export const HighContrastLightSemanticColors: IAzureSemanticColors = {
},
focus: BaseColors.GRAY_323130,
},
dropDown: {
background: {
rest: BaseColors.WHITE,
hover: BaseColors.TRANSPARENT,
},
text: {
hovered: BaseColors.BLACK,
},
},
item: {
hover: BaseColors.PURPLE_800080,
select: BaseColors.GRAY_EDEBE9,
Expand Down
3 changes: 3 additions & 0 deletions packages/azure-themes/src/azure/AzureThemeDark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ const darkExtendedSemanticColors: Partial<IExtendedSemanticColors> = {
datePickerSelectionText: DarkSemanticColors.datePicker.rest.text,
disabledBackground: CommonSemanticColors.backgrounds.disabled,
disabledBodyText: DarkSemanticColors.text.disabled,
dropdownBackground: DarkSemanticColors.dropDown.background.rest,
dropdownItemHover: DarkSemanticColors.dropDown.text.hovered,
dropdownTextHovered: DarkSemanticColors.dropDown.text.hovered,
errorBackground: DarkSemanticColors.controlOutlines.error,
errorText: DarkSemanticColors.text.error,
focusBorder: DarkSemanticColors.controlOutlines.accent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const highContrastDarkExtendedSemanticColors: Partial<IExtendedSemanticColors> =
datePickerSelectionText: HighContrastDarkSemanticColors.datePicker.rest.text,
disabledBackground: CommonSemanticColors.backgrounds.disabled,
disabledBodyText: HighContrastDarkSemanticColors.text.disabled,
dropdownBackground: HighContrastDarkSemanticColors.dropDown.background.rest,
dropdownItemHover: HighContrastDarkSemanticColors.dropDown.background.hover,
dropdownTextHovered: HighContrastDarkSemanticColors.dropDown.text.hovered,
errorBackground: HighContrastDarkSemanticColors.controlOutlines.error,
errorText: HighContrastDarkSemanticColors.text.error,
focusBorder: HighContrastDarkSemanticColors.controlOutlines.accent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const highContrastLightExtendedSemanticColors: Partial<IExtendedSemanticColors>
datePickerSelectionText: HighContrastLightSemanticColors.datePicker.rest.text,
disabledBackground: CommonSemanticColors.backgrounds.disabled,
disabledBodyText: HighContrastLightSemanticColors.text.disabled,
dropdownBackground: HighContrastLightSemanticColors.dropDown.background.rest,
dropdownItemHover: HighContrastLightSemanticColors.dropDown.background.hover,
dropdownTextHovered: HighContrastLightSemanticColors.dropDown.text.hovered,
errorBackground: HighContrastLightSemanticColors.controlOutlines.error,
errorText: HighContrastLightSemanticColors.text.error,
focusBorder: HighContrastLightSemanticColors.controlOutlines.accent,
Expand Down
3 changes: 3 additions & 0 deletions packages/azure-themes/src/azure/AzureThemeLight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const lightExtendedSemanticColors: Partial<IExtendedSemanticColors> = {
datePickerSelectionText: LightSemanticColors.datePicker.rest.text,
disabledBackground: CommonSemanticColors.backgrounds.disabled,
disabledBodyText: LightSemanticColors.text.disabled,
dropdownBackground: LightSemanticColors.dropDown.background.rest,
dropdownItemHover: LightSemanticColors.dropDown.background.hover,
dropdownTextHovered: LightSemanticColors.dropDown.text.hovered,
errorBackground: LightSemanticColors.controlOutlines.error,
errorText: LightSemanticColors.text.error,
focusBorder: LightSemanticColors.controlOutlines.accent,
Expand Down
9 changes: 9 additions & 0 deletions packages/azure-themes/src/azure/IAzureSemanticColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ export interface IAzureSemanticColors {
};
focus: string;
};
dropDown: {
background: {
rest: string;
hover: string;
};
text: {
hovered: string;
};
};
item: {
hover: string;
select: string;
Expand Down
3 changes: 3 additions & 0 deletions packages/azure-themes/src/azure/IExtendedSemanticColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export interface IExtendedSemanticColors extends ISemanticColors {
datePickerSelectionText: string;
disabledBackground: string;
disabledBodyText: string;
dropdownBackground: string;
dropdownItemHover: string;
dropdownTextHovered: string;
errorBackground: string;
errorText: string;
focusBorder: string;
Expand Down
45 changes: 37 additions & 8 deletions packages/azure-themes/src/azure/styles/DropDown.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ export const DropdownStyles = (props: IDropdownStyleProps): Partial<IDropdownSty
color: semanticColors.inputPlaceholderText,
},
['&:hover .ms-Dropdown-title']: {
color: extendedSemanticColors.commandBarButtonTextHover,
color: extendedSemanticColors.bodyText,
borderColor: semanticColors.inputText,
},
['&:focus .ms-Dropdown-title']: {
borderColor: semanticColors.focusBorder,
},
['&:active .ms-Dropdown-title']: {
color: extendedSemanticColors.commandBarButtonTextHover,
color: semanticColors.bodyText,
borderColor: semanticColors.focusBorder,
},
// CaretDown states are the same for focus, hover, active.
Expand Down Expand Up @@ -129,43 +129,72 @@ export const DropdownStyles = (props: IDropdownStyleProps): Partial<IDropdownSty
},
],
dropdownItemsWrapper: {
backgroundColor: semanticColors.bodyBackground,
backgroundColor: extendedSemanticColors.dropdownBackground,
borderColor: semanticColors.inputBorder,
border: 0,
},
dropdownItem: {
color: semanticColors.bodyText,
fontSize: theme.fonts.medium.fontSize,
backgroundColor: extendedSemanticColors.controlBackground,
backgroundColor: extendedSemanticColors.dropdownBackground,
selectors: {
// active: Mouse down on the item, then drag outside.
'&:hover, &:active, &:hover:focus': {
backgroundColor: semanticColors.listItemBackgroundHovered,
borderColor: 'transparent',
color: extendedSemanticColors.commandBarButtonTextHover,
color: extendedSemanticColors.dropdownTextHovered,
},
// unselected multi-choice item
'&.ms-Checkbox': {
color: extendedSemanticColors.bodyText,
backgroundColor: extendedSemanticColors.dropdownBackground,
},
// unselected multi-choice hovered item
'&.ms-Checkbox:hover': {
color: extendedSemanticColors.dropdownTextHovered,
backgroundColor: extendedSemanticColors.listItemBackgroundHovered,
},
},
},
dropdownItemDisabled: {
color: semanticColors.primaryButtonTextDisabled,
fontSize: theme.fonts.medium.fontSize,
backgroundColor: extendedSemanticColors.controlBackground,
backgroundColor: extendedSemanticColors.dropdownBackground,
selectors: {
// multi select drop down disabled items
'&.ms-Checkbox': {
backgroundColor: extendedSemanticColors.dropdownBackground,
},
// multi select drop down disabled items hovered
'&.ms-Checkbox:hover': {
backgroundColor: extendedSemanticColors.dropdownBackground,
},
},
},
dropdownItemSelected: {
fontSize: theme.fonts.medium.fontSize,
backgroundColor: semanticColors.listItemBackgroundChecked,
color: extendedSemanticColors.commandBarButtonTextHover,
color: extendedSemanticColors.bodyText,
selectors: {
'&:hover, &:focus, &:active, &:hover:focus': {
backgroundColor: semanticColors.listItemBackgroundChecked,
borderColor: 'transparent',
},
// multi select drop down items
'&.ms-Checkbox': {
backgroundColor: extendedSemanticColors.dropdownBackground,
},
// multi select drop down items hovered
'&.ms-Checkbox:hover': {
backgroundColor: extendedSemanticColors.listItemBackgroundHovered,
color: extendedSemanticColors.dropdownTextHovered,
},
},
},
dropdownItemHeader: {
color: semanticColors.inputText,
fontWeight: '600',
backgroundColor: extendedSemanticColors.controlBackground,
backgroundColor: extendedSemanticColors.dropdownBackground,
},
subComponentStyles: {
panel: {},
Expand Down