Skip to content

About

A supersimple, monospaced, modular, flat stylesheet made in SASS for simple pages

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

monospaced.css

License: GPL v3 jsDelivr

A super simple, monospaced, flat stylesheet for simple pages. Write plain HTML, drop in one file, done.

Live demo →

  • ~4.5 KB minified, no JavaScript
  • Monospaced typography (IBM Plex Mono) with Markdown-like # headings
  • Automatic dark mode via prefers-color-scheme
  • Themeable at runtime with CSS custom properties, or at build time with Sass variables
  • Accessible focus styles and readable contrast

Install

CDN

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/andrearufo/monospaced.css@1.0.0/dist/monospaced.min.css">

Download

Grab dist/monospaced.min.css (or the unminified dist/monospaced.css) and link it in your page.

Sass

Copy the scss/ folder into your project and import it, optionally overriding the defaults:

@use 'monospaced' with (
  $link-color: #c0392b,
  $breakpoint: 960px,
  $enable-dark-mode: false
);

Usage

Most elements are styled out of the box. Wrap your content in a .container:

<main class="container">
  <h1>Hello</h1>
  <p>Just write HTML.</p>
</main>

Classes

Class Description
.container Centered page wrapper (max width = breakpoint)
.block Bottom margin, useful to group form fields
.card Bordered box
.alert Highlighted message
.btn Button look for links (<button> gets it automatically)
.text-{left,center,right} Text alignment
.text-{left,center,right}-small Text alignment below the breakpoint
.text-{left,center,right}-large Text alignment from the breakpoint up
.transition transition: all .3s

Theming

Override the custom properties anywhere after the stylesheet:

:root {
  --mono-bg: #fdfdf8;
  --mono-color: #333;
  --mono-light: #eee;      /* code, cards, rules */
  --mono-border: #999;     /* form fields, blockquotes */
  --mono-link: #c0392b;
  --mono-link-hover: #962d22;
  --mono-alert: #ffeaa7;
}

Development

Requires Node.js.

npm install
npm run build   # compiles scss/ to dist/ and copies the minified file to docs/
npm run watch   # rebuilds docs/monospaced.min.css on change; open docs/index.html

Edit only the files in scss/; dist/ and docs/monospaced.min.css are generated.

License

GPL-3.0 © Andrea Rufo

About

A supersimple, monospaced, modular, flat stylesheet made in SASS for simple pages

Topics

Resources

Stars

6 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages