Remove autoRename option and rename directives #244
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.
This pull request is a breaking change and a major release of the library.
Main change
The
autoRename
option was mimicking RTLCSS, but it didn‘t make sense forpostcss-rtlcss
in which both direction rules should be shipped in the same stylesheet. For example, taking the same examples from the README:input
Using Autorename.flexible
output
Using Autorename.strict
output
These outputs flipped the name of the rules but they will not change depending on the direction of the page. Instead of this, the plugin should prefix the rules and create ones for LTR and others for RTL.
Changes in this pull request
Removal of
autoRename
option.As this option is not useful in the context of
postcss-rtlcss
it has been replaced by a new option:processRuleNames
. WithprocessRuleNames
, the rules that do not contain directional properties will be swapped depending on the direction of the page. For example:input
processRuleNames true
output
Removal of
/*rtl:rename*/
,/*rtl:begin:rename*/
, and/*rtl:end:rename*/
directivesAs the
autoRename
option was removed, these directives have been replaced by new directives that will only affect declarations with URLs:/*rtl:urls*/
,/*rtl:begin:urls*/
, and/*rtl:end:urls*/
.input
output
input
output
Closes: #242