The project includes :
A (very) little component to include the WebsiteCarbon badge in a Svelte / SvelteKit project.
More info on the badge here : https://www.websitecarbon.com/badge/
Add a reference in your package.json :
"svelte-websitecarbon-badge":"git+https://github.com/devbieres/swb-package.git",
Call install :
npm install
V1 aims to be a simple port of the badge while include the js script and load data.
<script lang="ts" >
import { WebCarbonBadgeV2 } from "svelte-websitecarbon-badge";
</script>
<WebCarbonBadge darkMode={true} />
V2 aims to re-implement the badge in svelte mode.
<script lang="ts" >
import { WebCarbonBadgeV2 } from "svelte-websitecarbon-badge";
let darkMode = false;
</script>
<!-- Basic version -->
<WebCarbonBadgeV2 {darkMode} />