Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL: Flip some dashicons that have directionality #3912

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions components/dashicon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ DO NOT EDIT THAT FILE! EDIT index-header.jsx and index-footer.jsx instead
OR if you're looking to change now SVGs get output, you'll need to edit strings in the Gruntfile :)
!!! */

/**
* Internal dependencies
*/
import './style.scss';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is generated, so this import would be overwritten next time the Dashicons is updated. It seems like the RTL flipping could be valuable to have in the base Dashicons repository, but in keeping it generic we'd not want to assume the presence of an .rtl body class. Would it be reasonable to detect RTL from JavaScript inside the component class and apply an inline style?

https://github.com/WordPress/dashicons/blob/master/sources/react/index-header.jsx
https://github.com/WordPress/dashicons/blob/master/sources/react/index-footer.jsx


/**
* External dependencies
*/
Expand Down
10 changes: 10 additions & 0 deletions components/dashicon/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
body.rtl .gutenberg .dashicon {
&.dashicons-editor-outdent,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixed whitespace, tabs and spaces.

&.dashicons-editor-indent,
&.dashicons-list-view,
&.dashicons-editor-ul {
transform: scaleX(-1);
-ms-filter: fliph;
filter: FlipH;
}
}