slidev-theme-tud 0.0.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.
Files changed (56) hide show
  1. package/.envrc +1 -0
  2. package/.github/workflows/deploy.yml +84 -0
  3. package/.github/workflows/release.yml +89 -0
  4. package/.vscode/extensions.json +3 -0
  5. package/README.md +60 -0
  6. package/assets/TUD-logo-bl.svg +1 -0
  7. package/assets/TUD-logo-no-color.svg +1 -0
  8. package/assets/TUD-logo-text-no-color.svg +1 -0
  9. package/assets/TUD-logo-text-small-no-color.svg +1 -0
  10. package/assets/TUD-logo-tr.svg +1 -0
  11. package/assets/favicons/apple-touch-icon.png +0 -0
  12. package/assets/favicons/dark/apple-touch-icon.png +0 -0
  13. package/assets/favicons/dark/favicon-16x16.png +0 -0
  14. package/assets/favicons/dark/favicon-32x32.png +0 -0
  15. package/assets/favicons/dark/favicon.ico +0 -0
  16. package/assets/favicons/favicon-16x16.png +0 -0
  17. package/assets/favicons/favicon-32x32.png +0 -0
  18. package/assets/favicons/favicon.ico +0 -0
  19. package/assets/fonts/FiraCode-VariableFont_wght.ttf +0 -0
  20. package/assets/fonts/NotoSans-Italic-VariableFont_wdth,wght.ttf +0 -0
  21. package/assets/fonts/NotoSans-VariableFont_wdth,wght.ttf +0 -0
  22. package/assets/fonts/OFL.txt +93 -0
  23. package/components/.gitkeep +0 -0
  24. package/components/Background.vue +130 -0
  25. package/components/Footnotes.vue +164 -0
  26. package/example.mdc +372 -0
  27. package/flake.lock +61 -0
  28. package/flake.nix +22 -0
  29. package/global-bottom.vue +79 -0
  30. package/global-top.vue +72 -0
  31. package/layouts/README.md +2 -0
  32. package/layouts/cols.vue +38 -0
  33. package/layouts/cover-blue.vue +60 -0
  34. package/layouts/cover-white.vue +58 -0
  35. package/layouts/cover.vue +10 -0
  36. package/layouts/default.vue +15 -0
  37. package/layouts/section-blue.vue +32 -0
  38. package/layouts/section-n.vue +171 -0
  39. package/layouts/section-white.vue +25 -0
  40. package/layouts/section.vue +10 -0
  41. package/markdown.ts +196 -0
  42. package/package.json +70 -0
  43. package/pnpm-workspace.yaml +23 -0
  44. package/scripts/background.ts +69 -0
  45. package/scripts/color.ts +81 -0
  46. package/scripts/util.ts +51 -0
  47. package/setup/katex.ts +35 -0
  48. package/setup/shiki.ts +48 -0
  49. package/shims.d.ts +27 -0
  50. package/styles/fade-transition.css +36 -0
  51. package/styles/font.css +28 -0
  52. package/styles/index.ts +5 -0
  53. package/styles/layout.css +184 -0
  54. package/tsconfig.json +30 -0
  55. package/uno.config.ts +35 -0
  56. package/vite.config.ts +29 -0
