-
Notifications
You must be signed in to change notification settings - Fork 945
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
Borders independently: border_top
, border_right
, border_bottom
, border_left
#2757
Conversation
Thanks for submitting this! I added a "backwards-incompatible" label because it isn't clear to me whether we can keep the I haven't had time to look into this properly (and I probably won't over the next few days), but I'd be keen to know the behaviour in the following cases:
... and whether that behaviour is consistent across browsers. If we're convinced we can keep both and this behaves sensibly, then we can lift that label. |
Good evening @pbugnion and thanks for your comments. |
For context, to recap our discussions from the dev meeting in Paris, we discussed several approaches:
We also discussed having a top-level border attribute in each of these cases, with the more specific ones above overriding the default. This global default could be applied in python (i.e., setting The nice thing about the attribute-based approach is that it easily extends to Conversely, the position-based approach makes it easy to change one side, but it is not easy to change one attribute (for example, to just put an outline around the whole control). Having a default I forget if we came to a single conclusion about what to do. I think I remember that @zerline was going to explore having a |
To elaborate on the trickiness in having a default general attribute shortcut, what we saw with overflow/overflow-x/overflow-y (translated into this situation) is that setting |
@jasongrout thank you very much for reminding us our discussions
It is already tricky to get the layout attribute
makes a text input with My PR does not address this currently existing bug. It only enables us to set border sides in the most natural way given the tricky environment.
I don't think we can (*) repair all the small issues (like having a rather unpredictable behavior when you have more than one view for your widget) in the short term. (*) If you look closely at the HTML code produced, you will see sometimes "border-left" etc.., sometimes "border-style" etc.. and until now I'm unable to say here it is produced. I suspect that happens in a Javascript dependency. |
This does not show a border because the border defaults to being 0px wide, so it is indeed red, but it is so small you can't see it. Doing something like |
No, precisely it doesn't! |
I've had a closer look. This bug appears only on my branch. Meaning that things are even more tricky that expected! |
My guess is that this is exactly the tricky case I mention above, that border does get set correctly (which really is just setting border-left, border-right, etc.), then border-left, border-right, etc., are set, but since they are None, they override the values. |
@jasongrout everything seems to work well now. Thanks! |
@jasongrout thanks for the recap. It helped bring the conversation back to mind. I think someone had taken a picture?
My understanding is that we decided to prioritise not restricting functionality that CSS provides (e.g. border-radius). Beyond that, we identified the following use cases, in descending order:
It seems to me that, if we want to avoid restricting CSS functionality, the only approach that works is the attribute-based approach, so if we think the prioritisation is right, that's probably what we should go for. Obviously, challenges to that prioritisation are welcome. |
I do remember that we came to the conclusion that an attribute-based approach was the way to go. And so I did at first. And my tests were unsuccessful. And I had a look at the underlying CSS files, especially I wrote on the related ticket why I thought that, finally, the side-based approach would be better, and why I thought keeping
I understand that we should not restrict CSS functionalities. So I hope we can have both a natural (and working) way to have one side borders, and the ability to have border-radius for example. I want to test this today. Here is a first screenshot, showing that we probably have to work on both
I think my PR, at least, addresses these priorities.
|
Another way to do it would be to have a
Is that too confusing? |
As discussed in the weekly, let's merge as soon as the property thing is in! |
I approved the PR with the latest changes on the boarder. @vidartf @jasongrout feel free to hit the merge button. |
🎉 |
Adding all 4 sides independently.
Keeping
border
.