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

CSS layout changed with jupyter 1.0 upgrade #25

Open
ablaagaard opened this issue Aug 19, 2019 · 4 comments
Open

CSS layout changed with jupyter 1.0 upgrade #25

ablaagaard opened this issue Aug 19, 2019 · 4 comments

Comments

@ablaagaard
Copy link

This commit

aab5071

added "display: flex" to the CSS, causing a change in layout when showing multiple elements.
Example:
sc = Sidecar(...)
with sc:
display(widgets.Label("A"))
display(widgets.Label("B"))

Used to show
A
B
Like it would in a normal output cell

Now it shows
A B

@SylvainCorlay
Copy link
Member

Thanks! I think we probably need to set the flex direction. The goal is to basically have the same CSS as in normal outputs.

@jasongrout
Copy link
Member

Something similar also happened over in jupyterlab/jupyterlab#6928 - not sure if it is related, but we ended up deleting a display: flex there as unnecessary.

@ablaagaard
Copy link
Author

I've tested by just disabling "display: flex" on the jupyterlab-sidecar style in Chrome, and in my tests the behavior goes back to how it used to be, and how it is in a normal output cell. But since I don't know why it was added, it is hard for me to conclude that this is the right fix.

@ablaagaard
Copy link
Author

As a temporary work-around for now I wrapped the sidecar output in an Output widget like this:

sc = Sidecar(...)
sc_out = ipywidgets.Output()
with sc:
display(sc_out)
with sc_out:
display(widgets.Label("A"))
display(widgets.Label("B"))

Doing this also made me think that it could have potential use-cases if Sidecar respected "layout" and "style" attributes like ipywidgets. Then my work-around might have been something like Sidecar(layout={'display': 'block'})

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

No branches or pull requests

3 participants