Skip to content

Commit

Permalink
added style needed for borderRadius2
Browse files Browse the repository at this point in the history
  • Loading branch information
prconcepcion committed Oct 16, 2023
1 parent a240ccd commit 60682bd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/block-components/helpers/borders/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ const Styles = props => {
{ ...propsToPass }
// Adding a border radius should append `overflow: hidden`.
// This is to prevent gradient background from overflowing.
// borderRadius is deprecated, see comment below.
selector={ borderRadiusSelector || selector }
styleRule="overflow"
attrName="borderRadius"
Expand All @@ -109,6 +110,27 @@ const Styles = props => {
valueCallback={ () => 'hidden' }
dependencies={ [ 'overflow' ] }
/>
<BlockCss
{ ...propsToPass }
// borderRadius is deprecated, so we had to duplicate the style
// generated by the borderRadius to be used by borderRadius2.
selector={ borderRadiusSelector || selector }
styleRule="overflow"
attrName="borderRadius2"
key="borderRadius2-overflow"
attrNameTemplate={ attrNameTemplate }
responsive="all"
hover="all"
hoverSelector={ borderRadiusSelector ? undefined : hoverSelector }
enabledCallback={ ( _getAttribute, attributes ) => {
if ( addBorderRadiusOverflow && attrNameTemplate === 'block%s' && attributes.overflow ) {
return false
}
return addBorderRadiusOverflow
} }
valueCallback={ () => 'hidden' }
dependencies={ [ 'overflow' ] }
/>
<BlockCss
{ ...propsToPass }
selector={ selector }
Expand Down

0 comments on commit 60682bd

Please sign in to comment.