"`), n);
+ }
+});
+
+test("template/theme.css: jede Variable steht auskommentiert in der Vorlage", () => {
+ for (const n of allNames) {
+ assert.match(template, new RegExp(`/\\*\\s*--theme-${n}\\s*:`), `--theme-${n} fehlt`);
+ }
+});
+
+test("template/theme.css: ohne Kommentarzeichen besteht die Vorlage checkTheme strict", () => {
+ const active = template.replace(/\/\*\s*(--theme-[^*]*?;)\s*\*\//g, "$1");
+ const vars = readThemeVars(active);
+ for (const n of allNames) assert.ok(n in vars, `--theme-${n} nicht aktiviert`);
+ for (const [n, v] of Object.entries(DEFAULTS)) assert.equal(vars[n], v);
+ const { failures, warnings } = checkTheme(vars, { strict: true });
+ assert.deepEqual(failures, []);
+ assert.deepEqual(warnings, []);
+});
+
+test("template/theme.css: keine @media, @layer oder externen URLs", () => {
+ const code = template.replace(/\/\*[\s\S]*?\*\//g, "");
+ assert.doesNotMatch(code, /@media|@layer|https?:/);
+});
+
+test("Version in README und Vorlage stimmt mit package.json überein", () => {
+ const { version, license } = JSON.parse(read("package.json"));
+ let n = 0;
+ for (const f of ["README.md", "template/theme.css"]) {
+ const text = read(f);
+ for (const m of text.matchAll(/embed-theme\/v(\d+\.\d+\.\d+)\b/g)) {
+ n++;
+ assert.equal(m[1], version, `${f}: ${m[0]}`);
+ }
+ for (const m of text.matchAll(/basicbar-embed-theme-(\d+\.\d+\.\d+)\.tgz/g)) {
+ n++;
+ assert.equal(m[1], version, `${f}: ${m[0]}`);
+ }
+ }
+ assert.ok(n >= 4, "keine Versionsangaben gefunden");
+ assert.equal(license, "Apache-2.0 AND OFL-1.1");
+});
+
+test("Vorlage: Betreiber werden gesiezt", () => {
+ assert.doesNotMatch(template, /Ihr Betreiber/);
+});
diff --git a/packages/embed-theme/test/fixtures/v4.config.js b/packages/embed-theme/test/fixtures/v4.config.js
new file mode 100644
index 0000000..1e998ce
--- /dev/null
+++ b/packages/embed-theme/test/fixtures/v4.config.js
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright 2026 Universität Osnabrück (virtUOS)
+
+import { themeColorsV4, themeBorderRadius, themeFontFamily } from "../../tailwind.js";
+
+export default {
+ theme: {
+ extend: {
+ colors: { theme: themeColorsV4 },
+ borderRadius: themeBorderRadius,
+ fontFamily: themeFontFamily,
+ },
+ },
+};
diff --git a/packages/embed-theme/test/fixtures/v4.css b/packages/embed-theme/test/fixtures/v4.css
new file mode 100644
index 0000000..151f27f
--- /dev/null
+++ b/packages/embed-theme/test/fixtures/v4.css
@@ -0,0 +1,5 @@
+/* SPDX-License-Identifier: Apache-2.0 */
+/* Copyright 2026 Universität Osnabrück (virtUOS) */
+@import "tailwindcss4/theme.css" layer(theme);
+@import "tailwindcss4/utilities.css" layer(utilities) source(none);
+@config "./v4.config.js";
diff --git a/packages/embed-theme/test/tailwind.test.mjs b/packages/embed-theme/test/tailwind.test.mjs
new file mode 100644
index 0000000..d4a9cce
--- /dev/null
+++ b/packages/embed-theme/test/tailwind.test.mjs
@@ -0,0 +1,68 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright 2026 Universität Osnabrück (virtUOS)
+
+import test from "node:test";
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+import { dirname, join } from "node:path";
+import { fileURLToPath } from "node:url";
+import postcss from "postcss";
+import tailwindcss3 from "tailwindcss3";
+import { compile } from "@tailwindcss/node";
+import {
+ themeColorsV3,
+ themeColorsV4,
+ themeBorderRadius,
+ themeFontFamily,
+} from "../tailwind.js";
+
+const here = dirname(fileURLToPath(import.meta.url));
+
+test("Tailwind 3: Farbe, Deckkraft-Modifikator, Radius, Schrift", async () => {
+ const result = await postcss([
+ tailwindcss3({
+ content: [
+ {
+ raw: '',
+ },
+ ],
+ theme: {
+ extend: {
+ colors: { theme: themeColorsV3 },
+ borderRadius: themeBorderRadius,
+ fontFamily: themeFontFamily,
+ },
+ },
+ }),
+ ]).process("@tailwind utilities;", { from: undefined });
+ const css = result.css;
+ assert.match(css, /var\(--theme-primary\)/);
+ assert.match(css, /calc\(0\.1 \* 100%\)/);
+ assert.match(css, /border-radius:\s*var\(--theme-radius\)/);
+ assert.match(css, /font-family:\s*var\(--theme-font\)/);
+});
+
+test("Tailwind 4: Farbe, color-mix-Modifikator, Radius", async () => {
+ const input = readFileSync(join(here, "fixtures/v4.css"), "utf8");
+ const compiler = await compile(input, {
+ base: join(here, "fixtures"),
+ onDependency: () => {},
+ });
+ const css = compiler.build(["bg-theme-primary/10", "rounded-theme"]);
+ assert.match(css, /var\(--theme-primary\)/);
+ assert.match(css, /color-mix\(/);
+ assert.match(css, /var\(--theme-radius\)/);
+});
+
+test("Farbwerte: gleiche Schlüssel in V3 und V4, inkl. primary-tint", () => {
+ assert.deepEqual(Object.keys(themeColorsV3), Object.keys(themeColorsV4));
+ assert.equal(themeColorsV4["primary-tint"], "var(--theme-primary-tint)");
+ assert.equal(themeColorsV4.primary, "var(--theme-primary)");
+ assert.equal(themeBorderRadius.theme, "var(--theme-radius)");
+ assert.deepEqual(themeFontFamily.theme, ["var(--theme-font)"]);
+});
+
+test("Farbwerte: hover-surface ist enthalten (V3 und V4)", () => {
+ assert.equal(themeColorsV4["hover-surface"], "var(--theme-hover-surface)");
+ assert.match(themeColorsV3["hover-surface"], /var\(--theme-hover-surface\)/);
+});
diff --git a/packages/embed-theme/theme.css b/packages/embed-theme/theme.css
new file mode 100644
index 0000000..e600396
--- /dev/null
+++ b/packages/embed-theme/theme.css
@@ -0,0 +1,51 @@
+/* SPDX-License-Identifier: Apache-2.0 */
+/* Copyright 2026 Universität Osnabrück (virtUOS) */
+
+/* @property-Registrierung: ein zur Berechnungszeit ungültiger Wert fällt auf
+ initial-value zurück. Muss außerhalb von @layer stehen. */
+@property --theme-primary { syntax: ""; inherits: true; initial-value: #ad1034; }
+@property --theme-primary-hover { syntax: ""; inherits: true; initial-value: #8a0d2a; }
+@property --theme-on-primary { syntax: ""; inherits: true; initial-value: #ffffff; }
+@property --theme-accent { syntax: ""; inherits: true; initial-value: #fbb800; }
+@property --theme-text { syntax: ""; inherits: true; initial-value: #3e3e3f; }
+@property --theme-muted { syntax: ""; inherits: true; initial-value: #5e5e5e; }
+@property --theme-surface { syntax: ""; inherits: true; initial-value: #f3f3f3; }
+@property --theme-border { syntax: ""; inherits: true; initial-value: #d0d0d0; }
+@property --theme-field-border { syntax: ""; inherits: true; initial-value: #767676; }
+@property --theme-danger { syntax: ""; inherits: true; initial-value: #c8102e; }
+@property --theme-radius { syntax: ""; inherits: true; initial-value: 0px; }
+@property --theme-font-weight { syntax: ""; inherits: true; initial-value: 300; }
+
+/* Uni-Voreinstellung, geschichtet: die ungeschichtete Theme-Datei des
+ Betreibers gewinnt unabhängig von der Ladereihenfolge. */
+@layer basicbar-theme {
+ :root {
+ --theme-primary: #ad1034;
+ --theme-primary-hover: #8a0d2a;
+ --theme-on-primary: #ffffff;
+ --theme-accent: #fbb800;
+ --theme-text: #3e3e3f;
+ --theme-muted: #5e5e5e;
+ --theme-surface: #f3f3f3;
+ --theme-border: #d0d0d0;
+ --theme-field-border: #767676;
+ --theme-danger: #c8102e;
+ --theme-radius: 0;
+ --theme-font: "Signika Variable", system-ui, sans-serif;
+ --theme-font-weight: 300;
+
+ /* Abgeleitet, nicht konfigurierbar. */
+ --theme-primary-tint: color-mix(in srgb, var(--theme-primary) 8%, #fff);
+ --theme-hover-surface: color-mix(in srgb, var(--theme-primary) 4%, #fff);
+ }
+}
+
+/* Signika, variabel, nur lateinische Teilmenge (Fontsource, OFL-1.1). */
+@font-face {
+ font-family: "Signika Variable";
+ font-style: normal;
+ font-display: swap;
+ font-weight: 300 700;
+ src: url("./fonts/signika-latin-wght-normal.woff2") format("woff2-variations");
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
+}
diff --git a/template/project/frontend/postcss.config.js b/template/project/frontend/postcss.config.js
index 2aa7205..1e381c3 100644
--- a/template/project/frontend/postcss.config.js
+++ b/template/project/frontend/postcss.config.js
@@ -1,3 +1,6 @@
+// SPDX-License-Identifier: Apache-2.0
+// Copyright 2026 Universität Osnabrück (virtUOS)
+
export default {
plugins: {
tailwindcss: {},