0.0.2 • Published 11 months ago

svelte-attr v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

svelte-attr

svelte-attr is a library that dynamically changes the attributes of html and body tags with SvelteKit's SSR.

Install

npm install svelte-attr

Usage

// src/hooks.server.ts

import type { Handle } from '@sveltejs/kit';
import { svelteAttr } from 'svelte-attr';

export const handle: Handle = async ({ event, resolve }) => {
    return svelteAttr(resolve(event));
};
<script lang="ts">
    import { HtmlAttr, BodyAttr } from 'svelte-attr';
</script>

<HtmlAttr lang="en" />
<BodyAttr data-theme="dark" />
0.0.2

11 months ago

0.0.1

11 months ago