Skip to content

<pre> is not responsive #96

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

Closed
milindvishnoi opened this issue Nov 21, 2020 · 10 comments
Closed

<pre> is not responsive #96

milindvishnoi opened this issue Nov 21, 2020 · 10 comments

Comments

@milindvishnoi
Copy link

<pre> is not mobile responsive.

image

@jacobdalamb
Copy link

umm repo?

@milindvishnoi
Copy link
Author

@benji014628 Please check out this PR

@jasikpark
Copy link

A reasonable default for pre's would be overflow-x-auto, no?

@milindvishnoi
Copy link
Author

@jasikpark, that works thanks!

@jasikpark
Copy link

How did you fix your problem? Isn't this something that should be added to tailwind-typography?

@milindvishnoi
Copy link
Author

So for me, my project is using prism for something (idk why tho), which overrides the tailwind typography classes.

Therefore, I think tailwind typography is okay.

@jasikpark
Copy link

Ah, I see!

@vhscom
Copy link

vhscom commented Jan 20, 2022

There's a horizontal overflow issue when a pre exists within prose content in typography 0.5.0 when used with tailwind 3.0.15. It looks just as OP describes. And it has nothing to do with Prism.

The issue occurs when the user attempts to center prose content by wrapping in inside a grid or flex container. To avoid this issue users can center-align prose content by not using flex or grid and instead using prose mx-auto. To reproduce the issue the pre must have at least one line of content that is long enough to trigger horizontal overflow on a mobile viewport.

@marcuspoehls
Copy link

In my case, I used a grid sm:grid-cols-1 layout. This sm: breakpoint caused the overflow issue for me. I had to use grid grid-cols-1 instead and things are working fine.

@jeffoxd
Copy link

jeffoxd commented Apr 7, 2025

still an issue to this date, is there any chance of this changing? imo i found the best way to do it is to do mx-auto

alfredlua added a commit to silanthro/stores-client that referenced this issue Apr 7, 2025
<pre> is not responsive and I had to use this hacky way: tailwindlabs/tailwindcss-typography#96
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

6 participants