A simple GitHub repo card component based on Tarptaeya/repo-card.
npm i -D svelte-repo-card
<script>
import RepoCard from "svelte-repo-card";
</script>
<RepoCard slug="<user>/<repo>" />
It's that simple!
If you want to control the appearance of the card you have three options:
"light"
or "dark"
to the theme
attribute to use the built-in light and dark themes.<RepoCard slug="<user>/<repo>" theme="light" />
<RepoCard slug="<user>/<repo>" theme="dark" />
<script lang="ts">
// {...}
import type { Theme } from "svelte-repo-card";
const theme: Theme = {
// The color of the text.
text: "#586069",
// The color of the links.
link: "#0366d6",
// The background color.
background: "#ffffff",
// The border color.
border: "#e1e4e8",
};
</script>
<RepoCard slug="<user>/<repo>" {theme} />
--svc-*
css variables::root {
--svc-text-primary: #586069;
--svc-text-link: #0366d6;
--svc-background: #ffffff;
--svc-border-color: #e1e4e8;
}
<RepoCard slug="thislooksfun/svelte-repo-card" />
: <RepoCard slug="thislooksfun/SwiftlySearch" />
: