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

feat(framework): make icons RTL aware #1833

Merged
merged 5 commits into from
Jun 22, 2020
Merged

feat(framework): make icons RTL aware #1833

merged 5 commits into from
Jun 22, 2020

Conversation

ilhan007
Copy link
Member

@ilhan007 ilhan007 commented Jun 18, 2020

Currently all icons are mirrored in RTL, but some of the icons should not be mirrored in RTL. The best example is the "accept" icon (checkmark) which does not make sense when mirrored. Now we keep info as "ltr" field in the SAP-Icons.json, which means an icon should remain as it is in RTL, or in other words it is always LTR. We can call the field differently in the SVGRegistry if we want - suppressMirroring, noMirror. I named it "ltr" everywhere for now.

FIXES: #1831

@ilhan007 ilhan007 changed the title feat: make icons RTL aware feat(ui5-icon): make icons RTL aware Jun 18, 2020
@ilhan007 ilhan007 requested a review from vladitasev June 18, 2020 14:16
@ilhan007 ilhan007 changed the title feat(ui5-icon): make icons RTL aware feat(framework): make icons RTL aware Jun 18, 2020
@ilhan007 ilhan007 closed this Jun 18, 2020
@ilhan007 ilhan007 reopened this Jun 18, 2020
packages/tools/lib/create-icons/index.js Outdated Show resolved Hide resolved
@@ -14,9 +14,9 @@ const calcKey = (name, collection) => {
return `${collection}:${name}`;
};

const registerIcon = (name, { pathData, accData, collection } = {}) => {
const registerIcon = (name, { pathData, ltr, accData, collection } = {}) => { // eslint-disable-line
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the eslint ignore?

Copy link
Member Author

Choose a reason for hiding this comment

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

I am getting these (although I am adding one additional key):
17:29 error Expected a line break after this opening brace object-curly-newline
17:66 error Expected a line break before this closing brace object-curly-newline

@ilhan007 ilhan007 requested a review from vladitasev June 19, 2020 11:21
vladitasev
vladitasev previously approved these changes Jun 19, 2020
@ilhan007 ilhan007 closed this Jun 22, 2020
@ilhan007 ilhan007 reopened this Jun 22, 2020
@ilhan007 ilhan007 merged commit 29a991f into master Jun 22, 2020
@ilhan007 ilhan007 deleted the fix-icons-rtl branch June 22, 2020 07:07
@ilhan007 ilhan007 added this to 1.0.0-rc.8 (released) in UI5 Web Components - Roadmap Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui5-icon: add information to all icons whether they should mirror in RTL
2 participants