-
Notifications
You must be signed in to change notification settings - Fork 79
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
add support for directional border shorthands #95
Conversation
Thanks for the PR! I held off this because of the lack of support for setting the border style of just one side. I'd worry with this we'd get bug reports of people saying it set the border style of all sides |
I get that. We get bug reports for the other side too though in that people
are confused the shorthand only works for border.
…On Sat, Oct 13, 2018 at 1:11 PM Jacob Parker ***@***.***> wrote:
Thanks for the PR!
I held off this because of the lack of support for setting the border
style of just one side. I'd worry with this we'd get bug reports of people
saying it set the border style of all sides
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAiy1mnSFiVXjZ2nEaTiATEqwKvFWxq8ks5ukizBgaJpZM4XasSp>
.
|
We could definitely give a better error message when they try to use it |
My gut feeling is that we don't add it, or just don't allow setting the border style (and warn if they do). But if everybody else is happy with this as-is, I'm happy for it to be merged. @kristerkari what do you think? |
Hmm.. this is tricky one because I guess that the idea is to only support properties that we can make work the same way than in CSS. If I understood correctly supporting this would give a different result if you use the React Native CSS in the browser? If that's the case then I vote against merging it. |
I think that this is something that we could do instead. |
Although if your argument was it should match web 100%, omitting the border style is a syntax error, so wouldn’t match web |
Oh yeah I did not think about that. In that case my opinion is that let's not support it if it's not compatible with Web. RN might anyway add support in the future for setting border style for different sides. |
Would love to have this, having to manually user |
I agree that it is painful not being able to use the shorthands, but it is still a much better option than causing unexpected results and not rendering the same way is it does in browsers. Currently you should be able to use the same CSS in React Native and the browser to render the same way. I hope that in the future React Native would support setting |
So I looked at this in a bit more detail We could never allow But we could allow I also noticed we allow (And lastly, I the border shorthand did not output directional properties like margin and padding do) So I opened up two PRs
I feel like the first option is the more pure version, but it is breaking change. It's also consistent with what we do in other places. If you use a unitless line-height in a font shorthand, you define multiple box-shadows, and percentage widths on border widths What do other people think? |
My opinion is the same as before: to keep Web compatibility. If we make exceptions to that, then we break the universal (Web/RN) rendering of styles. I think that with being a bit strict about the styles we can provide a much better experience for all users. |
No description provided.