Components: reference for v0.6
Open prototype

Getting started

Introduction #

Gunmetal OS is a theme for Bootstrap 5.3 that makes pages look like a Flash-era desktop: bevelled steel windows, floppy-disk icons, pixel type and one glow colour that drives every accent. It does not replace Bootstrap. The grid, utilities and JavaScript plugins work as usual; the theme restyles them and adds a small set of gm- classes for the desktop shell.

This page lists every element with a live example and the markup that produces it. To see the pieces assembled into a full site, open the prototype.

Install #

Load the two pixel fonts, Bootstrap, then gunmetal.css. Put gm-os on the body. Add gunmetal.js after the Bootstrap bundle if you want glow switching, draggable windows, wallpapers and the music panel.

<!doctype html>
<html lang="en" data-gm-accent="orange">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;700&family=Saira+Condensed:wght@800&display=swap" rel="stylesheet">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
  <link href="gunmetal.css" rel="stylesheet">
</head>
<body class="gm-os">
  ...
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  <script src="gunmetal.js"></script>
</body>
</html>
The theme is dark only and sets color-scheme: dark. Do not add data-bs-theme="dark"; the gm tokens already cover it.

Glow colours #

One accent colour, the glow, is used for plates, icons, LEDs, progress bars, active states, scrollbars and focus. Set a preset on the html element, or pass any hex value through JavaScript. Status colours (success, warning, danger, info) stay fixed so meaning never depends on the glow.

<html data-gm-accent="cyan">

GM.setAccent('lime');      // preset
GM.setAccent('#ff2266');   // any hex

Tokens #

All colours, sizes and bevels are CSS custom properties on :root. Bootstrap's own variables (--bs-primary, --bs-body-bg, --bs-border-radius and others) are mapped to them, so stock components pick up the theme.

Steel palette

--gm-void
#121212
--gm-deep
#262626
--gm-well
#323232
--gm-panel
#4a4a4a
--gm-frame
#5e5e5e
--gm-steel
#767676
--gm-field
#9a9a9a
--gm-hi
#b8b8b8
--gm-accent
glow
--gm-accent-dim

Bevels

Four box-shadow tokens build every edge in the theme. Combine them with --gm-line for the black outline and --gm-drop for the hard drop shadow.

raised
sunken
groove
drop

Type scale

TokenSizeUse
--gm-fs-xs8pxLabels, tags, captions, buttons
--gm-fs-sm10pxBody copy (default)
--gm-fs-md12pxSub-headings, modal titles
--gm-fs-lg16pxWindow titles
--gm-fs-xl24pxPage headings
--gm-scale1 or 1.25Multiplies all of the above. Set by data-gm-text="large".

JavaScript API #

gunmetal.js has no dependencies and works through data attributes. Every choice is saved in localStorage and restored on the next visit. The same functions are exposed on window.GM.

Attribute or callWhat it does
data-gm-accent-set="cyan"Switches the glow to a preset on click.
data-gm-accent-customOn an input type="color", applies the picked colour.
data-gm-wall-set="night"Sets the wallpaper on .gm-viewport.
data-gm-target="#id"On an icon, shows that section and hides others with the same data-gm-group. Updates the window title from data-gm-title and data-gm-sub.
data-gm-closeCollapses the nearest window or module to its title strip.
data-gm-resetMoves the nearest window back to where it started. data-gm-reset="all" also restores all settings.
data-gm-track="0"Plays one of nine built-in chip tracks (0–8).
data-gm-action="…"music-toggle, music-off, glow-cycle, wall-cycle, wall-load, text-toggle, shutdown.
.gm-draggableWindows inside it can be dragged by their bar on screens 992px and wider.
GM.setAccent(v) GM.setWall(v) GM.setText(v) GM.setFx(bool) GM.play(i) GM.stop()The same actions from your own code. The gm:accent event fires on document when the glow changes.

Shell

Desktop #

The desktop is three nested layers: .gm-desktop pads the page, .gm-screen is the steel frame with cut corners, and .gm-viewport holds the wallpaper, grain and scanlines. Inside it, .gm-workspace is a two-column grid: the .gm-stage for windows and a 190px .gm-dock on the right. Below 992px the grid becomes one column.

<div class="gm-desktop">
  <div class="gm-screen">
    <div class="gm-viewport gm-wall-sunrise">
      <a class="gm-logo" href="#">
        <span class="gm-logo-word">Gunmetal</span><span class="gm-logo-mark">OS</span>
      </a>
      <div class="gm-workspace gm-draggable">
        <main class="gm-stage"> windows </main>
        <aside class="gm-dock"> modules </aside>
      </div>
      <div class="gm-statusbar">...</div>
    </div>
  </div>
</div>

For a page without the dock, such as this one, use .gm-logo-inline inside a sticky .gm-topbar.

Window #

A window has a bar (grip, reset and collapse), a title box and a grooved body. Put panes inside the body to split content into framed blocks. Add .gm-window-float to make a smaller window that overlaps the one above it, like a palette.

Team

: mug shots of the people behind the work.
About
Window body content goes here.

Dock module #

Modules are the small panels in the dock. The head holds a tag and a collapse button; .gm-fieldrow lines up a label and a field in two columns.

Client area login

Icon bar #

A six-column grid of floppy-disk icons used as the main navigation. The active icon turns into a dark socket with a lit dot. Include the gm-floppy SVG symbol once per page.

<!-- once per page -->
<svg width="0" height="0" style="position:absolute" aria-hidden="true">
  <symbol id="gm-floppy" viewBox="0 0 16 16">
    <path fill="currentColor" fill-rule="evenodd" d="M2 2h10l2 2v10H2zM5 2v4h6V2zM4 9v5h8V9zM9 3h1v2H9zM5 10h6v1H5zM5 12h6v1H5z"/>
  </symbol>
