Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove smart border style setting behavior #49714

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -45,35 +45,6 @@ function useHasBorderWidthControl( settings ) {
return settings?.border?.width;
}

function applyFallbackStyle( border ) {
if ( ! border ) {
return border;
}

if ( ! border.style && ( border.color || border.width ) ) {
return { ...border, style: 'solid' };
}

return border;
}

function applyAllFallbackStyles( border ) {
if ( ! border ) {
return border;
}

if ( hasSplitBorders( border ) ) {
return {
top: applyFallbackStyle( border.top ),
right: applyFallbackStyle( border.right ),
bottom: applyFallbackStyle( border.bottom ),
left: applyFallbackStyle( border.left ),
};
}

return applyFallbackStyle( border );
}

function BorderToolsPanel( {
resetAllFilter,
onChange,
Expand Down Expand Up @@ -186,7 +157,7 @@ export default function BorderPanel( {
const onBorderChange = ( newBorder ) => {
// Ensure we have a visible border style when a border width or
// color is being selected.
const updatedBorder = applyAllFallbackStyles( newBorder );
const updatedBorder = newBorder ? { ...newBorder } : undefined;

if ( hasSplitBorders( updatedBorder ) ) {
[ 'top', 'right', 'bottom', 'left' ].forEach( ( side ) => {
Expand Down