A design system for building faithful recreations of old UIs

🚀 Discover this insightful post from Hacker News 📖

📂 **Category**:

📌 **What You’ll Learn**:


98.css – A design system for building faithful recreations of old UIs






A design system for building faithful recreations of old UIs.

npm

gzip size

Intro

98.css is a CSS library for building interfaces that look like Windows 98.
See more on GitHub.

This library relies on the usage of semantic HTML. To make a button, you’ll need
to use a

Show code
<button class="default">OKbutton>

When buttons are clicked, the raised borders become sunken.
The following button is simulated to be in the pressed (active) state.

Show code
<button>I am being pressedbutton>

Disabled buttons maintain the same raised border, but have a “washed out”
appearance in their label.

Show code
<button disabled>I cannot be clickedbutton>

Button focus is communicated with a dotted border, set 4px within the contents of the button.
The following example is simulated to be focused.

Show code
<button>I am focusedbutton>

Checkbox

A check box represents an independent or non-exclusive choice.

— Microsoft Windows User Experience p. 167

Checkboxes are represented with a sunken panel, populated with a “check” icon when
selected, next to a label indicating the choice.

Note: You must include a corresponding label after
your checkbox, using the element with a for attribute
pointed at the id of your input. This ensures the checkbox is easy to use with
assistive technologies, on top of ensuring a good user experience for all (navigating with the tab key,
being able to click the entire label to select the box).

Checkboxes can be selected and disabled with the standard checked and disabled
attributes.

When grouping inputs, wrap each input in a container with the field-row class. This ensures
a consistent spacing between inputs.

OptionButton

An option button, also referred to as a radio button, represents a single
choice within a limited set of mutually exclusive choices. That is, the user can choose only
one set of options.

— Microsoft Windows User Experience p. 164

Option buttons can be used via the radio type on an input element.

Option buttons can be grouped by specifying a shared name attribute on each
input. Just as before: when grouping inputs, wrap each input in a container with the
field-row class to ensure a consistent spacing between inputs.

Option buttons can also be checked and disabled with their corresponding
HTML attributes.

GroupBox

A group box is a special control you can use to organize a set of
controls. A group box is a rectangular frame with an optional label that surrounds
a set of controls.

— Microsoft Windows User Experience p. 189

A group box can be used by wrapping your elements with the fieldset tag.
It contains a sunken outer border and a raised inner border, resembling an engraved box
around your controls.

You can provide your group with a label by placing a legend element
within the fieldset.

TextBox

A text box (also referred to as an edit control) is a
rectangular control where the user enters or edits text. It can
be defined to support a single line or multiple lines of text.

— Microsoft Windows User Experience p. 181

Text boxes can rendered by specifying a text type on an
input element. As with checkboxes and radio buttons, you
should provide a corresponding label with a properly set for
attribute, and wrap both in a container with the field-row class.

Additionally, you can make use of the field-row-stacked class
to position your label above the input instead of beside it.

To support multiple lines in the user’s input, use the textarea
element instead.