Skip to main content

Setup

Files

The package's dist folder holds:

  • css/tokens.css: colors, type, spacing, and sizes
  • css/base.css: reset, element defaults, and helper classes
  • css/components.css: element components
  • css/header-footer.css: the header, sidebar layout, and footer
  • js/ui.js: component behavior; see the script reference
  • img/wikiportraits-logo.svg: WikiPortraits logo

Classes start with wp- and custom properties with --wp-.

Install

npm install --save-exact @wikiportraits/halide

To install without npm: clone the repository, run node build.js, and copy the contents of dist into your site's public halide folder.

Serving

In an Express app:

const express = require('express');
const path = require('node:path');
const app = express();

app.use('/halide', express.static(path.join(__dirname, 'node_modules/@wikiportraits/halide/dist')));
app.listen(3000);

In a Node.js build script:

import { cp } from 'node:fs/promises';

await cp('node_modules/@wikiportraits/halide/dist', 'dist/halide', { recursive: true });