Skip to content

Commit

Permalink
Fix CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Nov 28, 2019
1 parent 5d0d275 commit bf9d785
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions packages/components/src/popover/index.js
Expand Up @@ -285,6 +285,12 @@ const Popover = ( {
contentRef.current.style.maxWidth = contentWidth + 'px';
}

if ( xAxis === 'center' && yAxis === 'middle' ) {
contentRef.current.classList.add( 'is-without-arrow' );
} else {
contentRef.current.classList.remove( 'is-without-arrow' );
}

setAnimateOrigin( animateXAxis + ' ' + animateYAxis );
};

Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/popover/style.scss
Expand Up @@ -13,7 +13,7 @@ $arrow-size: 8px;
bottom: 0;
}

&:not(.is-without-arrow):not([data-x-axis="center"][data-y-axis="middle"]):not(.is-mobile) {
&:not(.is-without-arrow):not(.is-mobile) {
margin-left: 2px;

&::before {
Expand Down Expand Up @@ -75,7 +75,7 @@ $arrow-size: 8px;
}
}

&.is-middle[data-x-axis="left"] {
&[data-y-axis="middle"][data-x-axis="left"] {
margin-left: -$arrow-size;

&::before {
Expand All @@ -95,7 +95,7 @@ $arrow-size: 8px;
}
}

&.is-middle[data-x-axis="right"] {
&[data-y-axis="middle"][data-x-axis="right"] {
margin-left: $arrow-size;

&::before {
Expand Down

0 comments on commit bf9d785

Please sign in to comment.