material-design-icons icon indicating copy to clipboard operation
material-design-icons copied to clipboard

web: icons do not follow page ltr/rtl direction

Open clshortfuse opened this issue 6 years ago • 3 comments

First of all, let me start of by saying, I'm not talking about glyph/icon mirroring.

When a page is using [dir=rtl] items should flow from right to left. Material Design Icons is forcing the orientation to be left to right, even on pages that should be right to left. This forces you to div wrap the icon for the layout to flow properly.

The line in question, specifically, is this one:

https://github.com/google/material-design-icons/blob/a6145e167b4a3a65640dd6279319cbc77a7e4e96/iconfont/material-icons.css#L24

Here's the codepen explaining the issue:

https://codepen.io/shortfuse/pen/RMgrOw

You can see the warning icon isn't properly respecting the page's RTL implementation.

I'm not sure why the direction: ltr since no browser actually mirrors the icons. This is even stated in the guide:

By default on the web, icons are not mirrored when the layout direction is mirrored. You need to specifically mirror the appropriate icons when needed.

Perhaps the usage of direction: ltr was misunderstood when the rule was added. If it is fully intentional, there should be a better explanation as to why it has to be used and how to workaround the layout direction issue.

clshortfuse avatar Mar 22 '18 19:03 clshortfuse

Seems like a bug/error, yes.

tphinney avatar Apr 28 '22 04:04 tphinney

Still happening on Material Symbols as well.

clshortfuse avatar Jul 19 '22 15:07 clshortfuse

@tphinney pls assign me this issue

GPGPgauravpunetha12 avatar Jan 17 '23 06:01 GPGPgauravpunetha12

https://developer.mozilla.org/en-US/docs/Web/CSS/direction#values given LTR is the default value, I'd suggest removing it altogether and letting implementors define it.

tomasdev avatar Feb 08 '23 06:02 tomasdev