Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clean up BorderControls focus styles now UnitControl handles it
  • Loading branch information
aaronrobertshaw committed Jul 22, 2022
commit fc71aced51229e94d444fff5a65b250812fb1d5a
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const UnconnectedBorderControl = (
showDropdownHeader,
sliderClassName,
value: border,
widthControlClassName,
widthUnit,
widthValue,
withSlider,
Expand Down Expand Up @@ -93,7 +92,6 @@ const UnconnectedBorderControl = (
}
label={ __( 'Border width' ) }
hideLabelFromVision
className={ widthControlClassName }
min={ 0 }
onChange={ onWidthChange }
value={ border?.width || '' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,6 @@ export function useBorderControl(
return cx( styles.innerWrapper(), widthStyle, heightStyle );
}, [ isCompact, width, cx, __next36pxDefaultSize ] );

const widthControlClassName = useMemo( () => {
return cx( styles.borderWidthControl() );
}, [ cx ] );

const sliderClassName = useMemo( () => {
return cx( styles.borderSlider() );
}, [ cx ] );
Expand All @@ -145,7 +141,6 @@ export function useBorderControl(
previousStyleSelection: styleSelection,
sliderClassName,
value: border,
widthControlClassName,
widthUnit,
widthValue,
__next36pxDefaultSize,
Expand Down
19 changes: 0 additions & 19 deletions packages/components/src/border-control/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
StyledField,
StyledLabel,
} from '../base-control/styles/base-control-styles';
import { BackdropUI } from '../input-control/styles/input-control-styles';
import {
Root as UnitControlWrapper,
UnitSelect,
Expand All @@ -39,17 +38,6 @@ export const innerWrapper = () => css`
&& ${ UnitSelect } {
/* Prevent unit select forcing min height larger than its UnitControl */
min-height: 0;
${ rtl(
{ borderRadius: '0 2px 2px 0' },
{ borderRadius: '2px 0 0 2px' }
)() }
transition: box-shadow 0.1s linear, border 0.1s linear;

&:focus {
z-index: 1;
${ focusBoxShadow }
border: 1px solid ${ COLORS.ui.borderFocus };
}
}
`;

Expand Down Expand Up @@ -185,13 +173,6 @@ export const resetButton = css`
}
`;

export const borderWidthControl = () => css`
/* Target the InputControl's backdrop */
&&& ${ BackdropUI } {
transition: box-shadow 0.1s linear;
}
`;

export const borderControlStylePicker = css`
${ StyledLabel } {
${ labelStyles }
Expand Down