Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve RTL rendering #3831

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion components/panel/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,28 @@
font-weight: 600;
text-align: left;

body.rtl & {
text-align: right;
}

.dashicon {
position: absolute;
right: 10px;
right: $item-spacing;
top: 50%;
transform: translateY( -50% );

body.rtl & {
right: auto;
left: $item-spacing;
}
}

// mirror the arrow horizontally in RTL languages
body.rtl & .dashicons-arrow-right {
transform: scaleX(-1);
-ms-filter: fliph;
filter: FlipH;
margin-top: -10px;
}
}

Expand Down
6 changes: 6 additions & 0 deletions editor/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ body.gutenberg-editor-page {
ul#adminmenu>li.current>a.current:after {
border-right-color: $white;
}

&.rtl ul#adminmenu a.wp-has-current-submenu:after,
&.rtl ul#adminmenu>li.current>a.current:after {
border-right-color: transparent;
border-left-color: $white;
}
}

.gutenberg {
Expand Down
50 changes: 34 additions & 16 deletions editor/edit-post/header/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

@include break-large() {
left: $admin-sidebar-width;

body.rtl & {
left: 0;
right: $admin-sidebar-width;
}
}
}

Expand All @@ -29,47 +34,60 @@
}
}

body.rtl.sticky-menu .editor-header {
@include break-medium() {
left: 0;
right: $admin-sidebar-width;
}
}

.auto-fold .editor-header { /* Auto fold is when on smaller breakpoints, nav menu auto colllapses */
@include break-medium() {
left: $admin-sidebar-width-collapsed;

body.rtl & {
left: 0;
right: $admin-sidebar-width-collapsed;
}
}

@include break-large() {
left: $admin-sidebar-width;

body.rtl & {
left: 0;
right: $admin-sidebar-width;
}
}
}

/* Sidebar manually collapsed */
.folded .editor-header {
left: 0;

body.rtl & {
right: 0;
}

@include break-medium() {
left: $admin-sidebar-width-collapsed;

body.rtl & {
left: 0;
right: $admin-sidebar-width-collapsed;
}
}
}

/* Mobile menu opened */
.auto-fold .wp-responsive-open .editor-header {
left: $admin-sidebar-width-big;
right: -$admin-sidebar-width-big;
}

/* RTL */
.rtl.auto-fold .editor-header {
@include break-medium() {
left: 0;
right: $admin-sidebar-width-collapsed;
body.rtl & {
left: -$admin-sidebar-width-big;
right: $admin-sidebar-width-big;
}

@include break-large() {
left: 0;
right: $admin-sidebar-width;
}
}

.rtl.auto-fold .wp-responsive-open .editor-header {
left: -$admin-sidebar-width-big;
right: $admin-sidebar-width-big;
}

.editor-header__settings {
Expand Down
29 changes: 28 additions & 1 deletion editor/edit-post/sidebar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
height: 100vh;
overflow: hidden;

body.rtl & {
right: auto;
left: 0;
border-left: none;
border-right: 1px solid $light-gray-500;
}

@include break-small() {
top: $admin-bar-height-big + $header-height;
z-index: auto;
Expand Down Expand Up @@ -86,6 +93,11 @@
.editor-layout.is-sidebar-opened .editor-layout__content {
@include break-medium() {
margin-right: $sidebar-width;

body.rtl & {
margin-right: 0;
margin-left: $sidebar-width;
}
}
}

Expand All @@ -102,16 +114,31 @@
/* Text Editor specific */
.editor-layout.is-sidebar-opened .editor-text-editor__formatting {
margin-right: $sidebar-width;

body.rtl & {
margin-right: 0;
margin-left: $sidebar-width;
}
}

.components-panel__header.editor-sidebar__panel-tabs {
justify-content: flex-start;
border-top: 0;
padding-left: 0;
padding-right: $panel-padding / 2;
border-top: 0;

body.rtl & {
padding-right: 0;
padding-left: $panel-padding / 2;
}

.components-icon-button {
margin-left: auto;

body.rtl & {
margin-left: 0;
margin-right: auto;
}
}
}

Expand Down