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

TailwindCSS breaks Plotly modebar layout #5828

Open
wuyuanyi135 opened this issue Jul 16, 2021 · 5 comments
Open

TailwindCSS breaks Plotly modebar layout #5828

wuyuanyi135 opened this issue Jul 16, 2021 · 5 comments
Labels
bug something broken P3 backlog

Comments

@wuyuanyi135
Copy link

When using Plotly together with TailWindCSS I noticed that the mode bar's layout is not correct:
image
Here is the codepen for reproducing this error.

I could confirm this was caused by the following rule that override the display property of .main-svg.

img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    vertical-align: middle;
}

I could fix this by adding this to override the CSS normalization behavior.

svg {
    display: inherit;
}

I noticed that the display property was block anyway. I don't understand how this inconsistency is caused. Do you think this is a bug?

@tashburn
Copy link

tashburn commented Dec 21, 2021

I have this issue too, but svg{ display: inherit; } does not fix it for me.

@brendanmatkin
Copy link

This is a fix:

.js-plotly-plot .plotly .modebar svg {
	display: inline;
}

or in svelte (which I'm using):

:global(.js-plotly-plot .plotly .modebar svg) {
	display: inline;
}

this is due to tailwind using css remedy style reset. The discussion about changing svg to block is here.

@gvwilson
Copy link
Contributor

gvwilson commented Jul 5, 2024

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. Thanks for your help - @gvwilson

@gvwilson gvwilson closed this as completed Jul 5, 2024
@robertclaus
Copy link

I happened to run into this today and it's quite awkward. Since TailwindCSS is pretty popular, this is probably worth taking a look at.

TailwindCSS 3.4.3
Plotly 2.33.0
react-plotly.js 2.6.0

@robertclaus robertclaus reopened this Jul 19, 2024
@gvwilson gvwilson self-assigned this Jul 19, 2024
@gvwilson
Copy link
Contributor

thanks @robertclaus - I'll see if we can get this into one of the upcoming work cycles.

@gvwilson gvwilson removed their assignment Aug 2, 2024
@gvwilson gvwilson added bug something broken P3 backlog labels Aug 9, 2024
sverhoeven added a commit to i-VRESSE/haddock3 that referenced this issue Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

5 participants