Update a point in the RTL documentation #41098
Merged
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.
Description
This is a follow up of this pull request in which a small section was added to the RTL documentation. PostCSS RTLCSS has a new directive that is more aligned with the
/*rtl:remove*/directives ofRTLCSS.Motivation & Context
Previous recommendation was to use the
/*rtl:ignore*/,/*rtl:begin:ignore*/and/*rtl:end:ignore*/directives, stating that as these directives do not create an RTL counterpart, the result will be the same as using theremoveones inRTLCSS.The previous statement is not completely true. It is true that the
ignoredirectives ofPostCSS RTLCCSdo not create a RTL counterpart, but this will not achieve the same result as removing the rule/declaration from thertl.cssbundle.For example, having the next input:
The resulted output will be:
It is true, that
.example-2has not been processed and no RTL rule has been created for it. But this means that those users in RTL will still have thatpadding-leftaffecting the elements with the classexample-2.RTLCSS(using theremovedirective) would have generated a bundle file without the.example-2rule, so users in RTL will not have thepadding-left.PostCSS RTLCSShas a new directive that will achieve the same asRTLCCSwith theremovedirectives. Consider the next input:The resulted output will be:
Now the
padding-leftwill only affect to users in LTR and users in RTL will not have it.Type of changes
Checklist
npm run lint)Live previews
Related issues
#39863