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

Responsive issues with long module names #1010

Open
WarningImHack3r opened this issue Dec 13, 2024 · 0 comments
Open

Responsive issues with long module names #1010

WarningImHack3r opened this issue Dec 13, 2024 · 0 comments

Comments

@WarningImHack3r
Copy link

With the introduction of the svelte/reactivity/window package (sveltejs/svelte#14660), we can notice CSS issues in the docs with such large non-wrappable titles.

After digging a bit into the CSS, I initially tried to solve this by using the overflow-wrap: break-word property. However, it doesn't really look good and is too "abrupt".

I then stumbled upon a StackOverflow answer, which suggested using the HTML element I never heard of called <wbr> (word break). It really looks like the right solution.

<!-- apps/svelte.dev/src/routes/docs/[...path]/+page.svelte#L69 -->
<div id="docs-content" use:legacy_details>
	<header>
		<Breadcrumbs breadcrumbs={data.document.breadcrumbs.slice(1)} />
		<h1>{@html data.document.metadata.title.replace(/\//g, "/<wbr>")}</h1>
	</header>

However, it requires interpreting HTML, and using {@html inside the <h1> tag also leads to rendering component-titles like <svelte:window>, which is definitely not what we want!

As a result, I don't know what the best solution is here, which is why I opened an issue instead of a PR.

Initial CSS wbr
Initial state overflow-wrap <wbr> after slashes

What do you think?

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

1 participant