@punkfairie/98.css 1.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.devenv/load-exports +1 -0
- package/.devenv/root +1 -0
- package/.devenv/tasks.db +0 -0
- package/.devenv/tasks.db-shm +0 -0
- package/.devenv/tasks.db-wal +0 -0
- package/.direnv/bin/nix-direnv-reload +19 -0
- package/.direnv/flake-profile-a5d5b61aa8a61b7d9d765e1daf971a9a578f1cfa.rc +2228 -0
- package/.editorconfig +18 -0
- package/.envrc +17 -0
- package/LICENSE +7 -0
- package/README.md +76 -0
- package/build.js +81 -0
- package/dist/98.css +2 -0
- package/dist/98.css.map +1 -0
- package/dist/docs.css +152 -0
- package/dist/icon.png +0 -0
- package/dist/index.html +1673 -0
- package/dist/index.html.ejs +1129 -0
- package/dist/ms_sans_serif.woff +0 -0
- package/dist/ms_sans_serif.woff2 +0 -0
- package/dist/ms_sans_serif_bold.woff +0 -0
- package/dist/ms_sans_serif_bold.woff2 +0 -0
- package/dist/vs.css +67 -0
- package/dist/window.png +0 -0
- package/dist/zoom.png +0 -0
- package/docs/docs.css +152 -0
- package/docs/icon.png +0 -0
- package/docs/index.html.ejs +1129 -0
- package/docs/vs.css +67 -0
- package/docs/window.png +0 -0
- package/docs/zoom.png +0 -0
- package/flake.nix +60 -0
- package/fonts/converted/ms_sans_serif.woff +0 -0
- package/fonts/converted/ms_sans_serif.woff2 +0 -0
- package/fonts/converted/ms_sans_serif_bold.woff +0 -0
- package/fonts/converted/ms_sans_serif_bold.woff2 +0 -0
- package/fonts/src/ms-sans-serif/MS Sans Serif.ttf +0 -0
- package/fonts/src/ms-sans-serif/license.txt +4 -0
- package/fonts/src/ms-sans-serif/readme.txt +26 -0
- package/fonts/src/ms-sans-serif-bold/MS Sans Serif Bold.ttf +0 -0
- package/fonts/src/ms-sans-serif-bold/license.txt +4 -0
- package/fonts/src/ms-sans-serif-bold/readme.txt +26 -0
- package/icon/button-down-active.svg +5 -0
- package/icon/button-down.svg +8 -0
- package/icon/button-left.svg +8 -0
- package/icon/button-right.svg +8 -0
- package/icon/button-up.svg +8 -0
- package/icon/checkmark-disabled.svg +3 -0
- package/icon/checkmark.svg +3 -0
- package/icon/close.svg +3 -0
- package/icon/groupbox-border.svg +4 -0
- package/icon/help.svg +8 -0
- package/icon/indicator-horizontal.svg +6 -0
- package/icon/indicator-rectangle-horizontal.svg +6 -0
- package/icon/maximize-disabled.svg +4 -0
- package/icon/maximize.svg +3 -0
- package/icon/minimize.svg +3 -0
- package/icon/radio-border-disabled.svg +7 -0
- package/icon/radio-border.svg +8 -0
- package/icon/radio-dot-disabled.svg +3 -0
- package/icon/radio-dot.svg +3 -0
- package/icon/restore.svg +10 -0
- package/icon/scrollbar-background.svg +4 -0
- package/icon/sunken-panel-border.svg +10 -0
- package/now.json +4 -0
- package/package.json +48 -0
- package/server.js +16 -0
- package/style.css +1052 -0
|
@@ -0,0 +1,1129 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>98.css - A design system for building faithful recreations of old UIs</title>
|
|
5
|
+
<link rel="Shortcut Icon" type="image/x-icon" href="icon.png" />
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
8
|
+
|
|
9
|
+
<meta property="og:title" content="98.css" />
|
|
10
|
+
<meta name="Description" content="A design system for building faithful recreations of old UIs." />
|
|
11
|
+
<meta property="og:description" content="A design system for building faithful recreations of old UIs." />
|
|
12
|
+
<meta
|
|
13
|
+
property="og:image"
|
|
14
|
+
content="https://github.com/jdan/98.css/raw/main/docs/window.png?raw=true"
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
<link rel="stylesheet" href="98.css">
|
|
18
|
+
<link rel="stylesheet" href="docs.css">
|
|
19
|
+
<link rel="stylesheet" href="vs.css">
|
|
20
|
+
</head>
|
|
21
|
+
<body ontouchstart>
|
|
22
|
+
<aside>
|
|
23
|
+
<ul class="tree-view">
|
|
24
|
+
<li><a href="#intro">Intro</a></li>
|
|
25
|
+
<li>
|
|
26
|
+
<a href="#components">Components</a>
|
|
27
|
+
<ul>
|
|
28
|
+
<li><a href="#button">Button</a></li>
|
|
29
|
+
<li><a href="#checkbox">Checkbox</a></li>
|
|
30
|
+
<li><a href="#option-button">OptionButton</a></li>
|
|
31
|
+
<li><a href="#group-box">GroupBox</a></li>
|
|
32
|
+
<li><a href="#text-box">TextBox</a></li>
|
|
33
|
+
<li><a href="#slider">Slider</a></li>
|
|
34
|
+
<li><a href="#dropdown">Dropdown</a></li>
|
|
35
|
+
<li>
|
|
36
|
+
<a href="#window">Window</a>
|
|
37
|
+
<ul>
|
|
38
|
+
<li><a href="#title-bar">Title Bar</a></li>
|
|
39
|
+
<li><a href="#window-contents">Window contents</a></li>
|
|
40
|
+
<li><a href="#status-bar">Status Bar</a></li>
|
|
41
|
+
</ul>
|
|
42
|
+
</li>
|
|
43
|
+
<li><a href="#tree-view">TreeView</a></li>
|
|
44
|
+
<li><a href="#tabs">Tabs</a></li>
|
|
45
|
+
<li><a href="#table-view">TableView</a></li>
|
|
46
|
+
<li><a href="#progress-indicator">Progress Indicator</a></li>
|
|
47
|
+
<li><a href="#field-borders">Field borders</a></li>
|
|
48
|
+
</ul>
|
|
49
|
+
</li>
|
|
50
|
+
<li><a href="#issues-contributing-etc">Issues, Contributing, etc.</a></li>
|
|
51
|
+
</ul>
|
|
52
|
+
</aside>
|
|
53
|
+
|
|
54
|
+
<main>
|
|
55
|
+
<h1>98.css</h1>
|
|
56
|
+
<hr>
|
|
57
|
+
<p>A design system for building faithful recreations of old UIs.</p>
|
|
58
|
+
|
|
59
|
+
<p>
|
|
60
|
+
<a href="http://npm.im/98.css" rel="nofollow" style="text-decoration: none">
|
|
61
|
+
<img height="29" alt="npm" src="https://98badges.now.sh/api/version" style="max-width:100%;">
|
|
62
|
+
</a>
|
|
63
|
+
<a href="https://unpkg.com/98.css" rel="nofollow" style="text-decoration: none">
|
|
64
|
+
<img height="29" alt="gzip size" src="https://98badges.now.sh/api/size" style="max-width:100%;">
|
|
65
|
+
</a>
|
|
66
|
+
</p>
|
|
67
|
+
|
|
68
|
+
<h2 id="intro">Intro</h2>
|
|
69
|
+
<p>
|
|
70
|
+
98.css is a CSS library for building interfaces that look like Windows 98.
|
|
71
|
+
See more <a href="https://github.com/jdan/98.css">on GitHub</a>.
|
|
72
|
+
</p>
|
|
73
|
+
|
|
74
|
+
<div class="window" style="margin: 32px; width: 250px">
|
|
75
|
+
<div class="title-bar">
|
|
76
|
+
<div class="title-bar-text">
|
|
77
|
+
My First VB4 Program
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div class="title-bar-controls">
|
|
81
|
+
<button aria-label="Minimize"></button>
|
|
82
|
+
<button aria-label="Maximize"></button>
|
|
83
|
+
<button aria-label="Close"></button>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
<div class="window-body">
|
|
87
|
+
<p>Hello, world!</p>
|
|
88
|
+
<section class="field-row" style="justify-content: flex-end">
|
|
89
|
+
<button>OK</button>
|
|
90
|
+
<button>Cancel</button>
|
|
91
|
+
</section>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<p>
|
|
96
|
+
This library relies on the usage of <strong>semantic HTML</strong>. To make a button, you'll need
|
|
97
|
+
to use a <code><button></code>. Input elements require labels. Icon buttons rely on
|
|
98
|
+
<code>aria-label</code>. This page will guide you through that process, but accessibility is a primary
|
|
99
|
+
goal of this project.
|
|
100
|
+
</p>
|
|
101
|
+
|
|
102
|
+
<p>
|
|
103
|
+
You can override many of the styles of your elements while maintaining the appearance provided by
|
|
104
|
+
this library. Need more padding on your buttons? Go for it. Need to add some color to your input labels?
|
|
105
|
+
Be our guest.
|
|
106
|
+
</p>
|
|
107
|
+
|
|
108
|
+
<p>
|
|
109
|
+
<strong>This library does not contain any JavaScript</strong>, it merely styles your HTML with some CSS.
|
|
110
|
+
This means 98.css is compatible with your frontend framework of choice.
|
|
111
|
+
</p>
|
|
112
|
+
|
|
113
|
+
<p>
|
|
114
|
+
Here is an example of <a href="https://codesandbox.io/s/objective-chandrasekhar-t5t6h?file=/src/index.js">98.css used with React</a>, and
|
|
115
|
+
<a href="https://codesandbox.io/s/late-sound-miqho?file=/index.html">an example with vanilla JavaScript</a>. The fastest way to use 98.css is to import it from unpkg.
|
|
116
|
+
</p>
|
|
117
|
+
|
|
118
|
+
<pre style="max-width: 375px"><code><link
|
|
119
|
+
rel="stylesheet"
|
|
120
|
+
href="https://unpkg.com/98.css"
|
|
121
|
+
></code></pre>
|
|
122
|
+
|
|
123
|
+
<p>
|
|
124
|
+
You can install 98.css from the <a href="https://github.com/jdan/98.css/releases">GitHub releases page</a>, or <a href="https://www.npmjs.com/package/98.css">from npm</a>.
|
|
125
|
+
</p>
|
|
126
|
+
<pre style="max-width: 375px"><code>npm install 98.css</code></pre>
|
|
127
|
+
|
|
128
|
+
<h2 id="components">Components</h2>
|
|
129
|
+
|
|
130
|
+
<section class="component">
|
|
131
|
+
<h3 id="button">Button</h3>
|
|
132
|
+
<div>
|
|
133
|
+
<blockquote>
|
|
134
|
+
A <em>command button</em>, also referred to as a push button, is a control
|
|
135
|
+
that causes the application to perform some action when the user clicks it.
|
|
136
|
+
|
|
137
|
+
<footer>— Microsoft Windows User Experience p. 160</footer>
|
|
138
|
+
</blockquote>
|
|
139
|
+
|
|
140
|
+
<p>
|
|
141
|
+
A standard button measures 75px wide and 23px tall, with a raised outer and inner border.
|
|
142
|
+
They are given 12px of horizontal padding by default.
|
|
143
|
+
</p>
|
|
144
|
+
|
|
145
|
+
<%- example(`<button>Click me</button>
|
|
146
|
+
<input type="submit" />
|
|
147
|
+
<input type="reset" /> `)%>
|
|
148
|
+
|
|
149
|
+
<p>
|
|
150
|
+
You can add the class <code>default</code> to any button to apply additional styling,
|
|
151
|
+
useful when communicating to the user what default action would happen in the active window if
|
|
152
|
+
the <kbd>Enter</kbd> key was pressed on Windows 98.
|
|
153
|
+
</p>
|
|
154
|
+
|
|
155
|
+
<%- example(`<button class="default">OK</button>`)%>
|
|
156
|
+
|
|
157
|
+
<p>
|
|
158
|
+
When buttons are clicked, the raised borders become sunken.
|
|
159
|
+
The following button is simulated to be in the pressed (active) state.
|
|
160
|
+
</p>
|
|
161
|
+
|
|
162
|
+
<% /* [[ ... ]] is used to render contents that
|
|
163
|
+
will not appear in the "Show code" section */
|
|
164
|
+
%>
|
|
165
|
+
<%- example(`<button[[ class="active"]]>I am being pressed</button>`) %>
|
|
166
|
+
|
|
167
|
+
<p>
|
|
168
|
+
Disabled buttons maintain the same raised border, but have a "washed out"
|
|
169
|
+
appearance in their label.
|
|
170
|
+
</p>
|
|
171
|
+
|
|
172
|
+
<%- example(`<button disabled>I cannot be clicked</button>`) %>
|
|
173
|
+
|
|
174
|
+
<p>
|
|
175
|
+
Button focus is communicated with a dotted border, set 4px within the contents of the button.
|
|
176
|
+
The following example is simulated to be focused.
|
|
177
|
+
</p>
|
|
178
|
+
|
|
179
|
+
<%- example(`<button[[ class="focused"]]>I am focused</button>`) %>
|
|
180
|
+
</div>
|
|
181
|
+
</section>
|
|
182
|
+
|
|
183
|
+
<section class="component">
|
|
184
|
+
<h3 id="checkbox">Checkbox</h3>
|
|
185
|
+
<div>
|
|
186
|
+
<blockquote>
|
|
187
|
+
A <em>check box</em> represents an independent or non-exclusive choice.
|
|
188
|
+
<footer>— Microsoft Windows User Experience p. 167</footer>
|
|
189
|
+
</blockquote>
|
|
190
|
+
|
|
191
|
+
<p>
|
|
192
|
+
Checkboxes are represented with a sunken panel, populated with a "check" icon when
|
|
193
|
+
selected, next to a label indicating the choice.
|
|
194
|
+
</p>
|
|
195
|
+
|
|
196
|
+
<p>
|
|
197
|
+
Note: You <strong>must</strong> include a corresponding label <strong>after</strong>
|
|
198
|
+
your checkbox, using the <code><label></code> element with a <code>for</code> attribute
|
|
199
|
+
pointed at the <code>id</code> of your input. This ensures the checkbox is easy to use with
|
|
200
|
+
assistive technologies, on top of ensuring a good user experience for all (navigating with the tab key,
|
|
201
|
+
being able to click the entire label to select the box).
|
|
202
|
+
</p>
|
|
203
|
+
|
|
204
|
+
<%- example(`
|
|
205
|
+
<input type="checkbox" id="example${getNewId()}">
|
|
206
|
+
<label for="example${getCurrentId()}">This is a checkbox</label>
|
|
207
|
+
`) %>
|
|
208
|
+
|
|
209
|
+
<p>
|
|
210
|
+
Checkboxes can be selected and disabled with the standard <code>checked</code> and <code>disabled</code>
|
|
211
|
+
attributes.
|
|
212
|
+
</p>
|
|
213
|
+
|
|
214
|
+
<p>
|
|
215
|
+
When grouping inputs, wrap each input in a container with the <code>field-row</code> class. This ensures
|
|
216
|
+
a consistent spacing between inputs.
|
|
217
|
+
</p>
|
|
218
|
+
|
|
219
|
+
<%- example(`
|
|
220
|
+
<div class="field-row">
|
|
221
|
+
<input checked type="checkbox" id="example${getNewId()}">
|
|
222
|
+
<label for="example${getCurrentId()}">I am checked</label>
|
|
223
|
+
</div>
|
|
224
|
+
<div class="field-row">
|
|
225
|
+
<input disabled type="checkbox" id="example${getNewId()}">
|
|
226
|
+
<label for="example${getCurrentId()}">I am inactive</label>
|
|
227
|
+
</div>
|
|
228
|
+
<div class="field-row">
|
|
229
|
+
<input checked disabled type="checkbox" id="example${getNewId()}">
|
|
230
|
+
<label for="example${getCurrentId()}">I am inactive but still checked</label>
|
|
231
|
+
</div>
|
|
232
|
+
`) %>
|
|
233
|
+
</div>
|
|
234
|
+
</section>
|
|
235
|
+
|
|
236
|
+
<section class="component">
|
|
237
|
+
<h3 id="option-button">OptionButton</h3>
|
|
238
|
+
<div>
|
|
239
|
+
<blockquote>
|
|
240
|
+
An <em>option button</em>, also referred to as a radio button, represents a single
|
|
241
|
+
choice within a limited set of mutually exclusive choices. That is, the user can choose only
|
|
242
|
+
one set of options.
|
|
243
|
+
|
|
244
|
+
<footer>— Microsoft Windows User Experience p. 164</footer>
|
|
245
|
+
</blockquote>
|
|
246
|
+
|
|
247
|
+
<p>
|
|
248
|
+
Option buttons can be used via the <code>radio</code> type on an input element.
|
|
249
|
+
</p>
|
|
250
|
+
|
|
251
|
+
<p>
|
|
252
|
+
Option buttons can be grouped by specifying a shared <code>name</code> attribute on each
|
|
253
|
+
input. Just as before: when grouping inputs, wrap each input in a container with the
|
|
254
|
+
<code>field-row</code> class to ensure a consistent spacing between inputs.
|
|
255
|
+
</p>
|
|
256
|
+
|
|
257
|
+
<%- example(`
|
|
258
|
+
<div class="field-row">
|
|
259
|
+
<input id="radio${getNewId()}" type="radio" name="first-example">
|
|
260
|
+
<label for="radio${getCurrentId()}">Yes</label>
|
|
261
|
+
</div>
|
|
262
|
+
<div class="field-row">
|
|
263
|
+
<input id="radio${getNewId()}" type="radio" name="first-example">
|
|
264
|
+
<label for="radio${getCurrentId()}">No</label>
|
|
265
|
+
</div>
|
|
266
|
+
`) %>
|
|
267
|
+
|
|
268
|
+
<p>
|
|
269
|
+
Option buttons can also be <code>checked</code> and <code>disabled</code> with their corresponding
|
|
270
|
+
HTML attributes.
|
|
271
|
+
</p>
|
|
272
|
+
|
|
273
|
+
<%- example(`
|
|
274
|
+
<div class="field-row">
|
|
275
|
+
<input id="radio${getNewId()}" type="radio" name="second-example">
|
|
276
|
+
<label for="radio${getCurrentId()}">Peanut butter should be smooth</label>
|
|
277
|
+
</div>
|
|
278
|
+
<div class="field-row">
|
|
279
|
+
<input checked disabled id="radio${getNewId()}" type="radio" name="second-example">
|
|
280
|
+
<label for="radio${getCurrentId()}">I understand why people like crunchy peanut butter</label>
|
|
281
|
+
</div>
|
|
282
|
+
<div class="field-row">
|
|
283
|
+
<input disabled id="radio${getNewId()}" type="radio" name="second-example">
|
|
284
|
+
<label for="radio${getCurrentId()}">Crunchy peanut butter is good</label>
|
|
285
|
+
</div>
|
|
286
|
+
`) %>
|
|
287
|
+
</div>
|
|
288
|
+
</section>
|
|
289
|
+
|
|
290
|
+
<section class="component">
|
|
291
|
+
<h3 id="group-box">GroupBox</h3>
|
|
292
|
+
<div>
|
|
293
|
+
<blockquote>
|
|
294
|
+
A <em>group box</em> is a special control you can use to organize a set of
|
|
295
|
+
controls. A group box is a rectangular frame with an optional label that surrounds
|
|
296
|
+
a set of controls.
|
|
297
|
+
|
|
298
|
+
<footer>— Microsoft Windows User Experience p. 189</footer>
|
|
299
|
+
</blockquote>
|
|
300
|
+
|
|
301
|
+
<p>
|
|
302
|
+
A group box can be used by wrapping your elements with the <code>fieldset</code> tag.
|
|
303
|
+
It contains a sunken outer border and a raised inner border, resembling an engraved box
|
|
304
|
+
around your controls.
|
|
305
|
+
</p>
|
|
306
|
+
|
|
307
|
+
<%- example(`
|
|
308
|
+
<fieldset>
|
|
309
|
+
<div class="field-row">Select one:</div>
|
|
310
|
+
<div class="field-row">
|
|
311
|
+
<input id="radio${getNewId()}" type="radio" name="fieldset-example">
|
|
312
|
+
<label for="radio${getCurrentId()}">Diners</label>
|
|
313
|
+
</div>
|
|
314
|
+
<div class="field-row">
|
|
315
|
+
<input id="radio${getNewId()}" type="radio" name="fieldset-example">
|
|
316
|
+
<label for="radio${getCurrentId()}">Drive-Ins</label>
|
|
317
|
+
</div>
|
|
318
|
+
<div class="field-row">
|
|
319
|
+
<input id="radio${getNewId()}" type="radio" name="fieldset-example">
|
|
320
|
+
<label for="radio${getCurrentId()}">Dives</label>
|
|
321
|
+
</div>
|
|
322
|
+
</fieldset>
|
|
323
|
+
`) %>
|
|
324
|
+
|
|
325
|
+
<p>
|
|
326
|
+
You can provide your group with a label by placing a <code>legend</code> element
|
|
327
|
+
within the <code>fieldset</code>.
|
|
328
|
+
</p>
|
|
329
|
+
|
|
330
|
+
<%- example(`
|
|
331
|
+
<fieldset>
|
|
332
|
+
<legend>Today's mood</legend>
|
|
333
|
+
<div class="field-row">
|
|
334
|
+
<input id="radio${getNewId()}" type="radio" name="fieldset-example2">
|
|
335
|
+
<label for="radio${getCurrentId()}">Claire Saffitz</label>
|
|
336
|
+
</div>
|
|
337
|
+
<div class="field-row">
|
|
338
|
+
<input id="radio${getNewId()}" type="radio" name="fieldset-example2">
|
|
339
|
+
<label for="radio${getCurrentId()}">Brad Leone</label>
|
|
340
|
+
</div>
|
|
341
|
+
<div class="field-row">
|
|
342
|
+
<input id="radio${getNewId()}" type="radio" name="fieldset-example2">
|
|
343
|
+
<label for="radio${getCurrentId()}">Chris Morocco</label>
|
|
344
|
+
</div>
|
|
345
|
+
<div class="field-row">
|
|
346
|
+
<input id="radio${getNewId()}" type="radio" name="fieldset-example2">
|
|
347
|
+
<label for="radio${getCurrentId()}">Carla Lalli Music</label>
|
|
348
|
+
</div>
|
|
349
|
+
</fieldset>
|
|
350
|
+
`) %>
|
|
351
|
+
</div>
|
|
352
|
+
</section>
|
|
353
|
+
|
|
354
|
+
<section class="component">
|
|
355
|
+
<h3 id="text-box">TextBox</h3>
|
|
356
|
+
<div>
|
|
357
|
+
<blockquote>
|
|
358
|
+
A <em>text box</em> (also referred to as an edit control) is a
|
|
359
|
+
rectangular control where the user enters or edits text. It can
|
|
360
|
+
be defined to support a single line or multiple lines of text.
|
|
361
|
+
|
|
362
|
+
<footer>— Microsoft Windows User Experience p. 181</footer>
|
|
363
|
+
</blockquote>
|
|
364
|
+
|
|
365
|
+
<p>
|
|
366
|
+
Text boxes can rendered by specifying a <code>text</code> type on an
|
|
367
|
+
<code>input</code> element. As with checkboxes and radio buttons, you
|
|
368
|
+
should provide a corresponding label with a properly set <code>for</code>
|
|
369
|
+
attribute, and wrap both in a container with the <code>field-row</code> class.
|
|
370
|
+
</p>
|
|
371
|
+
|
|
372
|
+
<%- example(`
|
|
373
|
+
<div class="field-row">
|
|
374
|
+
<label for="text${getNewId()}">Occupation</label>
|
|
375
|
+
<input id="text${getCurrentId()}" type="text" />
|
|
376
|
+
</div>
|
|
377
|
+
`) %>
|
|
378
|
+
|
|
379
|
+
<p>
|
|
380
|
+
Additionally, you can make use of the <code>field-row-stacked</code> class
|
|
381
|
+
to position your label above the input instead of beside it.
|
|
382
|
+
</p>
|
|
383
|
+
|
|
384
|
+
<%- example(`
|
|
385
|
+
<div class="field-row-stacked" style="width: 200px">
|
|
386
|
+
<label for="text${getNewId()}">Address (Line 1)</label>
|
|
387
|
+
<input id="text${getCurrentId()}" type="text" />
|
|
388
|
+
</div>
|
|
389
|
+
<div class="field-row-stacked" style="width: 200px">
|
|
390
|
+
<label for="text${getNewId()}">Address (Line 2)</label>
|
|
391
|
+
<input id="text${getCurrentId()}" type="text" />
|
|
392
|
+
</div>
|
|
393
|
+
`) %>
|
|
394
|
+
|
|
395
|
+
<p>
|
|
396
|
+
To support multiple lines in the user's input, use the <code>textarea</code>
|
|
397
|
+
element instead.
|
|
398
|
+
</p>
|
|
399
|
+
|
|
400
|
+
<%- example(`
|
|
401
|
+
<div class="field-row-stacked" style="width: 200px">
|
|
402
|
+
<label for="text${getNewId()}">Additional notes</label>
|
|
403
|
+
<textarea id="text${getCurrentId()}" rows="8"></textarea>
|
|
404
|
+
</div>
|
|
405
|
+
`) %>
|
|
406
|
+
|
|
407
|
+
<p>
|
|
408
|
+
Text boxes can also be disabled and have value with their corresponding HTML attributes.
|
|
409
|
+
</p>
|
|
410
|
+
|
|
411
|
+
<%- example(`
|
|
412
|
+
<div class="field-row">
|
|
413
|
+
<label for="text${getNewId()}">Favorite color</label>
|
|
414
|
+
<input id="text${getCurrentId()}" disabled type="text" value="Windows Green"/>
|
|
415
|
+
</div>
|
|
416
|
+
`) %>
|
|
417
|
+
</div>
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
</section>
|
|
421
|
+
|
|
422
|
+
<section class="component">
|
|
423
|
+
<h3 id="slider">Slider</h3>
|
|
424
|
+
<div>
|
|
425
|
+
<blockquote>
|
|
426
|
+
A <em>slider</em>, sometimes called a trackbar control, consists of a bar that
|
|
427
|
+
defines the extent or range of the adjustment and an indicator that
|
|
428
|
+
shows the current value for the control...
|
|
429
|
+
|
|
430
|
+
<footer>— Microsoft Windows User Experience p. 146</footer>
|
|
431
|
+
</blockquote>
|
|
432
|
+
|
|
433
|
+
<p>
|
|
434
|
+
Sliders can rendered by specifying a <code>range</code> type on an
|
|
435
|
+
<code>input</code> element.
|
|
436
|
+
</p>
|
|
437
|
+
|
|
438
|
+
<%- example(`
|
|
439
|
+
<div class="field-row" style="width: 300px">
|
|
440
|
+
<label for="range${getNewId()}">Volume:</label>
|
|
441
|
+
<label for="range${getNewId()}">Low</label>
|
|
442
|
+
<input id="range${getCurrentId()}" type="range" min="1" max="11" value="5" />
|
|
443
|
+
<label for="range${getNewId()}">High</label>
|
|
444
|
+
</div>
|
|
445
|
+
`) %>
|
|
446
|
+
|
|
447
|
+
<p>
|
|
448
|
+
You can make use of the <code>has-box-indicator</code> class replace the
|
|
449
|
+
default indicator with a box indicator, furthermore the slider can be wrapped
|
|
450
|
+
with a <code>div</code> using <code>is-vertical</code> to display the input vertically.
|
|
451
|
+
</p>
|
|
452
|
+
|
|
453
|
+
<p>
|
|
454
|
+
Note: To change the length of a vertical slider, the <code>input</code> width
|
|
455
|
+
and <code>div</code> height.
|
|
456
|
+
</p>
|
|
457
|
+
|
|
458
|
+
<%- example(`
|
|
459
|
+
<div class="field-row">
|
|
460
|
+
<label for="range${getNewId()}">Cowbell</label>
|
|
461
|
+
<div class="is-vertical">
|
|
462
|
+
<input id="range${getCurrentId()}" class="has-box-indicator" type="range" min="1" max="3" step="1" value="2" />
|
|
463
|
+
</div>
|
|
464
|
+
</div>
|
|
465
|
+
`) %>
|
|
466
|
+
</div>
|
|
467
|
+
</section>
|
|
468
|
+
|
|
469
|
+
<section class="component">
|
|
470
|
+
<h3 id="dropdown">Dropdown</h3>
|
|
471
|
+
<div>
|
|
472
|
+
<blockquote>
|
|
473
|
+
A <em>drop-down list box</em> allows the selection of only a
|
|
474
|
+
single item from a list. In its closed state, the control displays
|
|
475
|
+
the current value for the control. The user opens the list to change
|
|
476
|
+
the value.
|
|
477
|
+
|
|
478
|
+
<footer>
|
|
479
|
+
— Microsoft Windows User Experience p. 175
|
|
480
|
+
</footer>
|
|
481
|
+
</blockquote>
|
|
482
|
+
|
|
483
|
+
<p>
|
|
484
|
+
Dropdowns can be rendered by using the <code>select</code> and <code>option</code>
|
|
485
|
+
elements.
|
|
486
|
+
</p>
|
|
487
|
+
|
|
488
|
+
<%- example(`
|
|
489
|
+
<select>
|
|
490
|
+
<option>5 - Incredible!</option>
|
|
491
|
+
<option>4 - Great!</option>
|
|
492
|
+
<option>3 - Pretty good</option>
|
|
493
|
+
<option>2 - Not so great</option>
|
|
494
|
+
<option>1 - Unfortunate</option>
|
|
495
|
+
</select>
|
|
496
|
+
`) %>
|
|
497
|
+
|
|
498
|
+
<p>
|
|
499
|
+
By default, the first option will be selected. You can change this by
|
|
500
|
+
giving one of your <code>option</code> elements the <code>selected</code>
|
|
501
|
+
attribute.
|
|
502
|
+
</p>
|
|
503
|
+
|
|
504
|
+
<%- example(`
|
|
505
|
+
<select>
|
|
506
|
+
<option>5 - Incredible!</option>
|
|
507
|
+
<option>4 - Great!</option>
|
|
508
|
+
<option selected>3 - Pretty good</option>
|
|
509
|
+
<option>2 - Not so great</option>
|
|
510
|
+
<option>1 - Unfortunate</option>
|
|
511
|
+
</select>
|
|
512
|
+
`) %>
|
|
513
|
+
</div>
|
|
514
|
+
</section>
|
|
515
|
+
|
|
516
|
+
<h3 id="window">Window</h3>
|
|
517
|
+
<p>
|
|
518
|
+
The following components illustrate how to build complete windows using
|
|
519
|
+
98.css.
|
|
520
|
+
</p>
|
|
521
|
+
|
|
522
|
+
<section class="component">
|
|
523
|
+
<h4 id="title-bar">Title Bar</h4>
|
|
524
|
+
<div>
|
|
525
|
+
<blockquote>
|
|
526
|
+
At the top edge of the window, inside its border, is the title bar
|
|
527
|
+
(also reffered to as the caption or caption bar), which extends across
|
|
528
|
+
the width of the window. The title bar identifies the contents of the
|
|
529
|
+
window.
|
|
530
|
+
|
|
531
|
+
<footer>
|
|
532
|
+
— Microsoft Windows User Experience p. 118
|
|
533
|
+
</footer>
|
|
534
|
+
</blockquote>
|
|
535
|
+
|
|
536
|
+
<blockquote>
|
|
537
|
+
Include command buttons associated with the common commands of the
|
|
538
|
+
primary window in the title bar. These buttons act as shortcuts to specific
|
|
539
|
+
window commands.
|
|
540
|
+
|
|
541
|
+
<footer>
|
|
542
|
+
— Microsoft Windows User Experience p. 122
|
|
543
|
+
</footer>
|
|
544
|
+
</blockquote>
|
|
545
|
+
|
|
546
|
+
<p>
|
|
547
|
+
You can build a complete title bar by making use of three classes,
|
|
548
|
+
<code>title-bar</code>, <code>title-bar-text</code>, and <code>title-bar-controls</code>.
|
|
549
|
+
</p>
|
|
550
|
+
|
|
551
|
+
<%- example(`
|
|
552
|
+
<div class="title-bar">
|
|
553
|
+
<div class="title-bar-text">A Title Bar</div>
|
|
554
|
+
<div class="title-bar-controls">
|
|
555
|
+
<button aria-label="Close"></button>
|
|
556
|
+
</div>
|
|
557
|
+
</div>
|
|
558
|
+
`) %>
|
|
559
|
+
|
|
560
|
+
<p>
|
|
561
|
+
We make use of <code>aria-label</code> to render the Close button, to let
|
|
562
|
+
assistive technologies know the intent of this button. You may also use
|
|
563
|
+
"Minimize", "Maximize", "Restore" and "Help" like so:
|
|
564
|
+
</p>
|
|
565
|
+
|
|
566
|
+
<%- example(`
|
|
567
|
+
<div class="title-bar">
|
|
568
|
+
<div class="title-bar-text">A Title Bar</div>
|
|
569
|
+
<div class="title-bar-controls">
|
|
570
|
+
<button aria-label="Minimize"></button>
|
|
571
|
+
<button aria-label="Maximize"></button>
|
|
572
|
+
<button aria-label="Close"></button>
|
|
573
|
+
</div>
|
|
574
|
+
</div>
|
|
575
|
+
|
|
576
|
+
<br />
|
|
577
|
+
|
|
578
|
+
<div class="title-bar">
|
|
579
|
+
<div class="title-bar-text">A Maximized Title Bar</div>
|
|
580
|
+
<div class="title-bar-controls">
|
|
581
|
+
<button aria-label="Minimize"></button>
|
|
582
|
+
<button aria-label="Restore"></button>
|
|
583
|
+
<button aria-label="Close"></button>
|
|
584
|
+
</div>
|
|
585
|
+
</div>
|
|
586
|
+
|
|
587
|
+
<br />
|
|
588
|
+
|
|
589
|
+
<div class="title-bar">
|
|
590
|
+
<div class="title-bar-text">A Helpful Bar</div>
|
|
591
|
+
<div class="title-bar-controls">
|
|
592
|
+
<button aria-label="Help"></button>
|
|
593
|
+
<button aria-label="Close"></button>
|
|
594
|
+
</div>
|
|
595
|
+
</div>
|
|
596
|
+
`) %>
|
|
597
|
+
|
|
598
|
+
<p>
|
|
599
|
+
Each <code>aria-label</code> also has a corresponding styling class to render the title bar buttons,
|
|
600
|
+
to let the <code>aria-label</code> text be in other languages without causing rendering, accessibility, or localization issues.
|
|
601
|
+
</p>
|
|
602
|
+
|
|
603
|
+
<%- example(`
|
|
604
|
+
<div class="title-bar">
|
|
605
|
+
<div class="title-bar-text">A Title Bar using Button Styling Classes</div>
|
|
606
|
+
<div class="title-bar-controls">
|
|
607
|
+
<button aria-label="Any Text" class="minimize"></button>
|
|
608
|
+
<button aria-label="Any Text" class="maximize"></button>
|
|
609
|
+
<button aria-label="Any Text" class="close"></button>
|
|
610
|
+
</div>
|
|
611
|
+
</div>
|
|
612
|
+
|
|
613
|
+
<br />
|
|
614
|
+
|
|
615
|
+
<div class="title-bar">
|
|
616
|
+
<div class="title-bar-text">A Maximized Title Bar using Button Styling Classes</div>
|
|
617
|
+
<div class="title-bar-controls">
|
|
618
|
+
<button aria-label="Any Text" class="minimize"></button>
|
|
619
|
+
<button aria-label="Any Text" class="restore"></button>
|
|
620
|
+
<button aria-label="Any Text" class="close"></button>
|
|
621
|
+
</div>
|
|
622
|
+
</div>
|
|
623
|
+
|
|
624
|
+
<br />
|
|
625
|
+
|
|
626
|
+
<div class="title-bar">
|
|
627
|
+
<div class="title-bar-text">A Helpful Bar using Button Styling Classes</div>
|
|
628
|
+
<div class="title-bar-controls">
|
|
629
|
+
<button aria-label="Any Text" class="help"></button>
|
|
630
|
+
<button aria-label="Any Text" class="close"></button>
|
|
631
|
+
</div>
|
|
632
|
+
</div>
|
|
633
|
+
`) %>
|
|
634
|
+
|
|
635
|
+
<p>
|
|
636
|
+
Maximize buttons can be disabled, useful when making a window appear as if it cannot be maximized.
|
|
637
|
+
</p>
|
|
638
|
+
|
|
639
|
+
<%- example(`
|
|
640
|
+
<div class="title-bar">
|
|
641
|
+
<div class="title-bar-text">A Title Bar with Maximize disabled</div>
|
|
642
|
+
<div class="title-bar-controls">
|
|
643
|
+
<button aria-label="Minimize"></button>
|
|
644
|
+
<button aria-label="Maximize" disabled></button>
|
|
645
|
+
<button aria-label="Close"></button>
|
|
646
|
+
</div>
|
|
647
|
+
</div>
|
|
648
|
+
`) %>
|
|
649
|
+
|
|
650
|
+
<p>
|
|
651
|
+
You can make a title bar "inactive" by adding <code>inactive</code> class,
|
|
652
|
+
useful when making more than one window.
|
|
653
|
+
</p>
|
|
654
|
+
<%- example(`
|
|
655
|
+
<div class="title-bar inactive">
|
|
656
|
+
<div class="title-bar-text">An inactive title bar</div>
|
|
657
|
+
<div class="title-bar-controls">
|
|
658
|
+
<button aria-label="Close"></button>
|
|
659
|
+
</div>
|
|
660
|
+
</div>
|
|
661
|
+
`) %>
|
|
662
|
+
</div>
|
|
663
|
+
</section>
|
|
664
|
+
|
|
665
|
+
<section class="component">
|
|
666
|
+
<h4 id="window-contents">Window contents</h4>
|
|
667
|
+
<div>
|
|
668
|
+
<blockquote>
|
|
669
|
+
Every window has a boundary that defines its shape.
|
|
670
|
+
|
|
671
|
+
<footer>
|
|
672
|
+
— Microsoft Windows User Experience p. 118
|
|
673
|
+
</footer>
|
|
674
|
+
</blockquote>
|
|
675
|
+
|
|
676
|
+
<p>
|
|
677
|
+
To give our title bar a home, we make use of the <code>window</code>
|
|
678
|
+
class. This provides a raised outer and inner border, as well as some
|
|
679
|
+
padding. We can freely resize the window by specifying a width in the
|
|
680
|
+
container style.
|
|
681
|
+
</p>
|
|
682
|
+
|
|
683
|
+
<%- example(`
|
|
684
|
+
<div class="window" style="width: 300px">
|
|
685
|
+
<div class="title-bar">
|
|
686
|
+
<div class="title-bar-text">A Complete Window</div>
|
|
687
|
+
<div class="title-bar-controls">
|
|
688
|
+
<button aria-label="Minimize"></button>
|
|
689
|
+
<button aria-label="Maximize"></button>
|
|
690
|
+
<button aria-label="Close"></button>
|
|
691
|
+
</div>
|
|
692
|
+
</div>
|
|
693
|
+
</div>
|
|
694
|
+
`) %>
|
|
695
|
+
|
|
696
|
+
<p>
|
|
697
|
+
To draw the contents of the window, we use the <code>window-body</code>
|
|
698
|
+
class under the title bar.
|
|
699
|
+
</p>
|
|
700
|
+
|
|
701
|
+
<%- example(`
|
|
702
|
+
<div class="window" style="width: 300px">
|
|
703
|
+
<div class="title-bar">
|
|
704
|
+
<div class="title-bar-text">A Window With Stuff In It</div>
|
|
705
|
+
<div class="title-bar-controls">
|
|
706
|
+
<button aria-label="Minimize"></button>
|
|
707
|
+
<button aria-label="Maximize"></button>
|
|
708
|
+
<button aria-label="Close"></button>
|
|
709
|
+
</div>
|
|
710
|
+
</div>
|
|
711
|
+
<div class="window-body">
|
|
712
|
+
<p>There's so much room for activities!</p>
|
|
713
|
+
</div>
|
|
714
|
+
</div>
|
|
715
|
+
`) %>
|
|
716
|
+
</div>
|
|
717
|
+
</section>
|
|
718
|
+
|
|
719
|
+
<section class="component">
|
|
720
|
+
<h4 id="status-bar">Status Bar</h4>
|
|
721
|
+
<div>
|
|
722
|
+
<blockquote>
|
|
723
|
+
A status bar is a special area within a window, typically the bottom, that displays information
|
|
724
|
+
about the current state of what is being viewed in the window or any other contextual information, such as keyboard
|
|
725
|
+
state.
|
|
726
|
+
|
|
727
|
+
<footer>
|
|
728
|
+
— Microsoft Windows User Experience p. 146
|
|
729
|
+
</footer>
|
|
730
|
+
</blockquote>
|
|
731
|
+
|
|
732
|
+
<p>
|
|
733
|
+
You can render a status bar with the <code>status-bar</code> class,
|
|
734
|
+
and <code>status-bar-field</code> for every child text element.
|
|
735
|
+
</p>
|
|
736
|
+
|
|
737
|
+
<%- example(`
|
|
738
|
+
<div class="window" style="width: 320px">
|
|
739
|
+
<div class="title-bar">
|
|
740
|
+
<div class="title-bar-text">A Window With A Status Bar</div>
|
|
741
|
+
</div>
|
|
742
|
+
<div class="window-body">
|
|
743
|
+
<p> There are just so many possibilities:</p>
|
|
744
|
+
<ul>
|
|
745
|
+
<li>A Task Manager</li>
|
|
746
|
+
<li>A Notepad</li>
|
|
747
|
+
<li>Or even a File Explorer!</li>
|
|
748
|
+
</ul>
|
|
749
|
+
</div>
|
|
750
|
+
<div class="status-bar">
|
|
751
|
+
<p class="status-bar-field">Press F1 for help</p>
|
|
752
|
+
<p class="status-bar-field">Slide 1</p>
|
|
753
|
+
<p class="status-bar-field">CPU Usage: 14%</p>
|
|
754
|
+
</div>
|
|
755
|
+
</div>
|
|
756
|
+
`) %>
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
</section>
|
|
760
|
+
|
|
761
|
+
<section class="component">
|
|
762
|
+
<h3 id="tree-view">TreeView</h3>
|
|
763
|
+
<div>
|
|
764
|
+
<blockquote>
|
|
765
|
+
A <em>tree view control</em> is a special list box control
|
|
766
|
+
that displays a set of objects as an indented outline based
|
|
767
|
+
on their logical hierarchical relationship.
|
|
768
|
+
|
|
769
|
+
<footer>
|
|
770
|
+
— Microsoft Windows User Experience p. 178
|
|
771
|
+
</footer>
|
|
772
|
+
</blockquote>
|
|
773
|
+
|
|
774
|
+
<p>
|
|
775
|
+
To render a tree view, use an <code>ul</code> element with the
|
|
776
|
+
<code>tree-view</code> class. The children of this list (<code>li</code>
|
|
777
|
+
elements), can contain whatever you'd like.
|
|
778
|
+
</p>
|
|
779
|
+
|
|
780
|
+
<%- example(`
|
|
781
|
+
<ul class="tree-view">
|
|
782
|
+
<li>We can put</li>
|
|
783
|
+
<li><strong style="color: purple">✨ Whatever ✨</strong></li>
|
|
784
|
+
<li>We want in here</li>
|
|
785
|
+
</ul>
|
|
786
|
+
`) %>
|
|
787
|
+
|
|
788
|
+
<p>
|
|
789
|
+
To make this a tree, we can nest further <code>ul</code> elements
|
|
790
|
+
(no class needed on these). This will provide them with a nice dotted
|
|
791
|
+
border and indentation to illustrate the structure of the tree.
|
|
792
|
+
</p>
|
|
793
|
+
<p>
|
|
794
|
+
To create expandable sections, wrap child lists inside of
|
|
795
|
+
<code>details</code> elements.
|
|
796
|
+
</p>
|
|
797
|
+
|
|
798
|
+
<%- example(`
|
|
799
|
+
<ul class="tree-view">
|
|
800
|
+
<li>Table of Contents</li>
|
|
801
|
+
<li>What is web development?</li>
|
|
802
|
+
<li>
|
|
803
|
+
CSS
|
|
804
|
+
<ul>
|
|
805
|
+
<li>Selectors</li>
|
|
806
|
+
<li>Specificity</li>
|
|
807
|
+
<li>Properties</li>
|
|
808
|
+
</ul>
|
|
809
|
+
</li>
|
|
810
|
+
<li>
|
|
811
|
+
<details open>
|
|
812
|
+
<summary>JavaScript</summary>
|
|
813
|
+
<ul>
|
|
814
|
+
<li>Avoid at all costs</li>
|
|
815
|
+
<li>
|
|
816
|
+
<details>
|
|
817
|
+
<summary>Unless</summary>
|
|
818
|
+
<ul>
|
|
819
|
+
<li>Avoid</li>
|
|
820
|
+
<li>
|
|
821
|
+
<details>
|
|
822
|
+
<summary>At</summary>
|
|
823
|
+
<ul>
|
|
824
|
+
<li>Avoid</li>
|
|
825
|
+
<li>At</li>
|
|
826
|
+
<li>All</li>
|
|
827
|
+
<li>Cost</li>
|
|
828
|
+
</ul>
|
|
829
|
+
</details>
|
|
830
|
+
</li>
|
|
831
|
+
<li>All</li>
|
|
832
|
+
<li>Cost</li>
|
|
833
|
+
</ul>
|
|
834
|
+
</details>
|
|
835
|
+
</li>
|
|
836
|
+
</ul>
|
|
837
|
+
</details>
|
|
838
|
+
</li>
|
|
839
|
+
<li>HTML</li>
|
|
840
|
+
<li>Special Thanks</li>
|
|
841
|
+
</ul>
|
|
842
|
+
`) %>
|
|
843
|
+
</div>
|
|
844
|
+
</section>
|
|
845
|
+
|
|
846
|
+
<section class="component">
|
|
847
|
+
<h3 id="tabs">Tabs</h3>
|
|
848
|
+
<div>
|
|
849
|
+
<blockquote>
|
|
850
|
+
A <em>tab control</em> is analogous to a divider in a file cabinet or notebook.
|
|
851
|
+
You can use this control to define multiple logical pages or sections of information within the same window.
|
|
852
|
+
|
|
853
|
+
<footer>
|
|
854
|
+
— Microsoft Windows User Experience p. 193
|
|
855
|
+
</footer>
|
|
856
|
+
</blockquote>
|
|
857
|
+
|
|
858
|
+
<p>
|
|
859
|
+
To render a tab list, use a <code>menu</code> element with the
|
|
860
|
+
<code>[role=tablist]</code> attribute. The children of this menu (<code>li</code>
|
|
861
|
+
elements), should get a <code>[role=tab]</code> attribute.
|
|
862
|
+
</p>
|
|
863
|
+
|
|
864
|
+
<p>
|
|
865
|
+
Tabs should be managed by adding custom javascript code.
|
|
866
|
+
All you need is to add the <code>[aria-selected=true]</code> attribute to the active tab.
|
|
867
|
+
</p>
|
|
868
|
+
|
|
869
|
+
<%- example(`
|
|
870
|
+
<div class="window-body">
|
|
871
|
+
<p>Hello, world!</p>
|
|
872
|
+
|
|
873
|
+
<menu role="tablist">
|
|
874
|
+
<li role="tab" aria-selected="true"><a href="#tabs">Desktop</a></li>
|
|
875
|
+
<li role="tab"><a href="#tabs">My computer</a></li>
|
|
876
|
+
<li role="tab"><a href="#tabs">Control panel</a></li>
|
|
877
|
+
<li role="tab"><a href="#tabs">Devices manager</a></li>
|
|
878
|
+
<li role="tab"><a href="#tabs">Hardware profiles</a></li>
|
|
879
|
+
<li role="tab"><a href="#tabs">Performance</a></li>
|
|
880
|
+
</menu>
|
|
881
|
+
<div class="window" role="tabpanel">
|
|
882
|
+
<div class="window-body">
|
|
883
|
+
<p>the tab content</p>
|
|
884
|
+
</div>
|
|
885
|
+
</div>
|
|
886
|
+
</div>
|
|
887
|
+
`) %>
|
|
888
|
+
|
|
889
|
+
<p>
|
|
890
|
+
To create multirows tabs, add a <code>multirows</code>
|
|
891
|
+
class to the <code>menu</code> tag.
|
|
892
|
+
</p>
|
|
893
|
+
|
|
894
|
+
<%- example(`
|
|
895
|
+
<div class="window-body">
|
|
896
|
+
<p>Hello, world!</p>
|
|
897
|
+
|
|
898
|
+
<menu role="tablist" class="multirows">
|
|
899
|
+
<li role="tab"><a href="#tabs">Desktop</a></li>
|
|
900
|
+
<li role="tab"><a href="#tabs">My computer</a></li>
|
|
901
|
+
<li role="tab"><a href="#tabs">Control panel</a></li>
|
|
902
|
+
<li role="tab"><a href="#tabs">Devices manager</a></li>
|
|
903
|
+
<li role="tab"><a href="#tabs">Hardware profiles</a></li>
|
|
904
|
+
<li role="tab"><a href="#tabs">Performance</a></li>
|
|
905
|
+
</menu>
|
|
906
|
+
<menu role="tablist" class="multirows">
|
|
907
|
+
<li role="tab"><a href="#tabs">Users</a></li>
|
|
908
|
+
<li role="tab"><a href="#tabs">Network</a></li>
|
|
909
|
+
<li role="tab"><a href="#tabs">Programs</a></li>
|
|
910
|
+
<li role="tab"><a href="#tabs">Services</a></li>
|
|
911
|
+
<li role="tab"><a href="#tabs">Resources</a></li>
|
|
912
|
+
<li role="tab"><a href="#tabs">Advanced</a></li>
|
|
913
|
+
</menu>
|
|
914
|
+
<div class="window" role="tabpanel">
|
|
915
|
+
<div class="window-body">
|
|
916
|
+
<p>the tab content</p>
|
|
917
|
+
</div>
|
|
918
|
+
</div>
|
|
919
|
+
</div>
|
|
920
|
+
`) %>
|
|
921
|
+
</div>
|
|
922
|
+
</section>
|
|
923
|
+
<section class="component">
|
|
924
|
+
<h3 id="table-view">TableView</h3>
|
|
925
|
+
<div>
|
|
926
|
+
<p>
|
|
927
|
+
To render a table view, use a table element. Wrap it with a div element with <code>sunken-panel</code> class to provide proper border and overflow container.
|
|
928
|
+
</p>
|
|
929
|
+
<p>
|
|
930
|
+
With a bit of extra scripting you can make table view interactive. Give <code>interactive</code> class to
|
|
931
|
+
table element to show pointer cursor when hovering over body rows. Table rows can be given
|
|
932
|
+
<code>highlighted</code> class to appear selected.
|
|
933
|
+
</p>
|
|
934
|
+
|
|
935
|
+
<%- example(`
|
|
936
|
+
<div class="sunken-panel" style="height: 120px; width: 240px;">
|
|
937
|
+
<table class="interactive">
|
|
938
|
+
<thead>
|
|
939
|
+
<tr>
|
|
940
|
+
<th>Name</th>
|
|
941
|
+
<th>Version</th>
|
|
942
|
+
<th>Company</th>
|
|
943
|
+
</tr>
|
|
944
|
+
</thead>
|
|
945
|
+
<tbody>
|
|
946
|
+
<tr>
|
|
947
|
+
<td>MySQL ODBC 3.51 Driver</td>
|
|
948
|
+
<td>3.51.11.00</td>
|
|
949
|
+
<td>MySQL AB</td>
|
|
950
|
+
</tr>
|
|
951
|
+
<tr>
|
|
952
|
+
<td>SQL Server</td>
|
|
953
|
+
<td>3.70.06.23</td>
|
|
954
|
+
<td>Microsoft Corporation</td>
|
|
955
|
+
</tr>
|
|
956
|
+
<tr>
|
|
957
|
+
<td>SQL Server</td>
|
|
958
|
+
<td>3.70.06.23</td>
|
|
959
|
+
<td>Microsoft Corporation</td>
|
|
960
|
+
</tr>
|
|
961
|
+
<tr>
|
|
962
|
+
<td>SQL Server</td>
|
|
963
|
+
<td>3.70.06.23</td>
|
|
964
|
+
<td>Microsoft Corporation</td>
|
|
965
|
+
</tr>
|
|
966
|
+
<tr>
|
|
967
|
+
<td>SQL Server</td>
|
|
968
|
+
<td>3.70.06.23</td>
|
|
969
|
+
<td>Microsoft Corporation</td>
|
|
970
|
+
</tr>
|
|
971
|
+
<tr>
|
|
972
|
+
<td>SQL Server</td>
|
|
973
|
+
<td>3.70.06.23</td>
|
|
974
|
+
<td>Microsoft Corporation</td>
|
|
975
|
+
</tr>
|
|
976
|
+
<tr>
|
|
977
|
+
<td>SQL Server</td>
|
|
978
|
+
<td>3.70.06.23</td>
|
|
979
|
+
<td>Microsoft Corporation</td>
|
|
980
|
+
</tr>
|
|
981
|
+
<tr>
|
|
982
|
+
<td>SQL Server</td>
|
|
983
|
+
<td>3.70.06.23</td>
|
|
984
|
+
<td>Microsoft Corporation</td>
|
|
985
|
+
</tr>
|
|
986
|
+
<tr>
|
|
987
|
+
<td>SQL Server</td>
|
|
988
|
+
<td>3.70.06.23</td>
|
|
989
|
+
<td>Microsoft Corporation</td>
|
|
990
|
+
</tr>
|
|
991
|
+
<tr>
|
|
992
|
+
<td>SQL Server</td>
|
|
993
|
+
<td>3.70.06.23</td>
|
|
994
|
+
<td>Microsoft Corporation</td>
|
|
995
|
+
</tr>
|
|
996
|
+
</tbody>
|
|
997
|
+
</table>
|
|
998
|
+
</div>
|
|
999
|
+
<script>
|
|
1000
|
+
document.querySelectorAll('table.interactive').forEach(element => {
|
|
1001
|
+
element.addEventListener('click', (event) => {
|
|
1002
|
+
const highlightedClass = 'highlighted';
|
|
1003
|
+
const isRow = element => element.tagName === 'TR' && element.parentElement.tagName === 'TBODY';
|
|
1004
|
+
const newlySelectedRow = event.composedPath().find(isRow);
|
|
1005
|
+
const previouslySelectedRow = Array.from(newlySelectedRow.parentElement.children).filter(isRow).find(element => element.classList.contains(highlightedClass));
|
|
1006
|
+
if(previouslySelectedRow){
|
|
1007
|
+
previouslySelectedRow.classList.toggle(highlightedClass);
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
if (newlySelectedRow) {
|
|
1011
|
+
newlySelectedRow.classList.toggle(highlightedClass);
|
|
1012
|
+
}
|
|
1013
|
+
})
|
|
1014
|
+
});
|
|
1015
|
+
</script>
|
|
1016
|
+
`) %>
|
|
1017
|
+
</div>
|
|
1018
|
+
</section>
|
|
1019
|
+
|
|
1020
|
+
<section class="component">
|
|
1021
|
+
<h3 id="progress-indicator">Progress Indicator</h3>
|
|
1022
|
+
<div>
|
|
1023
|
+
<blockquote>
|
|
1024
|
+
You can use a <em>progress indicator</em>, also known as a <em>progress bar control</em>, to show the percentage of completion of a lengthy operation.
|
|
1025
|
+
|
|
1026
|
+
<footer>
|
|
1027
|
+
— Microsoft Windows User Experience p. 189
|
|
1028
|
+
</footer>
|
|
1029
|
+
</blockquote>
|
|
1030
|
+
|
|
1031
|
+
<p>
|
|
1032
|
+
There are two types of progress bars: solid and segmented. The solid version is the default. To declare a segmented bar, you should use the <code>segmented</code> class.
|
|
1033
|
+
</p>
|
|
1034
|
+
|
|
1035
|
+
<%- example(`
|
|
1036
|
+
<div class="progress-indicator">
|
|
1037
|
+
<span class="progress-indicator-bar" style="width: 40%;" />
|
|
1038
|
+
</div>
|
|
1039
|
+
`) %>
|
|
1040
|
+
|
|
1041
|
+
<%- example(`
|
|
1042
|
+
<div class="progress-indicator segmented">
|
|
1043
|
+
<span class="progress-indicator-bar" style="width: 40%;" />
|
|
1044
|
+
</div>
|
|
1045
|
+
`) %>
|
|
1046
|
+
</div>
|
|
1047
|
+
</section>
|
|
1048
|
+
|
|
1049
|
+
<section class="component">
|
|
1050
|
+
<h3 id="field-borders">Field borders</a></li></h3>
|
|
1051
|
+
<div>
|
|
1052
|
+
<blockquote>
|
|
1053
|
+
Text boxes, check boxes, drop-down list boxes, spin boxes and list
|
|
1054
|
+
boxes use the <em>field border style</em>. You can also use the style
|
|
1055
|
+
for define the work area within a window. It uses the sunken outer and
|
|
1056
|
+
sunken inner basic border styles.
|
|
1057
|
+
|
|
1058
|
+
For most controls, the interior of the field uses the button highlight
|
|
1059
|
+
color. For text fields, such as text boxes and combo boxes, the
|
|
1060
|
+
interior uses the button face color when the field is read-only or
|
|
1061
|
+
disabled.
|
|
1062
|
+
|
|
1063
|
+
<footer>
|
|
1064
|
+
— Microsoft Windows User Experience p. 421
|
|
1065
|
+
</footer>
|
|
1066
|
+
</blockquote>
|
|
1067
|
+
|
|
1068
|
+
<blockquote>
|
|
1069
|
+
Status fields use the <em>status field border style</em>. This style
|
|
1070
|
+
uses only the sunken outer basic border style. You use the status
|
|
1071
|
+
field style in status bars and other read-only fields where the
|
|
1072
|
+
content of the file can change dynamically.
|
|
1073
|
+
|
|
1074
|
+
<footer>
|
|
1075
|
+
— Microsoft Windows User Experience p. 422
|
|
1076
|
+
</footer>
|
|
1077
|
+
</blockquote>
|
|
1078
|
+
|
|
1079
|
+
As mentioned in these guidelines, these styles are used in other
|
|
1080
|
+
contexts than just form elements and status fields such as to indicate
|
|
1081
|
+
work areas and dynamic content. For that reason, we provide three
|
|
1082
|
+
classes for these generic usages, <code>field-border</code>,
|
|
1083
|
+
<code>field-border-disabled</code>, and
|
|
1084
|
+
<code>status-field-border</code>. These classes only define the border
|
|
1085
|
+
and background color and minimal padding, so you will typically need to
|
|
1086
|
+
at least provide some extra padding yourself.
|
|
1087
|
+
|
|
1088
|
+
<%- example(`
|
|
1089
|
+
<div class="field-border" style="padding: 8px">
|
|
1090
|
+
Work area
|
|
1091
|
+
</div>
|
|
1092
|
+
`) %>
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
<%- example(`
|
|
1096
|
+
<div class="field-border-disabled" style="padding: 8px">
|
|
1097
|
+
Disabled work area
|
|
1098
|
+
</div>
|
|
1099
|
+
`) %>
|
|
1100
|
+
|
|
1101
|
+
<%- example(`
|
|
1102
|
+
<div class="status-field-border" style="padding: 8px">
|
|
1103
|
+
Dynamic content
|
|
1104
|
+
</div>
|
|
1105
|
+
`) %>
|
|
1106
|
+
</div>
|
|
1107
|
+
</section>
|
|
1108
|
+
|
|
1109
|
+
<h2 id="issues-contributing-etc">Issues, Contributing, etc.</h2>
|
|
1110
|
+
|
|
1111
|
+
<p>
|
|
1112
|
+
98.css is <a href="https://github.com/jdan/98.css/blob/main/LICENSE">MIT licensed</a>.
|
|
1113
|
+
</p>
|
|
1114
|
+
|
|
1115
|
+
<p>
|
|
1116
|
+
Refer to <a href="https://github.com/jdan/98.css/issues">the GitHub issues page</a> to see bugs
|
|
1117
|
+
in my CSS or report new ones. I'd really like to see your pull requests (especially those new to
|
|
1118
|
+
open-source!) and will happily provide code review. 98.css is a fun, silly project and I'd like
|
|
1119
|
+
to make it a fun place to build your open-source muscle.
|
|
1120
|
+
</p>
|
|
1121
|
+
|
|
1122
|
+
<p>
|
|
1123
|
+
Thank you for checking my little project out, I hope it brought you some joy today. Consider
|
|
1124
|
+
<a href="https://github.com/jdan/98.css/stargazers">starring/following along on GitHub</a> and maybe
|
|
1125
|
+
subscribing to more fun things on <a href="https://twitter.com/jdan">my twitter</a>. 👋
|
|
1126
|
+
</p>
|
|
1127
|
+
</main>
|
|
1128
|
+
</body>
|
|
1129
|
+
</html>
|