We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bindings for contentRect/contentBoxSize/borderBoxSize/devicePixelContentBoxSize were added in this pr: #8022
They were mentioned in the Changelog and June 2023 blog entry: Changelog, blog
But nothing about them was ever added to the docs.
The right place to describe then is probably around here: https://svelte.dev/docs/element-directives#block-level-element-bindings
Here's a REPL with the feature in action: Svelte 5 preview REPL
<script> let borderBoxSize; let contentBoxSize; $: borderBoxWidth = borderBoxSize ? borderBoxSize[0].inlineSize : -1; $: borderBoxHeight = borderBoxSize ? borderBoxSize[0].blockSize : -1; $: contentBoxWidth = contentBoxSize ? contentBoxSize[0].inlineSize : -1; $: contentBoxHeight = contentBoxSize ? contentBoxSize[0].blockSize : -1; </script> <div bind:borderBoxSize bind:contentBoxSize></div> <p>border box size = {borderBoxWidth} x {borderBoxHeight}</p> <p>content box size = {contentBoxWidth} x {contentBoxHeight}</p> <style> div { padding: 10px; width: 80px; height: 40px; background-color: steelblue; } </style>
Note: The contentBoxSize binding is currently broken in Svelte 4: #8583
contentBoxSize
No response
See repl.
annoyance
The text was updated successfully, but these errors were encountered:
Duplicate of
Sorry, something went wrong.
There it was. I did try to find it :)
No branches or pull requests
Describe the bug
Bindings for contentRect/contentBoxSize/borderBoxSize/devicePixelContentBoxSize were added in this pr: #8022
They were mentioned in the Changelog and June 2023 blog entry: Changelog, blog
But nothing about them was ever added to the docs.
The right place to describe then is probably around here: https://svelte.dev/docs/element-directives#block-level-element-bindings
Reproduction
Here's a REPL with the feature in action: Svelte 5 preview REPL
Note: The
contentBoxSize
binding is currently broken in Svelte 4: #8583Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: