Skip to content

Commit 2f47e06

Browse files
ToMESSKabalzss
authored andcommitted
fix(many): adjust border colors to meet a11y contrast standards
Closes: INSTUI-4319
1 parent 569072e commit 2f47e06

File tree

37 files changed

+300
-51
lines changed

37 files changed

+300
-51
lines changed

packages/shared-types/src/Colors.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type Primitives = {
3030
grey12: string
3131
grey14: string
3232
grey24: string
33+
grey30: string
3334
grey45: string
3435
grey57: string
3536
grey70: string
@@ -195,6 +196,7 @@ type Contrasts = {
195196
grey1214: Primitives['grey12'] | Primitives['grey14']
196197
grey1424: Primitives['grey14'] | Primitives['grey24']
197198
grey2424: Primitives['grey24']
199+
grey3045: Primitives['grey30'] | Primitives['grey45']
198200
grey4570: Primitives['grey45'] | Primitives['grey70']
199201
grey5782: Primitives['grey57'] | Primitives['grey82']
200202
grey100100: Primitives['grey100']

packages/shared-types/src/ComponentThemeVariables.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,8 @@ export type ToggleFacadeTheme = {
345345
labelFontSizeMedium: Typography['fontSizeMedium']
346346
labelFontSizeLarge: Typography['fontSizeLarge']
347347
errorBorderColor: Colors['contrasts']['red4570']
348+
uncheckedIconBorderColor: Colors['contrasts']['grey3045']
349+
checkedIconBorderColor: Colors['contrasts']['green5782']
348350
}
349351

350352
export type CodeEditorTheme = {
@@ -536,6 +538,8 @@ export type DrilldownTheme = {
536538
headerTitleFontWeight: Typography['fontWeightBold']
537539
headerActionColor: Colors['contrasts']['blue4570']
538540
labelInfoPadding: Spacing['small']
541+
labelInfoColor: Colors['contrasts']['grey5782']
542+
borderColor: Colors['contrasts']['grey3045']
539543
}
540544

541545
export type FileDropTheme = {
@@ -714,6 +718,7 @@ export type MenuItemTheme = {
714718
activeBackground: Colors['contrasts']['blue4570']
715719
activeLabelColor: Colors['contrasts']['white1010']
716720
activeIconColor: Colors['contrasts']['white1010']
721+
labelInfoColor: Colors['contrasts']['grey5782']
717722
}
718723

719724
export type MenuGroupTheme = {
@@ -964,6 +969,10 @@ export type PillTheme = {
964969
borderRadius: string | 0
965970
}
966971

972+
export type PopoverTheme = {
973+
borderColor: Colors['contrasts']['grey3045']
974+
}
975+
967976
export type PositionTheme = {
968977
zIndex: Stacking['topmost']
969978
}
@@ -1423,6 +1432,10 @@ export type ToggleDetailsTheme = {
14231432
filledPadding: Spacing['small']
14241433
}
14251434

1435+
export type ToggleGroupTheme = {
1436+
borderColor: Colors['contrasts']['grey3045']
1437+
}
1438+
14261439
export type TooltipTheme = {
14271440
fontFamily: Typography['fontFamily']
14281441
fontWeight: Typography['fontWeightNormal']
@@ -1749,6 +1762,7 @@ export interface ThemeVariables {
17491762
Pages: PagesTheme
17501763
PaginationPageInput: PaginationPageInputTheme
17511764
'Pagination.PageInput': PaginationPageInputTheme
1765+
Popover: PopoverTheme
17521766
Position: PositionTheme
17531767
Pill: PillTheme
17541768
ProgressBar: ProgressBarTheme
@@ -1785,6 +1799,8 @@ export interface ThemeVariables {
17851799
TextArea: TextAreaTheme
17861800
TextInput: TextInputTheme
17871801
ToggleDetails: ToggleDetailsTheme
1802+
ToggleGroup: ToggleGroupTheme
1803+
'ToggleDetails.ToggleGroup': ToggleGroupTheme
17881804
Tooltip: TooltipTheme
17891805
TopNavBarBrand: TopNavBarBrandTheme
17901806
'TopNavBar.Brand': TopNavBarBrandTheme

packages/ui-avatar/src/Avatar/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const generateComponentTheme = (theme: Theme): AvatarTheme => {
3838
background: colors?.contrasts?.white1010,
3939
borderWidthSmall: borders?.widthSmall,
4040
borderWidthMedium: borders?.widthMedium,
41-
borderColor: colors?.contrasts?.grey1214,
41+
borderColor: colors?.contrasts?.grey3045,
4242
boxShadowColor: alpha('#2d3b45', 12),
4343
boxShadowBlur: '1rem',
4444
fontFamily: typography?.fontFamily,

packages/ui-buttons/src/BaseButton/theme.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ const generateComponentTheme = (theme: Theme): BaseButtonTheme => {
3939
const themeSpecificStyle: ThemeSpecificStyle<BaseButtonTheme> = {
4040
canvas: {
4141
primaryColor: theme['ic-brand-button--primary-text']!,
42-
primaryBorderColor: theme['ic-brand-button--primary-bgd']!,
42+
primaryBorderColor: darken(theme['ic-brand-button--primary-bgd']!),
4343
primaryBackground: theme['ic-brand-button--primary-bgd']!,
4444
primaryHoverBackground: darken(theme['ic-brand-button--primary-bgd']!),
4545
primaryActiveBackground: darken(theme['ic-brand-button--primary-bgd']!),
4646
primaryActiveBoxShadow: `${activeShadow} ${theme[
4747
'ic-brand-button--primary-bgd'
4848
]!}`,
49-
primaryGhostColor: theme['ic-brand-button--primary-bgd']!,
50-
primaryGhostBorderColor: theme['ic-brand-button--primary-bgd']!,
49+
primaryGhostColor: darken(theme['ic-brand-button--primary-bgd']!),
50+
primaryGhostBorderColor: darken(theme['ic-brand-button--primary-bgd']!),
5151
primaryGhostBackground: 'transparent',
5252
primaryGhostHoverBackground: alpha(
53-
theme['ic-brand-button--primary-bgd']!,
53+
darken(theme['ic-brand-button--primary-bgd']!),
5454
10
5555
),
5656
primaryGhostActiveBackground: 'transparent',
@@ -104,10 +104,10 @@ const generateComponentTheme = (theme: Theme): BaseButtonTheme => {
104104
primaryHoverBackground: colors?.contrasts?.blue5782,
105105
primaryActiveBackground: colors?.contrasts?.blue5782,
106106
primaryActiveBoxShadow: `${activeShadow} ${colors?.contrasts?.white1010}`,
107-
primaryGhostColor: colors?.contrasts?.blue4570,
107+
primaryGhostColor: colors?.contrasts?.blue5782,
108108
primaryGhostBorderColor: colors?.contrasts?.blue4570,
109109
primaryGhostBackground: 'transparent',
110-
primaryGhostHoverBackground: alpha(colors?.contrasts?.blue4570, 10),
110+
primaryGhostHoverBackground: colors?.contrasts?.blue1212,
111111
primaryGhostActiveBackground: 'transparent',
112112
primaryGhostActiveBoxShadow: `${activeShadow} ${alpha(
113113
colors?.contrasts?.blue1212,
@@ -123,7 +123,7 @@ const generateComponentTheme = (theme: Theme): BaseButtonTheme => {
123123
secondaryGhostColor: colors?.contrasts?.grey125125,
124124
secondaryGhostBorderColor: colors?.contrasts?.grey125125,
125125
secondaryGhostBackground: 'transparent',
126-
secondaryGhostHoverBackground: alpha(colors?.contrasts?.grey125125, 10),
126+
secondaryGhostHoverBackground: colors?.contrasts?.grey1111,
127127
secondaryGhostActiveBackground: 'transparent',
128128
secondaryGhostActiveBoxShadow: `${activeShadow} ${alpha(
129129
colors?.contrasts?.grey125125,

packages/ui-checkbox/src/Checkbox/CheckboxFacade/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const generateComponentTheme = (theme: Theme): CheckboxFacadeTheme => {
4747
const componentVariables: CheckboxFacadeTheme = {
4848
color: colors?.contrasts?.white1010,
4949
borderWidth: borders?.widthSmall,
50-
borderColor: colors?.contrasts?.grey1214,
50+
borderColor: colors?.contrasts?.grey3045,
5151
errorBorderColor: colors?.ui?.textError,
5252
borderRadius: borders?.radiusMedium,
5353
background: colors?.contrasts?.white1010,

packages/ui-checkbox/src/Checkbox/ToggleFacade/styles.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,16 @@ const generateStyle = (
157157
'&::before': {
158158
content: '""',
159159
position: 'absolute',
160-
top: componentTheme.borderWidth,
161-
left: componentTheme.borderWidth,
162-
height: `calc(100% - (${componentTheme.borderWidth} * 2))`,
163-
width: `calc(100% - (${componentTheme.borderWidth} * 2))`,
160+
height: `calc(100% - (${componentTheme.borderWidth} * 6))`,
161+
width: `calc(100% - (${componentTheme.borderWidth} * 6))`,
164162
background: componentTheme.toggleBackground,
165163
boxShadow: componentTheme.toggleShadow,
166-
borderRadius: '100%'
164+
borderRadius: '100%',
165+
border: `${componentTheme.borderWidth} solid ${
166+
checked
167+
? componentTheme.checkedIconBorderColor
168+
: componentTheme.uncheckedIconBorderColor
169+
}`
167170
}
168171
},
169172

packages/ui-checkbox/src/Checkbox/ToggleFacade/theme.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ const generateComponentTheme = (theme: Theme): ToggleFacadeTheme => {
5656
color: colors?.contrasts?.white1010,
5757
errorBorderColor: colors?.ui?.textError,
5858
background: colors?.contrasts?.grey1111,
59-
borderColor: colors?.contrasts?.grey1214,
59+
borderColor: colors?.contrasts?.grey3045,
6060
borderWidth: borders?.widthSmall,
6161
borderRadius: '4rem',
6262
marginEnd: spacing?.small,
6363
marginStart: spacing?.small,
6464
marginVertical: spacing?.xSmall,
6565
checkedBackground: colors?.contrasts?.green4570,
6666
uncheckedIconColor: colors?.contrasts?.grey125125,
67-
checkedIconColor: colors?.contrasts?.green4570,
67+
checkedIconColor: colors?.contrasts?.green5782,
6868
focusOutlineColor: colors?.contrasts?.blue4570,
6969
focusBorderWidth: borders?.widthMedium,
7070
focusBorderStyle: borders?.style,
@@ -77,7 +77,9 @@ const generateComponentTheme = (theme: Theme): ToggleFacadeTheme => {
7777
labelLineHeight: typography?.lineHeightCondensed,
7878
labelFontSizeSmall: typography?.fontSizeSmall,
7979
labelFontSizeMedium: typography?.fontSizeMedium,
80-
labelFontSizeLarge: typography?.fontSizeLarge
80+
labelFontSizeLarge: typography?.fontSizeLarge,
81+
uncheckedIconBorderColor: colors?.contrasts?.grey5782,
82+
checkedIconBorderColor: colors?.contrasts?.green5782
8183
}
8284

8385
return {

packages/ui-drilldown/src/Drilldown/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,6 +1377,7 @@ class Drilldown extends Component<DrilldownProps, DrilldownState> {
13771377
getDisabledOptionProps
13781378
}) => (
13791379
<View
1380+
borderWidth="small"
13801381
as="div"
13811382
elementRef={this.handleDrilldownRef}
13821383
tabIndex={0}

packages/ui-drilldown/src/Drilldown/styles.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const generateStyle = (
5050
drilldown: {
5151
label: 'drilldown',
5252
overflow: 'visible', // needed for focus ring!
53+
borderColor: componentTheme.borderColor,
5354

5455
...(hasHighlightedOption && {
5556
'&:focus::before': {
@@ -80,7 +81,8 @@ const generateStyle = (
8081
flexShrink: 0,
8182
height: '100%',
8283
alignItems: 'center',
83-
paddingInlineStart: componentTheme.labelInfoPadding
84+
paddingInlineStart: componentTheme.labelInfoPadding,
85+
color: componentTheme.labelInfoColor
8486
},
8587
optionContent: {
8688
label: 'drilldown__optionContent',

packages/ui-drilldown/src/Drilldown/theme.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ const generateComponentTheme = (theme: Theme): DrilldownTheme => {
3636
const componentVariables: DrilldownTheme = {
3737
headerTitleFontWeight: typography.fontWeightBold,
3838
headerActionColor: colors?.contrasts?.blue4570,
39-
labelInfoPadding: spacing?.small
39+
labelInfoPadding: spacing?.small,
40+
labelInfoColor: colors?.contrasts?.grey5782,
41+
borderColor: colors?.contrasts?.grey3045
4042
}
4143

4244
return {

0 commit comments

Comments
 (0)