@@ -0,0 +1,184 @@
1
+ :root {
2
+ /* default theme color */
3
+ /* can be overrided by uses `themeConfig` option */
4
+ --slidev-theme-primary: var(--theme-primary);
5
+ /* font-family: NotoSans; */
6
+ }
7
+
8
+
9
+ .slidev-layout {
10
+ @apply p-0;
11
+ font-family: NotoSans, serif;
12
+ font-style: normal;
13
+ font-variation-settings: "wdth" 100;
14
+ height: 100%;
15
+ @apply text-gray;
16
+ /* ![alt text](img){.caption} -> image with its alt text as a numbered,
17
+ LaTeX-style caption underneath. Markup is emitted in vite.config.ts. */
18
+ .caption-figure {
19
+ /* `table` sizes the figure to the image's width; the table-caption then
20
+ wraps to that width instead of stretching the figure wider (the classic
21
+ LaTeX look). mx-auto centers the whole figure on the slide. */
22
+ @apply table mx-auto;
23
+ img {
24
+ @apply block mb-1;
25
+ }
26
+ }
27
+ .caption-text {
28
+ caption-side: bottom;
29
+ /* centered while it fits on one line, justified once it wraps */
30
+ text-align: justify;
31
+ /* text-align-last: center; */
32
+ @apply table-caption text-sm text-gray leading-snug;
33
+ }
34
+ /* The bold "Figure N:" / "Table N:" prefix. The number itself is computed
35
+ deck-wide at build time (see vite.config.ts), not via a CSS counter — CSS
36
+ counters can't span slides because off-screen slides are display:none. */
37
+ .caption-label {
38
+ @apply font-bold;
39
+ }
40
+
41
+ /* Table captions: a paragraph marked `{.caption}` right after a table becomes
42
+ its caption; add `{.numbered}` for a "Table N:" prefix. vite.config.ts wraps
43
+ the table + caption in this `display: table` box — same trick as
44
+ .caption-figure — so the caption wraps to the table's width rather than
45
+ stretching it, and the whole thing stays centered. The caption itself reuses
46
+ the figure `.caption-text` look. */
47
+ .caption-table {
48
+ @apply table mx-auto mb-6;
49
+ table {
50
+ /* the table is the box's content now; drop its own outer spacing */
51
+ @apply mb-1 mx-0;
52
+ }
53
+ }
54
+
55
+ h1 {
56
+ @apply font-bold text-4xl mt-0 mb-8 text-primary;
57
+ }
58
+ h2 {
59
+ @apply font-bold text-2xl mt-0 mb-6 text-primary;
60
+ }
61
+ p {
62
+ @apply text-xl mt-0 mb-4 text-gray;
63
+ }
64
+ img {
65
+ @apply z-10;
66
+ }
67
+
68
+
69
+ /* &.cover .content,
70
+ &.cover-white .content,
71
+ &.section .content,
72
+ &.section-blue .content {
73
+ h1 {
74
+ @apply absolute bottom-[390px] m-0;
75
+ }
76
+ h2 {
77
+ @apply absolute top-[366.645px];
78
+ }
79
+ p {
80
+ @apply absolute top-[462.723px] m-0;
81
+ }
82
+ } */
83
+ /* &.cover .content, */
84
+
85
+ pre {
86
+ @apply mb-4;
87
+ }
88
+
89
+ ul {
90
+ @apply mb-4;
91
+ }
92
+
93
+ ol {
94
+ @apply mb-4;
95
+ }
96
+
97
+ li::marker {
98
+ @apply text-primary;
99
+ }
100
+
101
+ /* Tables follow the same corporate idiom as blockquotes: square corners,
102
+ a solid-blue header bar with white text, and the light-blue tint for
103
+ zebra striping. */
104
+ table {
105
+ border-collapse: collapse;
106
+ /* override Slidev's base `table { w-full }` so tables shrink to content */
107
+ width: fit-content;
108
+ @apply text-xl mb-6 mx-auto;
109
+ th {
110
+ @apply bg-primary text-white;
111
+ @apply font-bold px-3 py-2 text-left;
112
+ }
113
+ td {
114
+ border-bottom: 1px solid #d8d8d8;
115
+ @apply px-3 py-2 text-gray;
116
+ }
117
+ tbody tr:nth-child(even) {
118
+ /* @apply bg-[color-mix(in_srgb,var(--slidev-theme-primary)_5%,white)]; */
119
+ }
120
+ tbody tr {
121
+ @apply bg-[color-mix(in_srgb,var(--slidev-theme-primary)_5%,white)]
122
+ }
123
+ tbody tr:last-child td {
124
+ @apply border-b-2 border-b-primary;
125
+ }
126
+ }
127
+
128
+ blockquote:has(> h1) {
129
+ border-left: none;
130
+ }
131
+ blockquote {
132
+ border-radius: 0;
133
+ /* border-left: 4px solid #4c8ac6; */
134
+ /* background-color: #EFF5FA; */
135
+ /* display: inline-block; */
136
+ @apply px-2 py-[0.1px] mb-6 border-l-[4px] border-l-primary bg-[color-mix(in_srgb,var(--slidev-theme-primary)_5%,white)];
137
+ h1 {
138
+ @apply text-2xl text-white bg-primary -m-2 mb-2 px-2 py-2;
139
+ code {
140
+ @apply bg-white/10;
141
+ }
142
+ }
143
+ p {
144
+ @apply p-0 my-2;
145
+ }
146
+ /* .katex-display {
147
+ @apply m-0;
148
+ }
149
+ p:has(> .katex-display) {
150
+ @apply pb-4;
151
+ } */
152
+ }
153
+ :not(pre) > code {
154
+ @apply bg-gray/10;
155
+ }
156
+ }
157
+
158
+ ::view-transition-old(root),
159
+ ::view-transition-new(root) {
160
+ animation-delay: 0ms;
161
+ animation-duration: 700ms;
162
+ }
163
+ /* control the whole transition container */
164
+ ::view-transition-group(*) {
165
+ animation-duration: 1000ms;
166
+ animation-timing-function: cubic-bezier(.4,0,.2,1);
167
+ }
168
+
169
+ /* outgoing element disappears faster */
170
+ ::view-transition-old(*) {
171
+ animation-duration: 400ms;
172
+ }
173
+
174
+ /* incoming element fades slightly later */
175
+ ::view-transition-new(*) {
176
+ animation-duration: 700ms;
177
+ animation-delay: 150ms;
178
+ }
179
+
180
+ ::view-transition-old(.simple),
181
+ ::view-transition-new(.simple) {
182
+ animation-duration: 1000ms;
183
+ animation-delay: 0ms;
184
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ESNext",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "jsx": "preserve",
7
+ "lib": ["ESNext", "DOM", "DOM.Iterable"],
8
+ "types": ["vite/client", "@slidev/types"],
9
+ "resolveJsonModule": true,
10
+ "esModuleInterop": true,
11
+ "allowImportingTsExtensions": true,
12
+ "skipLibCheck": true,
13
+ "noEmit": true,
14
+ "strict": false, // Non-strict on purpose
15
+ "noImplicitAny": false
16
+ },
17
+ "vueCompilerOptions": {
18
+ "target": 3.5
19
+ },
20
+ "include": [
21
+ "*.ts",
22
+ "*.vue",
23
+ "shims.d.ts",
24
+ "layouts/**/*.vue",
25
+ "components/**/*.vue",
26
+ "setup/**/*",
27
+ "scripts/**/*"
28
+ ],
29
+ "exclude": ["node_modules", "dist", ".direnv", "resources"]
30
+ }
package/uno.config.ts ADDED
@@ -0,0 +1,35 @@
1
+ import { defineConfig } from 'unocss'
2
+ import { colors, paletteNames } from './scripts/color'
3
+
4
+ // Expose the same palette as CSS custom properties on :root.
5
+ // e.g. --theme-primary --theme-blue --theme-blue-1 ...
6
+ const paletteVars = Object.entries(colors).flatMap(([name, value]) =>
7
+ typeof value === 'string'
8
+ ? [`--theme-${name}: ${value};`]
9
+ : Object.entries(value).map(([shade, hex]) =>
10
+ `--theme-${name}${shade === 'DEFAULT' ? '' : `-${shade}`}: ${hex};`)
11
+ )
12
+
13
+ // A class per color (to change the color of components)
14
+ // e.g. .red { --slidev-theme-primary: var(--theme-red) }
15
+ const primaryClasses = paletteNames.map((name) =>
16
+ `.${name} {\n --slidev-theme-primary: var(--theme-${name});\n}`
17
+ )
18
+
19
+ export default defineConfig({
20
+ theme: { colors },
21
+ preflights: [
22
+ { getCSS: () => `:root {\n ${paletteVars.join('\n ')}\n}` },
23
+ { getCSS: () => primaryClasses.join('\n') },
24
+ ],
25
+ rules: [
26
+ [/^vt-([\w-]+)$/, ([, name]) => ({ "view-transition-name": name })],
27
+ // this variant does only a simple cross-fade without and opacity shenanigans
28
+ [/^vtcf-([\w-]+)$/, ([, name]) => ({ "view-transition-name": name, "view-transition-class": "simple" })],
29
+ ]
30
+ // shortcuts: {
31
+ // // custom the default background
32
+ // 'bg-main': 'bg-white text-[#181818] dark:(bg-[#121212] text-[#ddd])',
33
+ // },
34
+ // ...
35
+ })
package/vite.config.ts ADDED
@@ -0,0 +1,29 @@
1
+ import { resolve } from 'node:path'
2
+ import { defineConfig } from 'vite'
3
+ import { setupFootnotes, setupFigureCaptions, setupTableCaptions } from './markdown'
4
+
5
+ export default defineConfig({
6
+ slidev: {
7
+ vue: {
8
+ /* vue options */
9
+ },
10
+ markdown: {
11
+ // Theme markdown customizations (footnotes, figure/table captions,
12
+ // deck-wide numbering) — see markdown.ts.
13
+ markdownSetup: (md) => {
14
+ setupFootnotes(md)
15
+ setupFigureCaptions(md)
16
+ setupTableCaptions(md)
17
+ },
18
+ },
19
+ },
20
+
21
+ server: {
22
+ watch: {
23
+ ignored: [
24
+ '**/.direnv/**', '**/.vscode/**',
25
+ resolve(import.meta.dirname, 'resources/**'),
26
+ ],
27
+ },
28
+ },
29
+ })