2.0.1 ⢠Published 6 months ago
@jill64/svelte-html v2.0.1
@jill64/svelte-html
đˇď¸ Declarative attribute binding for the root html element
Demo
Installation
npm i @jill64/svelte-htmlUsage
By passing a key-value set to the <SvelteHTML /> component, attributes are bind to the root html element.
<script>
import { SvelteHTML } from '@jill64/svelte-html'
</script>
<SvelteHTML lang="en" prefix="example" />â
<html lang="en" prefix="example">
<!-- ... -->
</html>SSR
Attribute binding with <SvelteHTML> is only applied on the client.
To assign arbitrary attributes during SSR, use the apply function in the handle hook.
// hooks.server.js
import { apply } from '@jill64/svelte-html'
export const handle = async ({ event, resolve }) => {
// ...
return resolve(event, {
transformPageChunk: apply({
lang: 'en',
prefix: 'example'
})
})
}License
2.0.1
6 months ago
2.0.0
11 months ago
1.1.19
1 year ago
1.1.18
1 year ago
1.1.17
1 year ago
2.0.0-next-.1
1 year ago
2.0.0-next-.2
1 year ago
1.1.20
1 year ago
1.1.16
2 years ago
1.1.15
2 years ago
1.1.14
2 years ago
1.1.13
2 years ago
1.1.12
2 years ago
1.1.11
2 years ago
1.1.10
2 years ago
1.1.9
2 years ago
1.1.8
2 years ago
1.1.7
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.0
2 years ago
0.3.0
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago
0.1.0
2 years ago
0.0.1
2 years ago