Skip to content

fix(item): RTL fix for item - #11329

Closed
sijav wants to merge 22 commits into
ionic-team:masterfrom
sijav:rtl-fix-item
Closed

sijav wants to merge 22 commits into
ionic-team:masterfrom
sijav:rtl-fix-item

Conversation

@sijav

@sijav sijav commented Apr 23, 2017 •

Copy link
Copy Markdown
Contributor

Short description of what this resolves:

RTL fix (scss changes) for item for wp, ios and android platform

Changes proposed in this pull request:

  • Add SVG for detail push and fix for RTL (wp,md,ios)

Ionic Version: 2.x / 3.x

Fixes: #11211

sijav added 2 commits April 23, 2017 15:17
RTL fix (scss changes) for list-header for wp, ios and android platform
RTL fix (scss changes) for item including item-detail-push, item,
item-devider, icons avatars and thumbnails on items and item-inner fix
for wp, ios and android platform
Comment thread src/components/item/item.ios.scss Outdated
background-position: right ($item-ios-padding-right - 2) center;
background-size: 14px 14px;
}
[dir="rtl"] .item-ios[detail-push] .item-inner,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing line break

Comment thread src/components/item/item.md.scss Outdated
background-position: right ($item-md-padding-right - 2) center;
background-size: 14px 14px;
}
[dir="rtl"] .item-md[detail-push] .item-inner,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing line break

Comment thread src/components/item/item.wp.scss Outdated
background-position: right ($item-wp-padding-right - 2) center;
background-size: 14px 14px;
}
[dir="rtl"] .item-wp[detail-push] .item-inner,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing line break

Comment thread src/components/item/item.md.scss Outdated
[dir="rtl"] a.item-md:not([detail-none]) .item-inner {
@include svg-background-image($item-md-detail-push-svg-rtl);
padding-right: 0;
padding-left: 32px;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you store 32px in a variable?

Everything else looks great to me

@sijav sijav Apr 23, 2017 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@AmitMY I can but every other variable has been stored in theme, should I add a variable in theme and modify themes too? or else where?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think in the theme file you need to have a variable:
'$x = 32px'
And then it should be in every file (iOS, md, wp) at the top, near all of the other variables, like:
'$x-ios = $x'

@AmitMY AmitMY Apr 23, 2017 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

*And the name should be 'item-detail-push-padding-end'
Per platform - 'item-{plt}-detail-push-padding-end'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well ... for now I've just added a variable at the top of the file like padding for divider, I've also name it right instead of end as everything else is right but I agree with you right should be end and left should be start, but this thing should change globally, am I right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You are end :)
Yes, should change all in a batch replace, but can only do that for version 4, otherwise need to support the old variables as well which is annoying.

sijav added 3 commits April 24, 2017 02:40
Add a new variable and put 32px padding for the detail arrow
Add a new variable and put 32px padding for the detail arrow
@AmitMY

AmitMY commented Apr 23, 2017

Copy link
Copy Markdown
Contributor

@manucorporat Anything to add? this looks done

@manucorporat manucorporat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like a big change in the css, needs review from @brandyscarney

Comment thread src/components/item/item.ios.scss Outdated
$item-ios-detail-push-svg: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 20'><path d='M2,20l-2-2l8-8L0,2l2-2l10,10L2,20z' fill='#{$item-ios-detail-push-color}'/></svg>" !default;

/// @prop - Icon for the detail arrow RTL
$item-ios-detail-push-svg-rtl: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 20'><path d='M10,20l2-2l-8-8L8-8l-2-2l-10,10L10,10z' fill='#{$item-ios-detail-push-color}'/></svg>" !default;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wonder if we can use transform here?

@sijav sijav Apr 24, 2017 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes we can, but it will be hackish ... using svg is much cleaner, I'm making another commit with transform, let me know

Comment thread src/components/item/item.ios.scss Outdated

[dir="rtl"] .item-ios {
padding-left: 0;
padding-right: ($item-ios-padding-left);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove parentesis

sijav added 3 commits April 24, 2017 05:47
remove unnecessary parentesis
remove unnecessary parentesis
Use transform instead of independent svg for item-detail on RTL
@AmitMY

AmitMY commented Apr 24, 2017

Copy link
Copy Markdown
Contributor

Tiny note:
Merge this PR over those: #11247 and #11246 who are on the same subject, but less covering.

@sijav

sijav commented May 13, 2017

Copy link
Copy Markdown
Contributor Author

This PR is ready for another review

@AmitMY

AmitMY commented May 13, 2017

Copy link
Copy Markdown
Contributor

@sijav It feels like something was reverted here.. wasn't there a rotate instead duplicate arrows?

@sijav

sijav commented May 13, 2017

Copy link
Copy Markdown
Contributor Author

@AmitMY rotating is very hackish and does not look good, however I could manage to make it work with changing the border and shadow but still it doesn't look good. So I'm just reverse the icon's svg and it's working great, we can also use transform to rotate the icon itself, so let me know which one is preferred.
Also please check that I'm doing the include rtl right thanks.

@AmitMY

AmitMY commented May 13, 2017

Copy link
Copy Markdown
Contributor

@sijav You used it correctly. I just ran e2e.watch and it looks good!
About transforming/using 2 svgs.. @manucorporat what do you think?

@sijav

sijav commented May 28, 2017

Copy link
Copy Markdown
Contributor Author

Any updates?
Anything should I do here?

@AmitMY

AmitMY commented Jun 6, 2017

Copy link
Copy Markdown
Contributor

@sijav This was not merged because it was waiting on another PR.

Now that it is merged, what you need to do is, like you have rtl stuff under @include rtl(), have the ltr stuff under @include ltr() (the svg background image, and the background-position)

@sijav

sijav commented Jun 6, 2017 •

Copy link
Copy Markdown
Contributor Author

@AmitMY thanks, I'll do it tomorrow I don't have access to my laptop now, also can you please check the other PRs of mine and tell me if there's any changes I should make to them as well because of ltr mixin? Thanks again 😊

@AmitMY

AmitMY commented Jun 6, 2017

Copy link
Copy Markdown
Contributor

@sijav Most of your other PRs also use transform which is another mixin, so they can't be changed until that is merged (soon, very soon)

@sijav

sijav commented Jun 6, 2017

Copy link
Copy Markdown
Contributor Author

@AmitMY I meant these #11865 #11842 #11830 #11825

@AmitMY

AmitMY commented Jun 6, 2017

Copy link
Copy Markdown
Contributor

Actually, I decided to make the background and position mixins of their own, so this will be generalised
#11945 and #11946

If those will get rejected, this will be approved

@sijav

sijav commented Jun 7, 2017

Copy link
Copy Markdown
Contributor Author

@AmitMY nice, that's what I expected 👌
Thank you.

@brandyscarney

Copy link
Copy Markdown
Member

Thank you for the PR! Closing this as it was fixed by #11945. 😄

@sijav
sijav deleted the rtl-fix-item branch June 16, 2017 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants