Skip to content

Conversation

christophsanz
Copy link
Contributor

A note on documentation PRs

If this is a documentation PR (i.e. changing content within apps/svelte.dev/content/docs), then this is the wrong repository to make those changes. The content in this folder is synced from other repositories. Therefore, these changes should be made in their respective repositories (at https://github.com/sveltejs/svelte or https://github.com/sveltejs/kit, or example).

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time.
  • Prefix your PR title with feat:, fix:, chore:, or docs:.
  • This message body should clearly illustrate what problems it solves.

Copy link

vercel bot commented Oct 25, 2024

@christophsanz is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

@christophsanz christophsanz changed the title dos: Add note for dimension bindings. docs: Add note for dimension bindings. Oct 25, 2024
@Rich-Harris
Copy link
Member

Can I ask what prompted this? It's no longer true — we use ResizeObserver

@christophsanz
Copy link
Contributor Author

Hey!

We tried to use it on display inline and it did not work.

Changing to block, flex or grid - everything works again.

Or at least it does not work when changing the size by adding content to an inline element, or changing the style, not sure about other means of changing size.

While debugging i stumpled upon this note in the the old docs and figured that the new docs will need it as well.

So my guess is the resizeObserver has the same limitations with display inline elements as the oled approach?

@Rich-Harris
Copy link
Member

Huh! I could have sworn it worked on inline elements too — very surprising that it doesn't.

Interestingly, the <canvas> works fine, so it's about the element+styles rather than just styles. Not sure how best to encapsulate that

@christophsanz
Copy link
Contributor Author

Not sure either, but some kind of small note would be nice until (or if) this can be done.

@Rich-Harris
Copy link
Member

Okay so the <canvas> thing was a red herring, it's because it (and other elements like <img>) has intrinsic dimensions. All other display: inline elements are subject to this. Updated the note. Thanks!

@Rich-Harris Rich-Harris merged commit 223ed4f into sveltejs:main Oct 30, 2024
2 of 4 checks passed
@christophsanz
Copy link
Contributor Author

@Rich-Harris Maybe you can add this note also to the general Docs here:
https://svelte.dev/tutorial/svelte/dimensions

Thank you!

@christophsanz christophsanz deleted the patch-2 branch November 3, 2024 16:58
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