svelte-docsmith 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.d.ts CHANGED
@@ -31,6 +31,11 @@ export type DocsmithConfig = {
31
31
  copyright?: string;
32
32
  /** Titled columns of links. */
33
33
  columns?: DocsmithFooterColumn[];
34
+ /**
35
+ * Show the "Powered by Svelte DocSmith" attribution in the footer.
36
+ * Defaults to `true`; set `false` to hide it.
37
+ */
38
+ poweredBy?: boolean;
34
39
  };
35
40
  };
36
41
  /**
@@ -0,0 +1,81 @@
1
+ /*
2
+ * svelte-docsmith theme — Darkmatter (based on the tweakcn preset).
3
+ *
4
+ * A near-monochrome shell with a warm orange primary and a muted teal
5
+ * secondary; light mode is crisp white, dark mode is deep near-black.
6
+ *
7
+ * @import 'svelte-docsmith/theme.css';
8
+ * @import 'svelte-docsmith/themes/darkmatter.css';
9
+ */
10
+
11
+ :root {
12
+ --radius: 0.75rem;
13
+ --background: oklch(1 0 0);
14
+ --foreground: oklch(0.2101 0.0318 264.6645);
15
+ --card: oklch(1 0 0);
16
+ --card-foreground: oklch(0.2101 0.0318 264.6645);
17
+ --popover: oklch(1 0 0);
18
+ --popover-foreground: oklch(0.2101 0.0318 264.6645);
19
+ --primary: oklch(0.6716 0.1368 48.513);
20
+ --primary-foreground: oklch(1 0 0);
21
+ --secondary: oklch(0.536 0.0398 196.028);
22
+ --secondary-foreground: oklch(1 0 0);
23
+ --muted: oklch(0.967 0.0029 264.5419);
24
+ --muted-foreground: oklch(0.551 0.0234 264.3637);
25
+ --accent: oklch(0.9491 0 0);
26
+ --accent-foreground: oklch(0.2101 0.0318 264.6645);
27
+ --border: oklch(0.9276 0.0058 264.5313);
28
+ --input: oklch(0.9276 0.0058 264.5313);
29
+ --ring: oklch(0.6716 0.1368 48.513);
30
+ --destructive: oklch(0.6368 0.2078 25.3313);
31
+ --destructive-foreground: oklch(0.9851 0 0);
32
+ --chart-1: oklch(0.594 0.0443 196.0233);
33
+ --chart-2: oklch(0.7214 0.1337 49.9802);
34
+ --chart-3: oklch(0.8721 0.0864 68.5474);
35
+ --chart-4: oklch(0.6268 0 0);
36
+ --chart-5: oklch(0.683 0 0);
37
+ --sidebar: oklch(0.967 0.0029 264.5419);
38
+ --sidebar-foreground: oklch(0.2101 0.0318 264.6645);
39
+ --sidebar-primary: oklch(0.6716 0.1368 48.513);
40
+ --sidebar-primary-foreground: oklch(1 0 0);
41
+ --sidebar-accent: oklch(1 0 0);
42
+ --sidebar-accent-foreground: oklch(0.2101 0.0318 264.6645);
43
+ --sidebar-border: oklch(0.9276 0.0058 264.5313);
44
+ --sidebar-ring: oklch(0.6716 0.1368 48.513);
45
+ }
46
+
47
+ .dark {
48
+ --radius: 0.75rem;
49
+ --background: oklch(0.1797 0.0043 308.1928);
50
+ --foreground: oklch(0.8109 0 0);
51
+ --card: oklch(0.1822 0 0);
52
+ --card-foreground: oklch(0.8109 0 0);
53
+ --popover: oklch(0.1797 0.0043 308.1928);
54
+ --popover-foreground: oklch(0.8109 0 0);
55
+ --primary: oklch(0.7214 0.1337 49.9802);
56
+ --primary-foreground: oklch(0.1797 0.0043 308.1928);
57
+ --secondary: oklch(0.594 0.0443 196.0233);
58
+ --secondary-foreground: oklch(0.1797 0.0043 308.1928);
59
+ --muted: oklch(0.252 0 0);
60
+ --muted-foreground: oklch(0.6268 0 0);
61
+ --accent: oklch(0.3211 0 0);
62
+ --accent-foreground: oklch(0.8109 0 0);
63
+ --border: oklch(0.252 0 0);
64
+ --input: oklch(0.252 0 0);
65
+ --ring: oklch(0.7214 0.1337 49.9802);
66
+ --destructive: oklch(0.594 0.0443 196.0233);
67
+ --destructive-foreground: oklch(0.1797 0.0043 308.1928);
68
+ --chart-1: oklch(0.594 0.0443 196.0233);
69
+ --chart-2: oklch(0.7214 0.1337 49.9802);
70
+ --chart-3: oklch(0.8721 0.0864 68.5474);
71
+ --chart-4: oklch(0.6268 0 0);
72
+ --chart-5: oklch(0.683 0 0);
73
+ --sidebar: oklch(0.1822 0 0);
74
+ --sidebar-foreground: oklch(0.8109 0 0);
75
+ --sidebar-primary: oklch(0.7214 0.1337 49.9802);
76
+ --sidebar-primary-foreground: oklch(0.1797 0.0043 308.1928);
77
+ --sidebar-accent: oklch(0.3211 0 0);
78
+ --sidebar-accent-foreground: oklch(0.8109 0 0);
79
+ --sidebar-border: oklch(0.252 0 0);
80
+ --sidebar-ring: oklch(0.7214 0.1337 49.9802);
81
+ }
@@ -1,16 +1,20 @@
1
1
  <script lang="ts">
