Mirror icons in RTL
example.css
:dir(rtl) .chevron {
transform: scaleX(-1);
}
The :dir() pseudo-class matches elements by their computed directionality. Use :dir(rtl) or :dir(ltr) to adjust icons, margins, and alignment.
:dir(rtl) .icon {
transform: scaleX(-1);
}:dir(rtl) .chevron {
transform: scaleX(-1);
}:dir() is a CSS selector.
Supported in modern browsers.
Bottom line: Safe for modern sites. Keep readable defaults without the selector.
Continue with :defined.
CODETOFUN NEWS
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
2 people found this page helpful