Reusable Vite theme:
- shared CSS tokens and layout
- the homepage header and hero treatment
- the hero image asset
lugano-planb-vite-theme/theme.css: the reusable theme stylesheetlugano-planb-vite-theme: DOM helpers to mount the Plan B header
The exports point to source files on purpose. In Vite projects this is seamless: Vite resolves the package exports, processes the CSS import, and rewrites the hero asset URL automatically.
npm install
npm run devOpen the local Vite server to see the demo page.
npm testInstall from github:
npm install https://github.com/LuganoPlanB/vite-theme.gitor from a local sibling checkout:
npm install ../lugano-planb-vite-themeIn the target app entrypoint:
import "lugano-planb-vite-theme/theme.css";
import { mountPlanBHeader } from "lugano-planb-vite-theme";
mountPlanBHeader({
target: document.querySelector("#app"),
headerContent: {
eyebrow: "Lugano LIPS",
title: "Lugano Improvement Proposals",
lede: "Open proposals for the Lugano ecosystem.",
},
});Then render the rest of the page as usual below the header.
Minimal src/main.js shape:
import "lugano-planb-vite-theme/theme.css";
import { mountPlanBHeader } from "lugano-planb-vite-theme";
const app = document.querySelector("#app");
mountPlanBHeader({
target: app,
headerContent: {
eyebrow: "Lugano LIPS",
title: "Lugano Improvement Proposals",
lede: "Community-authored proposals with the Plan B visual shell.",
},
});
const content = document.createElement("main");
content.className = "planb-container planb-main";
content.innerHTML = `
<section class="planb-panel">
<h2>Latest proposals</h2>
<p>Render your repository content here.</p>
</section>
`;
app.append(content);If the host app needs different spacing or colors, override the CSS custom properties after importing the theme:
:root {
--planb-color-canvas: #121212;
--planb-color-panel: #1f1f1f;
}src/theme/domain.js: theme defaults and normalization rulessrc/theme/index.js: public DOM API for host appssrc/theme/theme.css: reusable style layersrc/main.js: demo page entrytest/theme.test.mjs: lightweight API tests