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

fix(item): RTL fix for item #11329

Closed
wants to merge 22 commits into from
Closed

fix(item): RTL fix for item #11329

wants to merge 22 commits into from

Conversation

sijav
Copy link
Contributor

@sijav sijav commented Apr 23, 2017

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
@@ -210,6 +238,14 @@ $item-ios-sliding-content-background: $list-ios-background-color !default;
background-position: right ($item-ios-padding-right - 2) center;
background-size: 14px 14px;
}
[dir="rtl"] .item-ios[detail-push] .item-inner,
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing line break

@@ -135,6 +148,14 @@ $item-md-sliding-content-background: $list-md-background-color !default;
background-position: right ($item-md-padding-right - 2) center;
background-size: 14px 14px;
}
[dir="rtl"] .item-md[detail-push] .item-inner,
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing line break

@@ -140,6 +148,14 @@ $item-wp-sliding-content-background: $list-wp-background-color !default;
background-position: right ($item-wp-padding-right - 2) center;
background-size: 14px 14px;
}
[dir="rtl"] .item-wp[detail-push] .item-inner,
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing line break

[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
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

Copy link
Contributor Author

@sijav sijav Apr 23, 2017

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
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'

Copy link
Contributor

@AmitMY AmitMY Apr 23, 2017

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
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
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
Copy link
Contributor

AmitMY commented Apr 23, 2017

@manucorporat Anything to add? this looks done

Copy link
Contributor

@manucorporat manucorporat left a comment

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

@@ -33,6 +33,12 @@ $item-ios-detail-push-color: $list-ios-border-color !default;
/// @prop - Icon for the detail arrow
$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
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?

Copy link
Contributor Author

@sijav sijav Apr 24, 2017

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

@@ -61,6 +67,11 @@ $item-ios-sliding-content-background: $list-ios-background-color !default;
transition: background-color 200ms linear;
}

[dir="rtl"] .item-ios {
padding-left: 0;
padding-right: ($item-ios-padding-left);
Copy link
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
Copy link
Contributor

AmitMY commented Apr 24, 2017

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

@sijav
Copy link
Contributor Author

sijav commented May 13, 2017

This PR is ready for another review

@AmitMY
Copy link
Contributor

AmitMY commented May 13, 2017

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

@sijav
Copy link
Contributor Author

sijav commented May 13, 2017

@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
Copy link
Contributor

AmitMY commented May 13, 2017

@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
Copy link
Contributor Author

sijav commented May 28, 2017

Any updates?
Anything should I do here?

@AmitMY
Copy link
Contributor

AmitMY commented Jun 6, 2017

@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
Copy link
Contributor Author

sijav commented Jun 6, 2017

@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
Copy link
Contributor

AmitMY commented Jun 6, 2017

@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
Copy link
Contributor Author

sijav commented Jun 6, 2017

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

@AmitMY
Copy link
Contributor

AmitMY commented Jun 6, 2017

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
Copy link
Contributor Author

sijav commented Jun 7, 2017

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

@brandyscarney
Copy link
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