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

Fix RTL block alignments #11293

Merged
merged 2 commits into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions packages/block-library/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ $blocks-button__line-height: $big-font-size + 6px;
}

&.alignright {
/*rtl:ignore*/
text-align: right;
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/categories/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.wp-block-categories {
&.alignleft {
/*rtl:ignore*/
margin-right: 2em;
}
&.alignright {
/*rtl:ignore*/
margin-left: 2em;
}
}
4 changes: 4 additions & 0 deletions packages/block-library/src/classic/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,16 @@
}

.alignright {
/*rtl:ignore*/
float: right;
/*rtl:ignore*/
margin: 0.5em 0 0.5em 1em;
}

.alignleft {
/*rtl:ignore*/
float: left;
/*rtl:ignore*/
margin: 0.5em 1em 0.5em 0;
}

Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/file/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
}

&.alignright {
/*rtl:ignore*/
text-align: right;
}

Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,16 @@
}

.alignleft {
/*rtl:ignore*/
float: left;
/*rtl:ignore*/
margin-right: 1em;
}

.alignright {
/*rtl:ignore*/
float: right;
/*rtl:ignore*/
margin-left: 1em;
}

Expand Down
2 changes: 2 additions & 0 deletions packages/block-library/src/latest-posts/style.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.wp-block-latest-posts {
&.alignleft {
/*rtl:ignore*/
margin-right: 2em;
}
&.alignright {
/*rtl:ignore*/
margin-left: 2em;
}
&.is-grid {
Expand Down
11 changes: 11 additions & 0 deletions packages/editor/src/components/block-list/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -814,12 +814,23 @@
// It behaves as relative, in other words, until it reaches an edge and then behaves as fixed.
// But by applying a float, we take it out of this flow. The benefit is that we don't need to compensate for margins.
// In turn, this allows margins on sibling elements to collapse to parent elements.
// RTL note: this rule does need to be auto-flipped based on direction.
float: left;
}
}

.editor-block-list__block[data-align="left"] & {
@include break-small() {
// RTL note: this rule should not be auto-flipped based on direction.
/*rtl:ignore*/
float: left;
}
}

.editor-block-list__block[data-align="right"] & {
@include break-small() {
// RTL note: this rule should not be auto-flipped based on direction.
/*rtl:ignore*/
float: right;
}
}
Expand Down