Conversation
|
Travis build failed because of a network issue or something apparently. |
|
@louy maybe try pushing an empty commit to re-start the Travis build? |
|
@shaurya947 I believe admins can restart a build manually. It would be much cleaner than an empty commit. |
|
@shaurya947 can I get any feedback on this? |
There was a problem hiding this comment.
I think that is should be this.state.muiTheme.isRtl
There was a problem hiding this comment.
Fixed. This was written before state.muiTheme was introduced. I've just seen that feature.
|
@oliviertassinari do you think adding another function to StylePropable that flips the direction automatically for all components might be a better approach? |
|
Well, If you want to add the support of RTL on a large set of component, yes I would use a different approach. |
|
Sorry @louy, I've been a little MIA on this issue. I don't think using the mixin is the best option. But I agree with @oliviertassinari that having something on the theme-level is a good approach. Take a look at |
|
For instance, when we contruct the theme we can compute a LTR variable that we add to the theme. if (isRtl) {
LTR = {
right: 'left',
left: 'right',
marginRight: 'marginLeft',
paddingLeft: 'paddingRight',
}
} else {
LTR = {
right: 'right',
left: 'left',
marginRight: 'marginRight',
paddingLeft: 'paddingLeft',
}
} |
|
👍 |
|
Hi, To see it in action, just uncomment the line in docs/src/components/master.jsx. A few things to be careful about:
|
|
WOW, I love it 👍 👍 ❤️ ❤️ |
|
I also wasn't able to add rtl support to all docs pages because they're written in es6 class style and I need to use mixins. That shouldn’t be a big issue. |
src/utils/styles.js
Outdated
There was a problem hiding this comment.
Performance hack!
I would rather say Left to right is the default.
What do you think?
There was a problem hiding this comment.
Left to right is the default doesn't imply that this line of code is there for optimization. Maybe:
Skip further processing to improve performance, since ltr is the default.
There was a problem hiding this comment.
My point is that this line isn't for optimisation. It's there because the default style is for LTR. Hence, we shouldn't invert the style properties if isRtl is false.
|
I like this approach. I'm wondering if this can work with flexbox. |
|
Awesome! It's working fine with |
|
@shaurya947 can we get this merged soon? |
There was a problem hiding this comment.
I feel like this shouldn't be part of the rawTheme, semantically speaking.
|
@louy see the comments above and let me know what you think. Also, there's a lot of changes here. Can you make sure that nothing breaks when Good job consolidating all this btw 👍 |
|
Hi @shaurya947, Just did some cleanup and the a quick look through the whole docs to make nothing is broken. Everything looks fine. Thanks :) |
|
I'll go ahead and merge this then, and we can tackle any issues that come along the way. Thanks @louy |
There was a problem hiding this comment.
muiTheme is not passed as parameter when used.
I had to revert this commit in this PR #1882.
There was a problem hiding this comment.
(for reference) This is not a bug.
See src/mixins/style-propable.js#L35-L37
There was a problem hiding this comment.
Oh sorry, I overlooked this.
|
@andreychev Can you submit a PR to fix this ? |
Closes #1661.