@rcarls/rc-theme-win31 0.0.0 → 0.7.0

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +185 -0
  2. package/DESIGN.md +195 -0
  3. package/README.md +157 -5
  4. package/bridge.css +257 -0
  5. package/components/accordion.css +21 -0
  6. package/components/adaptive-menu.css +108 -0
  7. package/components/app-bar.css +66 -0
  8. package/components/bottom-sheet.css +41 -0
  9. package/components/button.css +74 -0
  10. package/components/card.css +50 -0
  11. package/components/carousel.css +59 -0
  12. package/components/chip-group.css +33 -0
  13. package/components/chip.css +56 -0
  14. package/components/combobox.css +83 -0
  15. package/components/dialog.css +156 -0
  16. package/components/disclosure.css +106 -0
  17. package/components/fab-menu.css +47 -0
  18. package/components/fab.css +49 -0
  19. package/components/field.css +73 -0
  20. package/components/icons.css +56 -0
  21. package/components/list-item.css +90 -0
  22. package/components/listbox.css +39 -0
  23. package/components/markdown-editor.css +80 -0
  24. package/components/menu-button.css +39 -0
  25. package/components/menu.css +64 -0
  26. package/components/menubar.css +67 -0
  27. package/components/modes.css +58 -0
  28. package/components/navigation-bar.css +52 -0
  29. package/components/navigation-rail.css +57 -0
  30. package/components/popover.css +13 -0
  31. package/components/progress.css +47 -0
  32. package/components/range-slider.css +41 -0
  33. package/components/scroller.css +91 -0
  34. package/components/search-bar.css +65 -0
  35. package/components/segmented-button.css +64 -0
  36. package/components/select.css +73 -0
  37. package/components/slider.css +64 -0
  38. package/components/snackbar.css +50 -0
  39. package/components/splitter.css +42 -0
  40. package/components/switch.css +75 -0
  41. package/components/textarea.css +42 -0
  42. package/components/toolbar.css +68 -0
  43. package/components/tooltip.css +23 -0
  44. package/components/transfer-list.css +74 -0
  45. package/components/virtual-canvas.css +45 -0
  46. package/components/virtual-scroller.css +7 -0
  47. package/components.css +45 -0
  48. package/css-components/button.css +99 -0
  49. package/css-components/card.css +14 -0
  50. package/css-components/chip-group.css +9 -0
  51. package/css-components/chip.css +109 -0
  52. package/css-components/disclosure.css +34 -0
  53. package/css-components/list.css +34 -0
  54. package/css-components/select.css +19 -0
  55. package/css-components/textarea.css +22 -0
  56. package/css-components.css +31 -0
  57. package/defaults.css +169 -0
  58. package/native.css +271 -0
  59. package/package.json +51 -7
  60. package/theme.css +3 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,185 @@
