toolbar/ActionButton: improve focus ring visibility

Since the button and the focus ring are both blue, we need a gap in
order to have enough contrast to see the focus ring.
This commit is contained in:
David Lechner
2022-12-16 17:54:36 -06:00
committed by David Lechner
parent b85945ab1d
commit 303e768168
2 changed files with 20 additions and 11 deletions
+4 -1
View File
@@ -110,7 +110,10 @@ const ActionButton: React.VoidFunctionComponent<ActionButtonProps> = ({
aria-label={label}
elementRef={tooltipTargetRef as React.Ref<HTMLButtonElement>}
{...mergeProps(tooltipTargetProps, {
className: classNames(enabled === false && Classes.DISABLED),
className: classNames(
'pb-toolbar-action-button',
enabled === false && Classes.DISABLED,
),
})}
intent={Intent.PRIMARY}
onClick={handleClick}
+16 -10
View File
@@ -19,18 +19,24 @@
padding: 5px;
}
}
}
.pb-toolbar * {
box-shadow: unset !important;
}
.pb-toolbar-group {
&.pb-align-left {
margin-right: bp.$pt-grid-size * 2;
// override blueprint.js style
& * {
box-shadow: unset !important;
}
&.pb-align-right {
margin-left: auto;
&-group {
&.pb-align-left {
margin-right: bp.$pt-grid-size * 2;
}
&.pb-align-right {
margin-left: auto;
}
}
&-action-button:focus-visible:not(.pb-focus-managed) {
// to get contrast since button background and focus ring are both blue
outline-offset: 4px;
}
}