Repository navigation
Conversation
In RTL, the leading icon of a list item had its margins hardcoded to `32px` and `16px`, instead of using the `leading-icon-start-space` and `leading-icon-end-space` tokens like in LTR. The rule has to use physical properties, because icon font stylesheets (e.g. Material Icons/Symbols) set `direction: ltr` on the icon, which makes the logical margins resolve as LTR inside an RTL list. With the M2 values (16px/32px) this happened to look correct, but with M3 (16px/16px, smaller with density) the gap between the icon and the text was twice as large in RTL. These changes swap the token values in the RTL rule instead of hardcoding them, so RTL mirrors LTR for any theme. Fixes angular#30537.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In RTL, the leading icon of a list item had its margins hardcoded to
32pxand16px, instead of using theleading-icon-start-spaceandleading-icon-end-spacetokens like in LTR. The rule has to use physical properties, because icon font stylesheets (e.g. Material Icons/Symbols) setdirection: ltron the icon, which makes the logical margins resolve as LTR inside an RTL list. With the M2 values (16px/32px) this happened to look correct, but with M3 (16px/16px, smaller with density) the gap between the icon and the text was twice as large in RTL.These changes swap the token values in the RTL rule instead of hardcoding them, so RTL mirrors LTR for any theme.
Measured in an Angular 22.2 / Material 22.2.6 app (Chromium and Firefox), edge → icon / icon → text:
Fixes #30537.