2
2
  import type { DocsmithConfig } from '../../config.js';
3
+ import BookOpenText from '@lucide/svelte/icons/book-open-text';
3
4
 
4
5
  const { config }: { config: DocsmithConfig } = $props();
5
6
  const footer = $derived(config.footer);
7
+ // Attribution is on by default; consumers opt out with `footer.poweredBy: false`.
8
+ const poweredBy = $derived(footer?.poweredBy ?? true);
9
+ const hasColumns = $derived(!!footer?.columns?.length);
6
10
  </script>
7
11
 
8
12
  {#if footer}
9
13
  <footer class="border-border/60 mt-16 border-t">
10
14
  <div class="mx-auto max-w-7xl px-4 py-10 md:px-6 lg:px-8">
11
- {#if footer.columns?.length}
12
- <div class="mb-8 grid gap-8 grid-cols-[repeat(auto-fit,minmax(10rem,1fr))]">
13
- {#each footer.columns as column (column.title)}
15
+ {#if hasColumns}
16
+ <div class="mb-10 grid grid-cols-[repeat(auto-fit,minmax(10rem,1fr))] gap-8">
17
+ {#each footer.columns! as column (column.title)}
14
18
  <div>
15
19
  <p class="mb-3 text-sm font-semibold">{column.title}</p>
16
20
  <ul class="space-y-2">
@@ -32,9 +36,31 @@
32
36
  </div>
33
37
  {/if}
34
38
 
35
- {#if footer.copyright}
36
- <p class="text-muted-foreground text-sm">{footer.copyright}</p>
37
- {/if}
39
+ <div
40
+ class="flex flex-col-reverse gap-4 sm:flex-row sm:items-center sm:justify-between {hasColumns
41
+ ? 'border-border/60 border-t pt-8'
42
+ : ''}"
43
+ >
44
+ {#if footer.copyright}
45
+ <p class="text-muted-foreground text-sm">{footer.copyright}</p>
46
+ {/if}
47
+
48
+ {#if poweredBy}
49
+ <a
50
+ href="https://github.com/geodask/svelte-docsmith"
51
+ target="_blank"
52
+ rel="noopener noreferrer"
53
+ class="group text-muted-foreground hover:text-foreground inline-flex items-center gap-2 self-start text-sm transition-colors sm:self-auto"
54
+ >
55
+ <span
56
+ class="bg-primary/10 text-primary group-hover:bg-primary/20 flex size-5 items-center justify-center rounded-md transition-colors"
57
+ >
58
+ <BookOpenText class="size-3" />
59
+ </span>
60
+ <span>Powered by <span class="text-foreground font-medium">Svelte DocSmith</span></span>
61
+ </a>
62
+ {/if}
63
+ </div>
38
64
  </div>
39
65
  </footer>
40
66
  {/if}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-docsmith",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "A framework for building beautiful documentation sites with Svelte.",
5
5
  "author": {
6
6
  "name": "George Daskalakis",