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

fix : title does not break #187

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

syui
Copy link

@syui syui commented Oct 29, 2024

This temporarily avoids the issue of h2 not wrapping.

It seems that this cannot be avoided using break-words etc.

[google transalte]

<h2 class="break-all whitespace-pre-wrap">
 0123456789012345678901234567890123456789012345678901234567890123456789
</h2>

スクリーンショット 2024-10-30 4 53 31

@will-corrigan
Copy link

will-corrigan commented Oct 30, 2024

Hey, thanks for taking a look into this. I've done a bit of research and found this helpful article and this github issue about the problem with Tailwind classes and I think if we implement the utility classes mentioned it should work:

supports-[overflow-wrap:anywhere]:[overflow-wrap:anywhere]
supports-[not(overflow-wrap:anywhere)]:[word-break:normal]

or we can just use [overflow-wrap:anywhere] in the <a> tag className.

@syui
Copy link
Author

syui commented Oct 31, 2024

thx, It seems so.

The following solution is also possible, but is more complicated:

// https://github.com/tailwindlabs/tailwindcss/pull/12128#issuecomment-2225349386
import plugin from 'tailwindcss/plugin.js';

plugins: [
  plugin(({addUtilities}) => {
    addUtilities({
      '.break-anywhere': {
        'overflow-wrap': 'anywhere',
      },
    });
  }),
],

@will-corrigan
Copy link

thx, It seems so.

The following solution is also possible, but is more complicated:

// https://github.com/tailwindlabs/tailwindcss/pull/12128#issuecomment-2225349386
import plugin from 'tailwindcss/plugin.js';

plugins: [
  plugin(({addUtilities}) => {
    addUtilities({
      '.break-anywhere': {
        'overflow-wrap': 'anywhere',
      },
    });
  }),
],

think for now we should probably just add [overflow-wrap:anywhere] in the <a> tag with a todo or comment with a link to the github issue/discussion and wait for tailwind to implement it

@syui
Copy link
Author

syui commented Oct 31, 2024

Yes. If you notice that the tailwindcss PR has been merged, please close this PR.
If I notice anything, I'll update the PR.
[google translate]

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

Successfully merging this pull request may close these issues.

2 participants