Skip to content

Commit

Permalink
Fix: Permalink editor rtl languages (#13919)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored Sep 9, 2019
1 parent 96cadd0 commit 276981d
Show file tree
Hide file tree
Showing 3 changed files with 41 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">
{ postTypeLabel || __( 'View Post' ) }
</p>
<ExternalLink
className="edit-post-post-link__link"
href={ postLink }
target="_blank"
>
{ isEditable ?
( <>
{ prefixElement }{ postNameElement }{ suffixElement }
</> ) :
postLink
}
</ExternalLink>
<div className="edit-post-post-link__preview-link-container">
<ExternalLink
className="edit-post-post-link__link"
href={ postLink }
target="_blank"
>
{ isEditable ?
( <>
{ prefixElement }{ postNameElement }{ suffixElement }
</> ) :
postLink
}
</ExternalLink>
</div>
</PanelBody>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,13 @@
}

.edit-post-post-link__link {
text-align: left;
word-wrap: break-word;
display: block;
}

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

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

.editor-post-permalink-editor {
Expand Down Expand Up @@ -131,3 +128,21 @@
margin-right: 6px;
flex: 0 0 0%;
}

.editor-post-permalink-editor__prefix {
text-align: left;
}

/* rtl:begin:ignore */
.editor-post-permalink__link {
text-align: left;
}
.editor-post-permalink__editor-container,
.editor-post-permalink__link {
direction: ltr;
}
.editor-post-permalink__link::after {
@include long-content-fade($direction:right, $size: 20%, $edge: 0);
}
/* rtl:end:ignore */

0 comments on commit 276981d

Please sign in to comment.