1.1.20 ⢠Published 11 months ago
@jill64/svelte-html v1.1.20
@jill64/svelte-html
đˇď¸ Declarative attribute binding for the root html element
Demo
Installation
npm i @jill64/svelte-html
Usage
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
1.1.19
1 year ago
1.1.18
1 year ago
1.1.17
1 year ago
2.0.0-next-.1
12 months ago
2.0.0-next-.2
12 months ago
1.1.20
11 months ago
1.1.16
1 year ago
1.1.15
1 year ago
1.1.14
1 year ago
1.1.13
1 year ago
1.1.12
1 year ago
1.1.11
1 year ago
1.1.10
1 year ago
1.1.9
1 year ago
1.1.8
1 year ago
1.1.7
1 year ago
1.1.6
1 year ago
1.1.5
1 year ago
1.1.4
1 year ago
1.1.3
1 year 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