Use logical instead of physical block margins #206
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am currently trying to use Capsize with text, that is rotated 90deg (using
writing-mode: vertical-lr;
). The current implementation always appliesmargin-top
andmargin-bottom
, regardless of the actual orientation.This PR replaces
margin-top
withmargin-block-start
andmargin-bottom
withmargin-block-end
, as these properties respect aforementioned text orientation.From MDN:
However while this fixes text in vertical writing mode, it does not work with text in vertical writing mode and upright text orientation:
writing-mode: vertical-lr; // or vertical-rl; text-orientation: upright;
This incorrectly (in the case of capsize) applies left and right margins when using start and end.
I personally think breaking this in favor of supporting vertical text is a worth trade-off, but this is of course up for discussion. Alternatively, this could be an extra opt-in option instead of replacing the current behavior.
I am not sure if this would affect east asian languages that may be written vertically. To my knowledge these are also written horizontally on the web.