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

Text orientation: Rotate vertical text when the text is aligned (Upside down text) #53175

Merged
merged 8 commits into from
Sep 1, 2023
5 changes: 5 additions & 0 deletions packages/block-library/src/paragraph/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@
}
}
}

.block-editor-block-list__block[data-type="core/paragraph"].has-text-align-right[style*="writing-mode: vertical-rl"],
.block-editor-block-list__block[data-type="core/paragraph"].has-text-align-left[style*="writing-mode: vertical-lr"] {
rotate: 180deg;
}
5 changes: 5 additions & 0 deletions packages/block-library/src/paragraph/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,8 @@ p.has-background {
:where(p.has-text-color:not(.has-link-color)) a {
color: inherit;
}

p.has-text-align-right[style*="writing-mode:vertical-rl"],
p.has-text-align-left[style*="writing-mode:vertical-lr"] {
rotate: 180deg;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
}
$styles = '';
if ( isset( $attributes['style']['typography']['writingMode'] ) ) {
$styles = "writing-mode:{$attributes['style']['typography']['writingMode']};";
$styles = "writing-mode: {$attributes['style']['typography']['writingMode']};";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an extra space here to match the inline style in the block editor.

}
$wrapper_attributes = get_block_wrapper_attributes(
array(
Expand Down
4 changes: 4 additions & 0 deletions packages/block-library/src/post-navigation-link/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@
}
}

&.has-text-align-right[style*="writing-mode: vertical-rl"],
&.has-text-align-left[style*="writing-mode: vertical-lr"] {
rotate: 180deg;
}
}