Skip to content

CameronBrooks11/monospace-web-theme

Repository files navigation

npm version License: MIT

monospace-web-theme

A pure CSS + JavaScript theme that enforces a character-aligned grid, monospace typography, and responsive design.

Live demo: CameronBrooks11.github.io/monospace-web-theme


Usage

Raw HTML

<head>
  <!-- …other tags… -->
  <link
    rel="stylesheet"
    href="https://cdn.jsdelivr.net/npm/monospace-web-theme@1.0.0/dist/monospace.min.css"
  />
</head>
<body>
  <!-- your content… -->
  <script src="https://cdn.jsdelivr.net/npm/monospace-web-theme@1.0.0/dist/monospace.min.js"></script>
</body>

npm / Bundler

npm install monospace-web-theme

In your JavaScript entrypoint (e.g. index.js):

import "monospace-web-theme/dist/monospace.min.css";
import "monospace-web-theme/dist/monospace.min.js";

🌈 Theme Flavours

The default style is high-contrast black-on-white (and inverted in dark mode). To try some different colour styles, set a data-theme attribute on <html>:

<html data-theme="twilight"></html>

🎨 Available Colour Flavours

  • rose: Romantic pinks
  • ocean: Cool aquas
  • forest: Soft greens
  • desert: Warm sands
  • sepia: Editorial browns
  • twilight: Dusky purples
  • glacier: Icy blues
  • clay: Muted earth
  • midnight: Dark-mode primary
  • sandstone: Soft red earth
  • coral: Vibrant corals
  • mint: Fresh mints
  • mauve: Soft purples
  • slate: Cool grays
  • honey: Golden yellows
  • rust: Burnt oranges
  • dracula: Classic dark theme
  • solarized: Solarized light/dark
  • monokai: Monokai code theme
  • gruvbox: Warm coder palette
  • nord: Arctic Nord theme
  • one-dark: Atom One Dark
  • palenight: Palenight pastel
  • terminal: Retro green on black

All themes support prefers-color-scheme: dark automatically.

Demo

A standalone demo page is included under demo/demo.html. To preview locally:

  1. Clone this repo and install dependencies:
git clone https://github.com/CameronBrooks11/monospace-web-theme.git
cd monospace-web-theme
npm install
npm run build
  1. Serve from the project root so that ../dist/… paths resolve:
live-server --open=demo/demo.html
  1. Open http://127.0.0.1:8080/demo/demo.html in your browser.

Advanced Pandoc-driven Example

If you’re looking for a more turnkey Markdown → HTML workflow (Pandoc + GitHub Actions), check out the-monospace-web. It uses this theme as an npm dependency and publishes a fully responsive, character-aligned site from your .md files.

Build & Publish

  1. Install dependencies
npm install
  1. Build the CSS/JS
npm run build
  • dist/monospace.css – concatenated (unminified) CSS
  • dist/monospace.min.css – minified CSS (cssnano, calc disabled)
  • dist/monospace.js – compiled ES5 JS
  • dist/monospace.min.js – minified JS (terser)
  1. Verify package contents
npm pack --dry-run

Ensure only dist/*, README.md, LICENSE, and package.json appear.

  1. Publish to npm

Bump the version in package.json, create a Git tag (e.g. git tag v0.0.1), then:

git push --tags
npm publish

Contributing

  1. Fork this repository and clone your fork.
  2. Create a new branch for your change.
  3. Modify src/reset.css, src/theme.css, or src/script.js as needed.
  4. Rebuild locally and confirm the demo.
  5. Commit your changes, push to your branch, and open a pull request.

License

This project is released under the MIT License.

Repository & Issues

About

A pure CSS + JavaScript theme that enforces a character-aligned grid, monospace typography, and responsive design.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published