1
+ # @rcarls/rc-theme-win31
2
+
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 19278d4: Group several native controls into one `rc-field` with a direct `<fieldset>`. Its `<legend>` names
8
+ the group and shows as the field label, each control keeps its own accessible name, and supporting
9
+ text describes the fieldset. The first text-like input or textarea is the primary control behind
10
+ `control`, `focus()`, and `data-populated`; focus moving between grouped controls keeps the field
11
+ focused; and `data-disabled`, `data-required`, and `data-invalid` reflect the whole group. New
12
+ read-only `group` and `controls` properties and a `data-group` host attribute support the mode.
13
+
14
+ The primary control grows and other controls attach before or after it. In Material, the legend uses
15
+ the floating label mechanics: it rests on the input line while the group is idle and its primary
16
+ input empty, and floats on focus or once that input has a value; a group with a control before its
17
+ primary input keeps it floated. Grouped placeholders wait for focus. Substrate colors an invalid
18
+ group's legend, and Win31 spaces it like a single field's label.
19
+
20
+ - 873592e: Add four directional motion tokens to the shared base contract:
21
+ `--rc-motion-effects-easing-enter`/`-exit` and
22
+ `--rc-motion-spatial-easing-enter`/`-exit`. An opening element decelerates
23
+ into place; a closing one accelerates out. There are no matching enter/exit
24
+ duration tokens; pair `-easing-exit` with an existing `-duration-fast` token
25
+ instead.
26
+
27
+ All three themes map the new tokens: Material pairs them with its
28
+ standard/emphasized decelerate and accelerate curves, Substrate keeps its one
29
+ curve as the enter curve and adds a generic accelerate shape for exit
30
+ (refined further once Substrate gets its own full spatial/effects scale), and
31
+ `rc-theme-win31` declares all four as `step-end`, matching its zero-motion
32
+ contract, so an application that loads the shared base tokens alongside
33
+ `rc-theme-win31` does not inherit the base defaults' real easing curves for
34
+ these two directions.
35
+
36
+ - c62d107: Let opt-in native theme styles reach consumer controls inside RC containers while
37
+ component recipes retain their themed presentation. Apply the same presentation
38
+ boundary and `data-rc-native="off"` subtree opt-out in Material, Substrate, and
39
+ Windows 3.1.
40
+
41
+ Native controls inside an RC host may now gain theme styling when that host does
42
+ not provide their appearance. Add `data-rc-native="off"` to content that should
43
+ keep its own styles, such as a third-party widget.
44
+
45
+ - 622c5c9: Add independent opt-in `native.css` and CSS-only `css-components.css` entrypoints to the
46
+ Material, Substrate, and Windows 3.1 themes. Native controls can use the theme presentation
47
+ without registration, while documented class recipes style common HTML controls and static
48
+ card, list, chip-group, and disclosure markup without changing behavior.
49
+
50
+ Native styles stop at RC controls that own their native children. Add
51
+ `data-rc-native="off"` to an element to keep native styles off it and its subtree.
52
+
53
+ - 687a9be: Add shared popup surface tokens: `--rc-popup-background`, `--rc-popup-color`,
54
+ `--rc-popup-border`, `--rc-popup-radius`, `--rc-popup-shadow`, and
55
+ `--rc-popup-padding-block`. Menus, adaptive-menu popups, and select and
56
+ combobox listboxes read them before their own fallbacks. Themes set them at the
57
+ theme root, so popups rendered inside other shadow roots keep the theme's
58
+ surface. Select and combobox add `--rc-*-listbox-background` and
59
+ `--rc-*-listbox-color`.
60
+
61
+ Breaking: popup surfaces no longer fall back to `--rc-control-radius`. Set
62
+ `--rc-popup-radius` (or the per-component radius token) to change popup
63
+ corners. The Material, Substrate, and Win31 themes no longer set per-component
64
+ popup surface tokens such as `--rc-menu-radius` or
65
+ `--rc-adaptive-menu-popup-background`; override the `--rc-popup-*` tokens
66
+ instead. Material select and combobox listboxes now use the menu container
67
+ color, Material forced-colors popups gain a border, and Substrate listboxes use
68
+ the menu shadow and padding. Material retains its two-layer adaptive-menu popup
69
+ shadow through a component token while other popups continue using the shared
70
+ shadow.
71
+
72
+ - 6d126fd: Add shared item type tokens: `--rc-item-font-family`, `--rc-item-font-size`,
73
+ `--rc-item-font-weight`, `--rc-item-line-height`, `--rc-item-letter-spacing`,
74
+ and `--rc-item-icon-size`. Menu, listbox, and adaptive-menu items read them.
75
+ Adaptive menu adds `--rc-adaptive-menu-trigger-hover-background`,
76
+ `--rc-adaptive-menu-trigger-shadow`, and
77
+ `--rc-adaptive-menu-trigger-active-shadow`, and styles overflowed `rc-button`
78
+ and `rc-menu-button` rows from its item tokens. Themes declare their menu,
79
+ adaptive-menu, and item tokens on the theme root, so menus inside other shadow
80
+ roots match menus in the document. Substrate's adaptive-menu trigger now shows
81
+ its hover background.
82
+
83
+ Breaking: theme menu and adaptive-menu tokens are inherited from the theme root
84
+ instead of set on each element, so a value set on an ancestor now reaches
85
+ nested menus. Material sets menu, listbox, and adaptive-menu item type through
86
+ `--rc-item-*` instead of per-component rules; override those tokens to change
87
+ item type. Themes no longer style the adaptive-menu trigger through
88
+ `::part(overflow-trigger)` hover and pressed rules; use the new trigger tokens.
89
+
90
+ - fb747f6: Declare `rc-base` before each theme's own layers. Components inject their structural
91
+ light-DOM CSS into `rc-base` at runtime, after the theme has loaded, which made it the last
92
+ and strongest layer on pages that don't declare their own order, so it could override theme
93
+ rules. Theme rules now win either way. Apps that declare their own layer order should list
94
+ `rc-base` before the theme layers.
95
+
96
+ Add a fourth theme layer, `rc-theme-*.overrides`, after `.components`. Each theme uses it to
97
+ keep `rc-adaptive-menu` overflow rows on the menu's item tokens. Theme button and menu-button
98
+ variants, such as Material's icon-only sizing and filled colors or Win31's bevelled native
99
+ buttons, no longer restyle an overflowed action as a standalone control. A demoted
100
+ icon-only `rc-menu-button` keeps its row padding and indicator inset.
101
+
102
+ - 58f4e71: `rc-theme-substrate` and `rc-theme-win31` now map the full shared
103
+ spatial/effects motion scale that `rc-theme-material` already implements,
104
+ closing a gap where each declared only its own single compatibility duration.
105
+
106
+ Substrate adds a small, quicker scale of its own: 100/160/240&nbsp;ms for
107
+ effects and 160/240/320&nbsp;ms for spatial, with its existing single easing
108
+ curve as the spatial curve (it is already decelerate-shaped) and `ease-out`
109
+ for effects. The compatibility token now follows the effects default rather
110
+ than its own literal, matching the shared base contract's own convention.
111
+ The one remaining hardcoded duration, `rc-list-item`'s 100&nbsp;ms row
112
+ transition, now reads from the effects-fast token. Substrate's
113
+ `prefers-reduced-motion` override moves from the bridge layer into
114
+ `components/modes.css`, in the components layer, matching where the other
115
+ two themes keep their mode overrides; a cascade layer test now proves the
116
+ later layer's override wins rather than assuming it.
117
+
118
+ win31 declares all thirteen shared tokens, plus the four directional ones
119
+ added last release, at zero duration with `step-end` easing. Previously only
120
+ the single compatibility token was set, so an application loading the shared
121
+ base tokens alongside this theme inherited base's real 180/300/450&nbsp;ms
122
+ spatial motion for every other token in the scale, silently contradicting the
123
+ theme's own zero-motion contract. `rc-chip`'s existing zero-duration override
124
+ gets its matching `step-end` easing token.
125
+
126
+ Verifying that claim surfaced a limit worth knowing about even after this
127
+ fix: it holds only when the theme class is applied to a container, the
128
+ documented pattern, not to `<html>`. The shared `base.css` declares no cascade
129
+ layer, so its `:root` values outrank any theme layer whenever both target the
130
+ same element, which happens only when the theme class sits on `<html>` itself.
131
+ No theme package can fix this by declaring more tokens; see the styling guide
132
+ for details.
133
+
134
+ - 0deda8a: Theme `rc-popover` and `rc-tooltip`. Tooltips, which Windows 3.1 did not have,
135
+ borrow its WinHelp definition popup: a white box with a hard one-pixel frame and
136
+ drop shadow. Popovers keep the theme's menu panel with panel spacing. Both sets
137
+ of tokens sit on the theme root, so surfaces inside other shadow roots inherit
138
+ them.
139
+ - 322d875: Add a Windows 3.1 era theme package with full component coverage.
140
+
141
+ `@rcarls/rc-theme-win31` maps a period `--win31-*` token layer onto the public
142
+ `--rc-*` contract and ships one stylesheet per component, matching the coverage
143
+ of the existing themes. Metrics derive from the MS Sans Serif 8pt cell and scale
144
+ from a single `--win31-unit` token, so the theme can be doubled without any
145
+ proportion changing.
146
+
147
+ The theme is light only, has no hover states outside menus, treats disabled as a
148
+ color rather than an opacity, draws focus and selection as separate marks, and
149
+ yields entirely under forced colors.
150
+
151
+ ### Patch Changes
152
+
153
+ - fef89dc: Move the segmented appearance into the component behind one switch.
154
+
155
+ Turning the native fieldset into a segmented control took 27 `--_rc-*`
156
+ declarations that every theme had to restate, 23 of them byte-identical. Two of
157
+ those blocks were accessibility recipes rather than taste: the visually hidden
158
+ legend that keeps the group's accessible name, and the hidden but focusable
159
+ radio. A theme that got either wrong removed the accessible name or made the
160
+ control unreachable by keyboard.
161
+
162
+ The component now owns the recipe and a theme sets
163
+ `--rc-segmented-button-appearance: segmented`. Four genuine theme choices become
164
+ public properties: `--rc-segmented-button-cursor`,
165
+ `--rc-segmented-button-disabled-cursor`,
166
+ `--rc-segmented-button-vertical-divider`, and
167
+ `--rc-segmented-button-selected-icon-display`.
168
+
169
+ Unset, the fieldset, legend, and radios keep their browser appearance, as
170
+ before. The switch is read with a style container query (Chrome 111, Safari 18,
171
+ Firefox 128); where that is unsupported the recipe does not apply and the
172
+ control falls back to the same native appearance.
173
+
174
+ To migrate a theme, replace its `--_rc-segmented-button-*` block with the single
175
+ `--rc-segmented-button-appearance: segmented` declaration, plus any of the four
176
+ public properties whose value differs from the default.
177
+
178
+ - edfd374: Icon slots keep their square while empty. An SVG icon element such as
179
+ `<iconify-icon>` draws a frame after it mounts, so swapping one in, such as a
180
+ filter chip's check, no longer collapses the slot and shifts the row for a
181
+ frame. Icon-font glyphs already fill 1em and render the same.
182
+ - 50687d3: Publish a Windows 3.1 design guide with checked theme values and composition
183
+ guidance. Align the push-button minimum with the documented dialog-unit size,
184
+ let dithered surfaces follow palette overrides, and correct the default-button
185
+ example.
package/DESIGN.md ADDED
@@ -0,0 +1,195 @@
1
+ ---
2
+ version: windows-3.1-ctl3d-inspired
3
+ name: rc-theme-win31
4
+ description: >
5
+ Composition guide for Windows 3.1-era applications built with
6
+ rc-webcomponents and the rc-theme-win31 CSS theme. Values describe the
7
+ package's shipped baseline; historical measurements are identified below.
8
+ colors:
9
+ surface: '#c0c0c0'
10
+ highlight: '#ffffff'
11
+ shadow: '#808080'
12
+ shadow-dark: '#404040'
13
+ frame: '#000000'
14
+ field: '#ffffff'
15
+ field-text: '#000000'
16
+ menu: '#c0c0c0'
17
+ menu-text: '#000000'
18
+ selection: '#000080'
19
+ selection-text: '#ffffff'
20
+ title-active: '#000080'
21
+ title-active-text: '#ffffff'
22
+ title-inactive: '#808080'
23
+ title-inactive-text: '#c0c0c0'
24
+ desktop: '#008080'
25
+ typography:
26
+ family: 'Microsoft Sans Serif, MS Sans Serif, Tahoma, Segoe UI, sans-serif'
27
+ body-size: 13px
28
+ menu-size: 16px
29
+ title-size: 16px
30
+ geometry:
31
+ unit: 1px
32
+ control-height: 23px
33
+ title-height: 24px
34
+ menu-height: 27px
35
+ toolbar-height: 31px
36
+ toolbar-button-size: 27px
37
+ listbox-row-height: 17px
38
+ scrollbar-size: 16px
39
+ check-size: 13px
40
+ gap: 4px
41
+ components:
42
+ button:
43
+ surface: '{colors.surface}'
44
+ text: '{colors.frame}'
45
+ minHeight: '{geometry.control-height}'
46
+ dialog:
47
+ surface: '{colors.surface}'
48
+ title: '{colors.title-active}'
49
+ captionHeight: '{geometry.title-height}'
50
+ listbox:
51
+ surface: '{colors.field}'
52
+ selection: '{colors.selection}'
53
+ rowHeight: '{geometry.listbox-row-height}'
54
+ scrollbar:
55
+ size: '{geometry.scrollbar-size}'
56
+ ---
57
+
58
+ # rc-theme-win31 design guide
59
+
60
+ This guide helps people and coding agents compose an application with
61
+ `@rcarls/rc-theme-win31`. It describes the shipped Windows 3.1-era appearance,
62
+ its component contracts, and the points where web rendering is an approximation.
63
+ The [component documentation](https://richardcarls.github.io/rc-webcomponents/)
64
+ remains the reference for individual attributes and events.
65
+
66
+ ## Historical target and evidence
67
+
68
+ The theme uses square geometry, bitmap-like marks, hard shadows, and an optional
69
+ beveled control treatment associated with applications using CTL3D. The 1992
70
+ [_Windows Interface: An Application Design Guide_](https://books.google.com/books/about/The_Windows_Interface.html?id=ONBQAAAAYAAJ)
71
+ is the period design reference. Microsoft's
72
+ [dialog-unit conversion](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-mapdialogrect)
73
+ explains why pixel dimensions depend on the dialog font. The measurements in
74
+ this package are a 96 DPI, 8 pt MS Sans Serif approximation, not a claim that
75
+ every Windows 3.1 application rendered at one pixel size.
76
+
77
+ [Shell.css](https://zachhall.org/shell-css/) and
78
+ [Web31](https://github.com/Futur3Sn0w/web31) are useful independent web
79
+ recreations for visual comparison. Their assets, palette choices, and window
80
+ manager behavior are not specifications for this component theme. The
81
+ originator `stars` application uses its own sampled game palette, including a
82
+ light-blue title; those values belong to an application override, not this
83
+ package's baseline.
84
+
85
+ ## Compose an application
86
+
87
+ Import the complete theme and place its scope on the application root. Put the
88
+ scope on `<html>` when native dialogs or popovers may enter the top layer.
89
+
90
+ ```css
91
+ @import '@rcarls/rc-theme-win31/theme.css';
92
+ ```
93
+
94
+ ```html
95
+ <html class="rc-theme-win31" lang="en">
96
+ <!-- Application content -->
97
+ </html>
98
+ ```
99
+
100
+ For selective loading, import `defaults.css`, then `bridge.css`, then the
101
+ needed `components/*.css` files. `defaults.css` owns the `--win31-*` tokens;
102
+ the bridge maps them to shared `--rc-*` semantics. App styles outside a cascade
103
+ layer override the theme's layered styles. Use public tokens and documented
104
+ parts or markers; `--_rc-*` tokens and controller markers are internal.
105
+
106
+ Use consumer-authored native controls where a component requires them. An
107
+ `rc-button` contains a `<button>`; an `rc-dialog` contains a `<dialog>`; a
108
+ `rc-disclosure` contains `<details>`. Keep native IDs, names, labels, and form
109
+ behavior on those children. The theme changes presentation, not keyboard or
110
+ ARIA behavior.
111
+
112
+ ## Apply color and typography
113
+
114
+ The baseline palette in the front matter is the package's current reference
115
+ scheme. Pair `--win31-color-selection` with
116
+ `--win31-color-selection-text`, and each title background with its title-text
117
+ partner. Keep the field and field-text pair legible. The desktop color is an
118
+ application canvas choice, not an instruction to paint every page teal.
119
+
120
+ Windows 3.1 exposed system color schemes rather than an automatic dark mode.
121
+ Override the `--win31-color-*` roles together on `.rc-theme-win31`. The dither
122
+ and arrow/check SVG tokens are separate image assets: an alternate palette may
123
+ also need `--win31-dither-track` and `--win31-glyph-*` overrides for contrast.
124
+ Test the result with actual controls, selected rows, a dialog, and scrollbars.
125
+ The baseline glyphs are black. The dither follows `--win31-color-surface`,
126
+ while color tokens alone do not recolor the glyph image assets.
127
+
128
+ ```css
129
+ .rc-theme-win31.stars-like {
130
+ --win31-color-surface: #c3c3c3;
131
+ --win31-color-shadow: #828282;
132
+ --win31-color-title-active: #a6cbf3;
133
+ --win31-color-title-active-text: #000000;
134
+ }
135
+ ```
136
+
137
+ This example illustrates the originator application's palette difference; it
138
+ is not a named Windows system scheme. The font stack prefers MS Sans Serif but
139
+ does not ship Microsoft's bitmap font. Later system sans faces preserve
140
+ usability while changing glyph widths and rendering.
141
+
142
+ ## Build period-style chrome
143
+
144
+ - Use one active caption bar per window, with centered caption text and an
145
+ authored system-menu button when the action is real. `rc-dialog` styles a
146
+ direct native `<dialog>` child with an authored `<header>` and `<footer>`.
147
+ - Put the default-button marker on `rc-button`, while keeping the actual
148
+ `<button>` as its direct child. The marker supplies a second frame; the native
149
+ button still owns its action and focus.
150
+ - Compose menus, toolbars, listboxes, fields, and scrollbars as dense rectangular
151
+ regions. Use the `--win31-unit` scale for a uniformly larger interface, and
152
+ choose layout breakpoints in the application rather than the theme.
153
+ - Show focus and selection independently. The dotted focus outline can coexist
154
+ with an inverse selected row. Do not substitute hover styling for either.
155
+ - Preserve the disabled embossed treatment and pressed bevel reversal. The
156
+ theme has no general button or list-row hover treatment and no motion.
157
+
158
+ ```html
159
+ <rc-dialog movable move-handle="header">
160
+ <dialog aria-labelledby="save-title">
161
+ <header>
162
+ <h2 id="save-title">Save Changes</h2>
163
+ </header>
164
+ <p>Save changes before closing?</p>
165
+ <footer>
166
+ <rc-button data-rc-win31-default><button type="button">OK</button></rc-button>
167
+ <rc-button><button type="button">Cancel</button></rc-button>
168
+ </footer>
169
+ </dialog>
170
+ </rc-dialog>
171
+ ```
172
+
173
+ The authored system-menu control needs a real menu action if shown. For a
174
+ simple confirmation dialog, omit it. Use `data-rc-win31-inactive` on
175
+ `rc-app-bar` only for an inactive caption, and `data-rc-win31-toggle` on
176
+ `rc-switch` only when its optional sliding treatment suits the application.
177
+ The default switch treatment resembles a checkbox.
178
+
179
+ ## Respect platform limits
180
+
181
+ Browser-rendered text and native form internals will not match a 1992 bitmap
182
+ display pixel for pixel. Detailed scrollbar chrome works in Chromium and
183
+ WebKit; Firefox receives a two-color standard scrollbar. In forced colors the
184
+ theme yields to system colors and removes decorative bevels. Do not restore
185
+ custom palette colors inside that mode.
186
+
187
+ `rc-fab`, `rc-fab-menu`, and several navigation or carousel patterns have no
188
+ Windows 3.1 equivalent. Their styles keep a themed app visually coherent but
189
+ do not make them period patterns. Prefer menu commands and toolbars when the
190
+ application is meant to resemble a contemporary Windows 3.1 program.
191
+
192
+ Tooltips did not exist in Windows 3.1 either. `rc-tooltip` borrows the WinHelp
193
+ definition popup instead: a white box with a hard one-pixel frame and drop
194
+ shadow. `rc-popover` uses the same menu panel as other popups, with panel
195
+ spacing.
package/README.md CHANGED
@@ -1,8 +1,160 @@
1
1
  # @rcarls/rc-theme-win31
2
2
 
3
- This version (`0.0.0`) is a placeholder, published only to register this package name on
4
- npm so a Trusted Publisher can be configured for it before any real release. It contains no code.
3
+ Windows 3.1 era CSS theme and token bridge for
4
+ [rc-webcomponents](https://github.com/richardcarls/rc-webcomponents).
5
5
 
6
- Do not install or depend on this version. The real package ships in a later version, published
7
- automatically through this repository's normal release pipeline once Trusted Publishing is
8
- configured.
6
+ Beveled, square, motionless chrome, as Windows 3.1 looked to applications that
7
+ linked `CTL3D`. Styling only: no component behavior changes.
8
+
9
+ ```sh
10
+ npm install @rcarls/rc-theme-win31
11
+ ```
12
+
13
+ ```css
14
+ @import '@rcarls/rc-theme-win31/theme.css';
15
+ ```
16
+
17
+ ```html
18
+ <div class="rc-theme-win31">
19
+ <rc-select>...</rc-select>
20
+ <rc-dialog>...</rc-dialog>
21
+ </div>
22
+ ```
23
+
24
+ ## Token layers
25
+
26
+ `theme.css` composes three files, in this order:
27
+
28
+ | File | Owns |
29
+ | ---------------- | ----------------------------------------------------------- |
30
+ | `defaults.css` | The `--win31-*` reference tokens: palette, metrics, glyphs |
31
+ | `bridge.css` | The mapping from `--win31-*` onto the public `--rc-*` layer |
32
+ | `components.css` | Per-component chrome, one stylesheet per component |
33
+
34
+ Component stylesheets read the `--win31-*` tokens with no literal fallbacks, so
35
+ a value lives in exactly one place and cannot drift between the token layer and
36
+ thirty-nine component sheets. Import `defaults.css` before any selective import,
37
+ or supply the `--win31-*` set yourself.
38
+
39
+ ```css
40
+ @import '@rcarls/rc-theme-win31/defaults.css';
41
+ @import '@rcarls/rc-theme-win31/bridge.css';
42
+ @import '@rcarls/rc-theme-win31/components/button.css';
43
+ ```
44
+
45
+ Native HTML can opt into the period presentation without registering an RC
46
+ element. Import the defaults and bridge when needed, then add the independent
47
+ native and CSS-only layers:
48
+
49
+ ```css
50
+ @import '@rcarls/rc-theme-win31/defaults.css';
51
+ @import '@rcarls/rc-theme-win31/bridge.css';
52
+ @import '@rcarls/rc-theme-win31/native.css';
53
+ @import '@rcarls/rc-theme-win31/css-components.css';
54
+ ```
55
+
56
+ `native.css` is an optional convenience layer for styling ordinary buttons,
57
+ text fields, selects, textareas, checkboxes, radios, ranges, and progress
58
+ controls throughout `.rc-theme-win31`. Component recipes style native children
59
+ when their presentation belongs to a themed menu, toolbar, or other component
60
+ context. Add `data-rc-native="off"` to an element to opt it and its descendants
61
+ out of the native layer. The
62
+ opt-in `css-components.css` recipes cover `.rc-button`, `.rc-chip`,
63
+ `.rc-chip-group`, `.rc-select`, `.rc-textarea`, `.rc-card`, `.rc-list`, and
64
+ `details.rc-disclosure`; each is also exported as
65
+ `css-components/<name>.css`. They provide appearance and CSS-visible states
66
+ only, not behavior, events, popup replacement, or measured overflow.
67
+
68
+ ## Scaling
69
+
70
+ Every metric is a multiple of one token, so the whole theme scales without any
71
+ proportion changing. This is the bitmap-interface answer to responsive sizing.
72
+
73
+ ```css
74
+ .rc-theme-win31 {
75
+ --win31-unit: 2px;
76
+ }
77
+ ```
78
+
79
+ ## What is deliberate
80
+
81
+ - **Light only.** Windows 3.1 had no dark mode. It had user-selectable
82
+ whole-system color schemes instead. Override the `--win31-color-*` roles as
83
+ a set; the dither follows the surface token, while the baseline glyph SVGs
84
+ remain black and may need replacement for a contrasting scheme. Named period
85
+ schemes are not shipped without verified values.
86
+ - **No hover states**, except on menus. That is period-correct and it does
87
+ surprise people. Push buttons and list rows are identical at rest and under
88
+ the pointer. The upside is that every affordance is legible without a pointer,
89
+ which is what touch and keyboard users need anyway.
90
+ - **Disabled is a color, not an opacity.** 3.1 had no alpha channel, so it
91
+ embossed disabled text: gray with a one-pixel highlight beneath. WCAG exempts
92
+ inactive controls from the contrast minimum, so the period treatment stands.
93
+ - **Focus and selection are separate marks.** A list can hold a selected row
94
+ that is not the focused row, so the dotted focus rectangle is drawn in
95
+ addition to the inverse-video selection, and turns white inside it.
96
+ - **It disappears under forced colors.** Every bevel is an inset shadow, a
97
+ four-value `border-color`, or a dither image, and High Contrast removes all
98
+ three. The theme yields completely. The result is closer to stock, pre-`CTL3D`
99
+ Windows 3.1 than the beveled default is.
100
+ - **Scrollbar chrome is Chromium and WebKit only.** Firefox exposes only
101
+ `scrollbar-width` and `scrollbar-color`, so it gets a two-color fallback.
102
+ - **`rc-fab` and `rc-fab-menu` are knowing anachronisms.** Windows 3.1 had no
103
+ floating action button and nothing that would have produced one. They are
104
+ drawn as floating tool-palette buttons so a themed page has no unstyled
105
+ holes.
106
+
107
+ ## Window chrome
108
+
109
+ `rc-dialog` keeps the native `<dialog>` in consumer light DOM, so the caption
110
+ bar is your markup. The theme styles the shape the component already contracts
111
+ on through `move-handle`:
112
+
113
+ ```html
114
+ <rc-dialog movable move-handle="header">
115
+ <dialog aria-labelledby="save-title">
116
+ <header>
117
+ <h2 id="save-title">Save Changes</h2>
118
+ </header>
119
+ <p>Save changes before closing?</p>
120
+ <footer>
121
+ <rc-button data-rc-win31-default><button>OK</button></rc-button>
122
+ <rc-button><button>Cancel</button></rc-button>
123
+ </footer>
124
+ </dialog>
125
+ </rc-dialog>
126
+ ```
127
+
128
+ ## Theme markers
129
+
130
+ Three authored markers are public API for this theme:
131
+
132
+ | Marker | Applies to | Effect |
133
+ | ------------------------ | ------------ | ---------------------------------------------- |
134
+ | `data-rc-win31-default` | `rc-button` | The heavier frame of a dialog's default button |
135
+ | `data-rc-win31-toggle` | `rc-switch` | The sliding variant instead of the checkbox |
136
+ | `data-rc-win31-inactive` | `rc-app-bar` | The muted inactive caption pair |
137
+
138
+ ## Fonts
139
+
140
+ MS Sans Serif is a Microsoft bitmap face and is not redistributed here. The
141
+ stack falls back through `Tahoma` and the system sans, so type is
142
+ metric-adjacent rather than pixel-exact.
143
+
144
+ ## Notice
145
+
146
+ Not affiliated with or endorsed by Microsoft. Windows is a trademark of
147
+ Microsoft Corporation. No Microsoft fonts, bitmaps, or icons are redistributed;
148
+ every glyph in this package is redrawn as SVG or CSS.
149
+
150
+ ## Documentation
151
+
152
+ - [`DESIGN.md`](./DESIGN.md) gives composition guidance, historical sources,
153
+ and the limits of the web recreation. It ships as
154
+ `@rcarls/rc-theme-win31/DESIGN.md` for package-aware tools.
155
+ - [Theme previews](https://richardcarls.github.io/rc-webcomponents/guide/theme-previews)
156
+ - [Styling guide](https://richardcarls.github.io/rc-webcomponents/guide/styling)
157
+
158
+ ## License
159
+
160
+ MIT