Skip to content

Commit dab45a2

Browse files
authored
Azure Themes - Checkbox dark theme (#17657)
* Checkbox Dark Theme Updates * Change files * Take out fluent/utilities
1 parent 5254c86 commit dab45a2

10 files changed

+39
-6
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Checkbox Dark Theme Updates",
4+
"packageName": "@fluentui/azure-themes",
5+
"email": "aidanmc95@gmail.com",
6+
"dependentChangeType": "patch"
7+
}

packages/azure-themes/src/azure/AzureColors.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,16 +239,17 @@ export const DarkSemanticColors: IAzureSemanticColors = {
239239
rest: {
240240
border: BaseColors.GRAY_F3F2F1,
241241
hover: BaseColors.GRAY_A19F9D,
242+
hoverText: BaseColors.GRAY_FAF9F8,
242243
background: BaseColors.BLUE_2899F5,
243-
focus: BaseColors.BLUE_4894FE,
244+
focus: BaseColors.GRAY_A19F9D,
244245
check: BaseColors.BLACK,
245246
},
246247
checked: {
247248
border: BaseColors.BLUE_2899F5,
248249
background: BaseColors.BLUE_2899F5,
249250
default: BaseColors.BLUE_6CB8F6,
250-
hoverBackground: BaseColors.BLUE_6CB8F6,
251-
hoverBorder: BaseColors.BLUE_6CB8F6,
251+
hoverBackground: BaseColors.BLUE_82C7FF,
252+
hoverBorder: BaseColors.BLUE_82C7FF,
252253
},
253254
disabled: {
254255
border: BaseColors.GRAY_484644,
@@ -447,7 +448,8 @@ export const HighContrastDarkSemanticColors: IAzureSemanticColors = {
447448
border: BaseColors.GRAY_F3F2F1,
448449
background: BaseColors.BLUE_0078D4,
449450
hover: BaseColors.GRAY_A19F9D,
450-
focus: BaseColors.BLUE_4894FE,
451+
hoverText: BaseColors.WHITE,
452+
focus: BaseColors.WHITE,
451453
check: BaseColors.WHITE,
452454
},
453455
checked: {
@@ -654,7 +656,8 @@ export const LightSemanticColors: IAzureSemanticColors = {
654656
border: BaseColors.GRAY_323130,
655657
background: BaseColors.BLUE_0078D4,
656658
hover: BaseColors.GRAY_605E5C,
657-
focus: BaseColors.BLUE_0078D4,
659+
hoverText: BaseColors.GRAY_201F1E,
660+
focus: BaseColors.GRAY_605E5C,
658661
check: BaseColors.WHITE,
659662
},
660663
checked: {
@@ -861,7 +864,8 @@ export const HighContrastLightSemanticColors: IAzureSemanticColors = {
861864
border: BaseColors.GRAY_323130,
862865
background: BaseColors.BLUE_0078D4,
863866
hover: BaseColors.GRAY_323130,
864-
focus: BaseColors.GRAY_323130,
867+
hoverText: BaseColors.BLACK,
868+
focus: BaseColors.BLACK,
865869
check: BaseColors.WHITE,
866870
},
867871
checked: {

packages/azure-themes/src/azure/AzureThemeDark.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const darkExtendedSemanticColors: Partial<IExtendedSemanticColors> = {
3232
checkBoxCheck: DarkSemanticColors.checkBox.rest.check,
3333
checkBoxCheckedFocus: DarkSemanticColors.checkBox.rest.focus,
3434
checkBoxCheckHover: DarkSemanticColors.checkBox.rest.hover,
35+
checkBoxCheckHoverTest: DarkSemanticColors.checkBox.rest.hoverText,
3536
checkBoxCheckedDisabledBackground: DarkSemanticColors.checkBox.disabled.background,
3637
checkBoxDisabled: DarkSemanticColors.checkBox.disabled.border,
3738
checkBoxIndeterminateBackground: DarkSemanticColors.checkBox.rest.check,

packages/azure-themes/src/azure/AzureThemeHighContrastDark.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const highContrastDarkExtendedSemanticColors: Partial<IExtendedSemanticColors> =
3131
checkBoxCheck: HighContrastDarkSemanticColors.checkBox.rest.check,
3232
checkBoxCheckedFocus: HighContrastDarkSemanticColors.checkBox.rest.focus,
3333
checkBoxCheckHover: HighContrastDarkSemanticColors.checkBox.rest.hover,
34+
checkBoxCheckHoverTest: HighContrastDarkSemanticColors.checkBox.rest.hoverText,
3435
checkBoxCheckedDisabledBackground: HighContrastDarkSemanticColors.checkBox.disabled.background,
3536
checkBoxDisabled: HighContrastDarkSemanticColors.checkBox.disabled.border,
3637
checkBoxIndeterminateBackground: HighContrastDarkSemanticColors.checkBox.checked.background,

packages/azure-themes/src/azure/AzureThemeHighContrastLight.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const highContrastLightExtendedSemanticColors: Partial<IExtendedSemanticColors>
3131
checkBoxCheck: HighContrastLightSemanticColors.checkBox.rest.check,
3232
checkBoxCheckedFocus: HighContrastLightSemanticColors.checkBox.rest.focus,
3333
checkBoxCheckHover: HighContrastLightSemanticColors.checkBox.rest.hover,
34+
checkBoxCheckHoverTest: HighContrastLightSemanticColors.checkBox.rest.hoverText,
3435
checkBoxCheckedDisabledBackground: HighContrastLightSemanticColors.checkBox.disabled.background,
3536
checkBoxDisabled: HighContrastLightSemanticColors.checkBox.disabled.border,
3637
checkBoxIndeterminateBackground: HighContrastLightSemanticColors.checkBox.rest.check,

packages/azure-themes/src/azure/AzureThemeLight.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const lightExtendedSemanticColors: Partial<IExtendedSemanticColors> = {
3131
checkBoxCheck: LightSemanticColors.checkBox.rest.check,
3232
checkBoxCheckedFocus: LightSemanticColors.checkBox.rest.focus,
3333
checkBoxCheckHover: LightSemanticColors.checkBox.rest.hover,
34+
checkBoxCheckHoverTest: LightSemanticColors.checkBox.rest.hoverText,
3435
checkBoxCheckedDisabledBackground: LightSemanticColors.checkBox.disabled.background,
3536
checkBoxDisabled: LightSemanticColors.checkBox.disabled.border,
3637
checkBoxIndeterminateBackground: LightSemanticColors.checkBox.rest.check,

packages/azure-themes/src/azure/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
getScreenSelector,
66
} from '@fluentui/react/lib/Styling';
77

8+
export const inputHeight = '18px';
89
export const borderWidth = '1px';
910
export const borderWidthError = '1px';
1011
export const borderSolid = 'solid';

packages/azure-themes/src/azure/IAzureSemanticColors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ export interface IAzureSemanticColors {
9595
border: string;
9696
background: string;
9797
hover: string;
98+
hoverText: string;
9899
focus: string;
99100
check: string;
100101
};

packages/azure-themes/src/azure/IExtendedSemanticColors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface IExtendedSemanticColors extends ISemanticColors {
2727
checkBoxCheck: string;
2828
checkBoxCheckedFocus: string;
2929
checkBoxCheckHover: string;
30+
checkBoxCheckHoverTest: string;
3031
checkBoxCheckedDisabledBackground: string;
3132
checkBoxDisabled: string;
3233
checkBoxIndeterminateBackground: string;

packages/azure-themes/src/azure/styles/Checkbox.styles.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ICheckboxStyleProps, ICheckboxStyles } from '@fluentui/react/lib/Checkbox';
22
import { IExtendedSemanticColors } from '../IExtendedSemanticColors';
33
import { BaseColors } from '../AzureColors';
4+
import * as StyleConstants from '../Constants';
45

56
export const CheckboxStyles = (props: ICheckboxStyleProps): Partial<ICheckboxStyles> => {
67
const { disabled, checked, theme, indeterminate } = props;
@@ -12,6 +13,7 @@ export const CheckboxStyles = (props: ICheckboxStyleProps): Partial<ICheckboxSty
1213
{
1314
fontSize: theme.fonts.medium.fontSize,
1415
color: semanticColors.bodyText,
16+
lineHeight: StyleConstants.inputHeight,
1517
},
1618
disabled && {
1719
color: semanticColors.disabledBodyText,
@@ -26,6 +28,8 @@ export const CheckboxStyles = (props: ICheckboxStyleProps): Partial<ICheckboxSty
2628
backgroundColor: BaseColors.BLUE_0078D4,
2729
},
2830
},
31+
width: StyleConstants.inputHeight,
32+
height: StyleConstants.inputHeight,
2933
},
3034
checked && {
3135
backgroundColor: BaseColors.WHITE,
@@ -63,6 +67,9 @@ export const CheckboxStyles = (props: ICheckboxStyleProps): Partial<ICheckboxSty
6367
color: extendedSemanticColors.checkBoxCheckHover,
6468
opacity: '1',
6569
},
70+
':hover .ms-Checkbox-text': {
71+
color: extendedSemanticColors.checkBoxCheckHoverTest,
72+
},
6673
},
6774
},
6875
checked && {
@@ -75,6 +82,9 @@ export const CheckboxStyles = (props: ICheckboxStyleProps): Partial<ICheckboxSty
7582
borderColor: extendedSemanticColors.checkboxBorderCheckedHovered,
7683
backgroundColor: extendedSemanticColors.checkboxBackgroundHovered,
7784
},
85+
':hover .ms-Checkbox-text': {
86+
color: extendedSemanticColors.checkBoxCheckHoverTest,
87+
},
7888

7989
':focus .ms-Checkbox-label .ms-Checkbox-checkbox': {
8090
borderColor: extendedSemanticColors.focusBorder,
@@ -96,5 +106,10 @@ export const CheckboxStyles = (props: ICheckboxStyleProps): Partial<ICheckboxSty
96106
},
97107
],
98108
],
109+
input: {
110+
[`.ms-Fabric--isFocusVisible &:focus + label::before`]: {
111+
outline: `1px solid ${extendedSemanticColors.checkBoxCheckedFocus}`,
112+
},
113+
},
99114
};
100115
};

0 commit comments

Comments
 (0)