Commit 0122f4d 1 parent 88f9456 commit 0122f4d Copy full SHA for 0122f4d
File tree 2 files changed +7
-15
lines changed
packages/block-library/src/cover
2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change 9
9
__experimentalBlockAlignmentMatrixControl as BlockAlignmentMatrixControl ,
10
10
__experimentalBlockFullHeightAligmentControl as FullHeightAlignmentControl ,
11
11
} from '@wordpress/block-editor' ;
12
- import { __ , isRTL } from '@wordpress/i18n' ;
12
+ import { __ } from '@wordpress/i18n' ;
13
13
14
14
/**
15
15
* Internal dependencies
@@ -58,27 +58,15 @@ export default function CoverBlockControls( {
58
58
} ) ;
59
59
} ;
60
60
61
- // Flip value horizontally to match the physical direction indicated by
62
- // AlignmentMatrixControl with the logical direction indicated by cover
63
- // block in RTL languages.
64
- const flipHorizontalPosition = ( ltrContentPosition ) => {
65
- return isRTL ( )
66
- ? ltrContentPosition . replace ( / l e f t | r i g h t / , ( match ) =>
67
- match === 'left' ? 'right' : 'left'
68
- )
69
- : ltrContentPosition ;
70
- } ;
71
-
72
61
return (
73
62
< >
74
63
< BlockControls group = "block" >
75
64
< BlockAlignmentMatrixControl
76
65
label = { __ ( 'Change content position' ) }
77
- value = { flipHorizontalPosition ( contentPosition ) }
66
+ value = { contentPosition }
78
67
onChange = { ( nextPosition ) =>
79
68
setAttributes ( {
80
- contentPosition :
81
- flipHorizontalPosition ( nextPosition ) ,
69
+ contentPosition : nextPosition ,
82
70
} )
83
71
}
84
72
isDisabled = { ! hasInnerBlocks }
Original file line number Diff line number Diff line change 9
9
padding : 1em ;
10
10
// This block has customizable padding, border-box makes that more predictable.
11
11
box-sizing : border-box ;
12
+ // Keep the flex layout direction to the physical direction (LTR) in RTL languages.
13
+ /* rtl:raw: direction: ltr; */
12
14
13
15
/* *
14
16
* Set a default background color for has-background-dim _unless_ it includes another
105
107
width : 100% ;
106
108
z-index : z-index (" .wp-block-cover__inner-container" );
107
109
color : $white ;
110
+ // Reset the fixed LTR direction at the root of the block in RTL languages.
111
+ /* rtl:raw: direction: rtl; */
108
112
}
109
113
110
114
& .is-light {
You can’t perform that action at this time.
0 commit comments