</svg>

Status bar #

Sits in the bottom-left corner of the viewport. Each child becomes an inset cell. data-gm-clock shows the local time.

© Gunmetal 2001V.6--:--

Drop slot #

A disk-drive slot for drag and drop. With data-gm-drop, an image dropped on it becomes the wallpaper. It lights up with the glow while a file is held over it.

Drop disk here

Content

Typography #

Silkscreen is the pixel face for everything; Saira Condensed is used only for the logo and .gm-display headlines. Font smoothing is turned off so pixels stay sharp. h5 and h6 take the glow colour.

Heading 1

Heading 2

Heading 3

Heading 5

Body copy at 10px. A link uses the glow.

Small text at 8px for captions.

Steel shell.

Surfaces #

Four surfaces cover most layouts. A pane is a grooved frame inside a window. A well is a dark inset box for text. A plate is a solid glow block with dark text. An LCD is a black readout with glowing text.

.gm-pane
.gm-well
.gm-plate with a link
.gm-screen-lcd 626 kb

Add .gm-scroll and a max height to a well to make a scrolling news column, and use hr.gm-divider between items.

Site launched

The new site is a hybrid of Flash and HTML.


Interview

We talked about 3D for the web.

Tags #

Small labels that name a pane or a panel. Place one at the top of a pane, before its content.

gm-tag gm-tag-solid gm-tag-plain

Media frame #

.gm-media frames an image or video and turns it into a glow duotone: the picture is made greyscale and multiplied over the glow colour, so photos follow the theme. Add .gm-media-raw to keep original colours.

Code and kbd #

Inline .gm-window and keys: Ctrl + S

10 PRINT "HELLO"
20 GOTO 10

Components

Buttons #

Standard Bootstrap button classes. Buttons are raised steel and press in when clicked. .btn-primary uses the glow; .btn-dark is a dark key with glowing text; outline variants all use the glow.

Sizes and states

Button group #

Group buttons, or use .btn-check radios for a toggle where one option stays pressed.

Micro controls #

Tiny controls for window bars and dock modules. .gm-chip is a 10px button, .gm-x a square close or collapse button, .gm-key a flat dark key (add .is-on to light it), .gm-grip the striped drag handle and .gm-led a status light.

Badges #

New v.6 Beta Online Busy Hot

Inbox 4

Alerts #

Alerts are dark wells with a coloured edge. The first line takes the edge colour, so start with a short heading and put the detail on the next line.

Cards #

Case study
Record book site

Built entirely in Flash with XML feeding the database content.

Read case

List group #

Tables #

Wrap a table in .table-wrap for the sunken frame and horizontal scrolling on narrow screens. Striped, hover and active rows all work.

ClientProjectSize
Record book ltdMain site1.2 mb
Kestrel audioPromo CD48 mb
Harbour bankIntranet310 kb

Progress #

Bars are drawn as LED segments in the glow colour. Use .bg-secondary for a grey secondary bar, such as a buffer.

VU meter #

A vertical segmented level meter. Set --gm-level from 0 to 1. The music panel drives it automatically.

Spinners #

Spinners are square and turn in eight steps, like a low frame-rate animation.

Loading
Loading

Pagination #

Accordion #

The open item turns into a glow plate. The chevron is replaced by a pixel plus and minus.

Set data-gm-accent on the html tag.

No. It only looks like it does.

Offcanvas #

A side drawer styled like a window. Like the modal, place its markup directly in body.

Toasts #

System messages with a lit LED. The preview is shown statically; the button triggers a live one in the corner.

Systemnow
Showreel_2001.swf saved to drive c:

Tooltips and popovers #

Tooltips are small glow labels. Popovers get a glow header. gunmetal.js initialises every data-bs-toggle="tooltip" and "popover" element on load.

Forms

Form controls #

Fields are light grey and sunken, as in Flash-era forms. Focus adds a glow ring. Labels are 8px pixel text.

We never share it.

Select #

Input group #

GBP .00

Checks and radios #

Square 10px boxes. When checked, a glow square appears inside, like the quality and speed toggles on old Flash sites.

Switches #

Range #

Validation #

Use Bootstrap's .is-valid and .is-invalid. The field gets a green or red ring and the message tells the user how to fix it.

Name is free.
Use at least 8 characters.

Extras

Wallpapers #

Six wallpapers are built from CSS gradients, so they need no image files. Apply one as a class on .gm-viewport, or switch at runtime with data-gm-wall-set. The night wallpaper uses the glow for its grid.

Music panel #

Nine looping chip tracks generated with the Web Audio API, so there are no audio files. Any element with data-gm-track plays a track; data-gm-music-readout, data-gm-music-pos and .gm-vu update while it plays.

Music off

Utilities #

ClassEffect
.gm-accentText in the glow colour.
.gm-bg-accentGlow background with dark text.
.gm-displayLarge condensed headline, as in the home plate of the prototype.
.gm-scrollScrolling container with a contained overscroll.
.gm-dividerDashed rule between items in a well.
.gm-blinkStepped cursor blink. Off when effects are off or motion is reduced.
html.gm-fx-offRemoves scanlines and grain and stops animation. Set by the Speed option.
html[data-gm-text="large"]Scales all pixel text by 1.25 for easier reading.

All pieces together: open the assembled prototype.

© Gunmetal 2001Docs v.6Prototype--:--

Gallery

Drawers hold filters, settings or a secondary menu.

Systemnow
Showreel_2001.swf saved to drive c: