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>
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 hexTokens #
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
#121212
#262626
#323232
#4a4a4a
#5e5e5e
#767676
#9a9a9a
#b8b8b8
glow
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.
Type scale
| Token | Size | Use |
|---|---|---|
--gm-fs-xs | 8px | Labels, tags, captions, buttons |
--gm-fs-sm | 10px | Body copy (default) |
--gm-fs-md | 12px | Sub-headings, modal titles |
--gm-fs-lg | 16px | Window titles |
--gm-fs-xl | 24px | Page headings |
--gm-scale | 1 or 1.25 | Multiplies 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 call | What it does |
|---|---|
data-gm-accent-set="cyan" | Switches the glow to a preset on click. |
data-gm-accent-custom | On 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-close | Collapses the nearest window or module to its title strip. |
data-gm-reset | Moves 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-draggable | Windows 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.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.
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.
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.
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.
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.
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 #
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.
Uses the current glow colour.
3 files copied to the archive.
12 mb left on drive c:.
Insert a disk into drive a: and press retry.
Version 7 can be downloaded now.
Cards #
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.
| Client | Project | Size |
|---|---|---|
| Record book ltd | Main site | 1.2 mb |
| Kestrel audio | Promo CD | 48 mb |
| Harbour bank | Intranet | 310 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.
Breadcrumb #
Pagination #
Dropdowns #
Menus are raised steel panels; the highlighted item fills with the glow.
Accordion #
The open item turns into a glow plate. The chevron is replaced by a pixel plus and minus.
Modal #
A modal is a window: sunken title strip, grooved body. Keep modal markup as a direct child of body, outside .gm-viewport, so it is not trapped under the backdrop. Below is a static preview and a live button.
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.
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.
Select #
Input group #
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.
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.
Utilities #
| Class | Effect |
|---|---|
.gm-accent | Text in the glow colour. |
.gm-bg-accent | Glow background with dark text. |
.gm-display | Large condensed headline, as in the home plate of the prototype. |
.gm-scroll | Scrolling container with a contained overscroll. |
.gm-divider | Dashed rule between items in a well. |
.gm-blink | Stepped cursor blink. Off when effects are off or motion is reduced. |
html.gm-fx-off | Removes 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.