Skip to content

Commit

Permalink
Fix: Permalink editor rtl languages
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta committed Feb 24, 2019
1 parent 3397ae4 commit 476c507
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 16 deletions.
26 changes: 14 additions & 12 deletions packages/edit-post/src/components/sidebar/post-link/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,20 @@ function PostLink( {
<p className="edit-post-post-link__preview-label">
{ __( 'Preview' ) }
</p>
<ExternalLink
className="edit-post-post-link__link"
href={ postLink }
target="_blank"
>
{ isEditable ?
( <Fragment>
{ prefixElement }{ postNameElement }{ suffixElement }
</Fragment> ) :
postLink
}
</ExternalLink>
<div className="edit-post-post-link__preview-link-container">
<ExternalLink
className="edit-post-post-link__link"
href={ postLink }
target="_blank"
>
{ isEditable ?
( <Fragment>
{ prefixElement }{ postNameElement }{ suffixElement }
</Fragment> ) :
postLink
}
</ExternalLink>
</div>
</PanelBody>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@
.edit-post-post-link__link {
word-wrap: break-word;
}

/* rtl:begin:ignore */
.edit-post-post-link__preview-link-container {
direction: ltr;
}
/* rtl:end:ignore */
18 changes: 14 additions & 4 deletions packages/editor/src/components/post-permalink/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@
overflow: hidden;
position: relative;
white-space: nowrap;

&::after {
@include long-content-fade($size: 20%, $edge: 1px);
}
}

.editor-post-permalink-editor {
Expand Down Expand Up @@ -110,3 +106,17 @@
margin-right: 6px;
flex: 0 0 0%;
}

/* rtl:begin:ignore */
.editor-post-permalink {
direction: ltr;
.editor-post-permalink__edit {
float: left;
}
.editor-post-permalink__link::after {
@include long-content-fade($direction: right, $size: 20%, $edge: 1px);
right: 0;
left: auto;
}
}
/* rtl:end:ignore */

0 comments on commit 476c507

Please sign in to comment.