@spicainternational/forge-styles 0.0.0-stage → 0.2.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.
- package/CHANGELOG.md +83 -0
- package/README.md +128 -2
- package/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/fonts/inter-cyrillic.woff2 +0 -0
- package/fonts/inter-greek-ext.woff2 +0 -0
- package/fonts/inter-greek.woff2 +0 -0
- package/fonts/inter-latin-ext.woff2 +0 -0
- package/fonts/inter-latin.woff2 +0 -0
- package/fonts/inter-vietnamese.woff2 +0 -0
- package/fonts/roboto-mono-cyrillic-ext.woff2 +0 -0
- package/fonts/roboto-mono-cyrillic.woff2 +0 -0
- package/fonts/roboto-mono-greek.woff2 +0 -0
- package/fonts/roboto-mono-latin-ext.woff2 +0 -0
- package/fonts/roboto-mono-latin.woff2 +0 -0
- package/fonts/roboto-mono-vietnamese.woff2 +0 -0
- package/forge-tokens.css +372 -0
- package/forge-tokens.json +185 -0
- package/forge.css +3726 -0
- package/package.json +33 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.2.0] - 2026-12-03
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Selected tokens, the brand tint of the current or chosen item: `--forge-selected-tint` (16%),
|
|
8
|
+
`--forge-selected-tint-hover` (24%), `--forge-selected-bg` and `--forge-selected-bg-hover` (the brand at those
|
|
9
|
+
percentages mixed into `--forge-surface-container-lowest`, opaque) and `--forge-selected-text`.
|
|
10
|
+
- `.forge-group-label`, the label of a group of items in a list or menu: 12px uppercase, medium weight, primary
|
|
11
|
+
color, 16px line, with the new `--forge-letter-spacing-caps` (`0.03em`) so capitals don't read squashed.
|
|
12
|
+
- `components/app-switcher.css`: the app switcher's discover preview Markdown (`.forge-app-switcher-flyout-text`)
|
|
13
|
+
at body size, paragraphs and lists alike, with its block spacing.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- A `<p>` is body text: forge.css no longer gives paragraphs the long-form size (16px), so they take the size around
|
|
18
|
+
them, 14px in the UI, like the lists next to them. Long-form reading opts in with `.forge-content`, which now uses
|
|
19
|
+
`--forge-content-base` and `--forge-content-line-height` for everything inside.
|
|
20
|
+
- `.forge-eyebrow` has a 16px line (`1rem`, was 1.5, 18px at 12px), on the 4px grid.
|
|
21
|
+
- `.forge-field-label` has a 20px line (`1.25rem`, was the body's 22.4px), on the 4px grid. A `<label>` without a
|
|
22
|
+
class is in the primary text color (was secondary), like a field label.
|
|
23
|
+
- Body text has a 1.6 line height (22.4px at 14px, was 1.5) and `-0.01em` letter-spacing, through the new
|
|
24
|
+
`--forge-line-height-body` and `--forge-letter-spacing-body`. Code (`pre`, `code`, `kbd`, `samp`) keeps the mono
|
|
25
|
+
font's own spacing. Components whose text inherits the body line height grow by about 1px per line. Table cells
|
|
26
|
+
(`th`, `td`) take `--forge-line-height-snug` (1.35) instead, so tables get more compact than before. Checkbox,
|
|
27
|
+
radio and switch labels (`.forge-check`) keep a 20px line, so the text stays centered on the input.
|
|
28
|
+
- The page's top row lines up with the side bar's: a `.forge-page-top` pads 8px above and none below (was 12px both),
|
|
29
|
+
so the first page header starts 16px from the window's top, as the content does from the side, and sits 16px above
|
|
30
|
+
the content (the body's padding; was 28px), as a page header inside the body does. `.forge-page-bottom` pads 8px
|
|
31
|
+
(was 12px), 16px from the window's bottom. The card appearance takes the page's 8px gap as its margin on every
|
|
32
|
+
side (was 16px top and start, 8px end and bottom). Product home in forge-angular moves its logo to match.
|
|
33
|
+
- Same role, same size:
|
|
34
|
+
- `.forge-linkref` has a field's corners, `--forge-radius-sm` (was md), as `.forge-input`.
|
|
35
|
+
- The callout's close button has `.forge-icon-button`'s corners, `--forge-radius-md` (was sm), and its focus ring
|
|
36
|
+
sits 2px off it (was 1px).
|
|
37
|
+
- A disabled `.forge-chip` is drawn at `--forge-opacity-disabled` without hover (it had no disabled style).
|
|
38
|
+
- Disabled menu items, tabs and select options show the `not-allowed` cursor (was `default`), as buttons do.
|
|
39
|
+
- `.forge-skeleton--button` is as tall as a button (`--forge-control-height-md`, 36px, was 32px) with its sm
|
|
40
|
+
corners (was md); `.forge-skeleton--avatar` is 2rem, forge-avatar's default (same size, no raw px).
|
|
41
|
+
- The danger button's fill is darkened to L 0.57, as the danger badge's (was 0.58).
|
|
42
|
+
- The callout close button's hover takes the hover layer's 8% of its text color (was 12%).
|
|
43
|
+
- Focus rings: the legacy table-actions dropdown item draws an inset outline (was a `box-shadow` ring, which
|
|
44
|
+
forced colors drop); `.forge-tag-remove`'s ring is inset at -2px in the strong ring color (was at 0); the
|
|
45
|
+
callout link's ring takes `--forge-radius-sm` corners (was 2px).
|
|
46
|
+
- The pressed `.forge-chip` and the active `.forge-filter-pill` take the selected tokens. Their text is a little darker
|
|
47
|
+
(the brand mixed 70% instead of 75% toward the primary text): it was 4.4:1 on the hovered tint over white, now at
|
|
48
|
+
least 4.5:1.
|
|
49
|
+
- Headings have a line height on the 4px grid for each size (28/36, 24/32, 20/28, 16/24, 14/20) instead of 1.25:
|
|
50
|
+
`--forge-heading-line-height` is the heading's size plus 6px, rounded up to 4px, so it follows any size override.
|
|
51
|
+
`.forge-page-title`, `.forge-section-title` and `.forge-subsection-title` take it too. Browsers without CSS `round()`
|
|
52
|
+
keep 1.25.
|
|
53
|
+
|
|
54
|
+
## [0.1.0] - 2026-11-27
|
|
55
|
+
|
|
56
|
+
First release. `forge.css` (tokens, light and dark themes, reset, base, layout, components, utilities) and its fonts
|
|
57
|
+
(Inter, Roboto Mono), until now copied by hand from the showcase.
|
|
58
|
+
|
|
59
|
+
- `forge-tokens.css`: the tokens alone (the `forge-tokens` and `forge-theme` layers).
|
|
60
|
+
- `forge-tokens.json`: the tokens as data, `{ source, root, dark }` (until now shipped by forge-devextreme).
|
|
61
|
+
- The callout's styles (`.forge-callout`, `--caution`, `--critical` and its parts), the first component in the
|
|
62
|
+
package; the markup is in the README.
|
|
63
|
+
- The secondary button is gray with no border: rest `--forge-surface-container`, hover a ghost button's hover on the
|
|
64
|
+
page (`--forge-surface-container-highest` in light, `-high` in dark, set by the dark theme).
|
|
65
|
+
`--forge-button-secondary-bg` and `--forge-button-secondary-bg-hover` retune it for a context; `.forge-inset` rests
|
|
66
|
+
it on `-high` and hovers it to `-highest`, `.forge-overlay-content` hovers it to `-highest`.
|
|
67
|
+
- Native select (`select.forge-input`): the library's chevron (Font Awesome regular chevron-down, 12px) instead of
|
|
68
|
+
the system arrow, in every browser (`--forge-select-chevron`, a light and a dark copy). In Chromium 135+
|
|
69
|
+
(`appearance: base-select`) the picker is a Forge overlay with menu rows, a primary checkmark on the selected option,
|
|
70
|
+
opening below and flipping above when it doesn't fit (max 16rem). Firefox and Safari keep the system picker. List
|
|
71
|
+
boxes (`multiple`, `size`) mark selected rows with a primary tint.
|
|
72
|
+
- The icon beside a button's label is `--forge-icon-sm` (14px) in both sizes, until now `1em` of the font size: the
|
|
73
|
+
same in a default button, 2px larger in a small one (`--sm`, was 12px).
|
|
74
|
+
- The icon-only button (`.forge-button--icon`) is a square the size of `.forge-icon-button`: 28px
|
|
75
|
+
(`--forge-icon-button-md`), 22px with `--sm` (`--forge-icon-button-sm`), no padding. It kept a label's 12px side
|
|
76
|
+
padding and took about 40px by 27px, too wide for a row's actions.
|
|
77
|
+
- A Font Awesome icon (`fa-icon`) now takes its component's icon token. Its svg stayed `1em` of the font size, Font
|
|
78
|
+
Awesome's own CSS winning over the component's: the icon button's icon was 14px, now `--forge-icon-md` (16px), the
|
|
79
|
+
pill's 12px, now `--forge-icon-sm` (14px), the list link's 14px, now `--forge-icon-lg` (20px).
|
|
80
|
+
- The `forge-dx-hacks` layer moved to `@spicainternational/forge-devextreme` (`css/forge-dx.css`); the layer keeps its
|
|
81
|
+
place in the order statement.
|
|
82
|
+
- The table actions panel (`.forge-table-actions-panel`, its deprecated `.dropdown-item` and `.dropdown-divider`
|
|
83
|
+
items) and the open row in the legacy SDS table, moved here from forge-angular's component styles (`::ng-deep`).
|
package/README.md
CHANGED
|
@@ -1,3 +1,129 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @spicainternational/forge-styles
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Forge design system's styles, for any app: Angular, React or plain HTML.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm install @spicainternational/forge-styles
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## What's in the package
|
|
10
|
+
|
|
11
|
+
| File | Contents | For |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| `forge.css` | everything: tokens, light and dark themes, reset, base, layout, components, utilities, fonts | every app |
|
|
14
|
+
| `forge-tokens.css` | the `@layer` order statement plus the `forge-tokens` and `forge-theme` layers | apps with their own components that want Forge colors, spacing and type |
|
|
15
|
+
| `forge-tokens.json` | the tokens as data (below) | tools, CSS-in-JS, charts; `@spicainternational/forge-devextreme` |
|
|
16
|
+
| `fonts/` | Inter and Roboto Mono (SIL Open Font License), which `forge.css` declares | – |
|
|
17
|
+
|
|
18
|
+
## Using it
|
|
19
|
+
|
|
20
|
+
**Angular** (`angular.json`, before the app's own styles):
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
"styles": [
|
|
24
|
+
"node_modules/@angular/cdk/overlay-prebuilt.css",
|
|
25
|
+
"node_modules/@spicainternational/forge-styles/forge.css",
|
|
26
|
+
"src/styles.scss"
|
|
27
|
+
]
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**A bundler** (Vite, webpack): `import '@spicainternational/forge-styles';` in the entry file. The fonts are resolved
|
|
31
|
+
relative to the file.
|
|
32
|
+
|
|
33
|
+
**Plain HTML:** copy `forge.css` and `fonts/` side by side, then `<link rel="stylesheet" href="forge.css">`. The file has
|
|
34
|
+
no `@import`.
|
|
35
|
+
|
|
36
|
+
**Theme and density** are attributes on `<html>`: `data-theme="light" | "dark"` and `data-density="compact"`. Without
|
|
37
|
+
them the page is light and comfortable.
|
|
38
|
+
|
|
39
|
+
## Cascade layers
|
|
40
|
+
|
|
41
|
+
Everything Forge is in cascade layers, in this order:
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
@layer forge-reset, forge-tokens, forge-theme, forge-base, forge-layout, forge-components, forge-utilities, forge-dx-hacks;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
An app's own styles are unlayered, so they override any Forge rule without specificity tricks. `forge-dx-hacks` is
|
|
48
|
+
filled by `css/forge-dx.css` of `@spicainternational/forge-devextreme`, for apps with DevExtreme.
|
|
49
|
+
|
|
50
|
+
## forge-tokens.json
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"source": "forge.css",
|
|
55
|
+
"root": { "primary": "oklch(0.52 var(--forge-primary-chroma) var(--forge-primary-hue))", "space-3": "0.75rem" },
|
|
56
|
+
"dark": { "surface": "oklch(0.16 var(--forge-chroma) var(--forge-hue))" }
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`root` holds every `--forge-*` token of the light theme, `dark` the ones the dark theme changes. Names have no
|
|
61
|
+
`--forge-` prefix. Values are the CSS as written, `var()` included, so a product can resolve them with its own brand
|
|
62
|
+
hue (`brand-hue`); forge-devextreme does that for the DevExtreme theme.
|
|
63
|
+
|
|
64
|
+
## Components
|
|
65
|
+
|
|
66
|
+
A component's look is a set of classes on documented markup. Variants are modifier classes, states are ARIA or `data-*`
|
|
67
|
+
attributes, so any framework can drive them. The Angular components of `@spicainternational/forge-angular` render
|
|
68
|
+
the same markup.
|
|
69
|
+
|
|
70
|
+
### Callout
|
|
71
|
+
|
|
72
|
+
A short message inline with the content. Neutral by default; `--caution` and `--critical` tint it. Set
|
|
73
|
+
`--forge-callout-color` on the element for a custom tint.
|
|
74
|
+
|
|
75
|
+
```html
|
|
76
|
+
<div class="forge-callout forge-callout--caution">
|
|
77
|
+
<svg class="forge-callout-icon" aria-hidden="true"><!-- an icon --></svg>
|
|
78
|
+
<div class="forge-callout-content">
|
|
79
|
+
<div class="forge-callout-heading" role="heading" aria-level="3">
|
|
80
|
+
<span class="forge-visually-hidden">Caution: </span>Calculation is locked
|
|
81
|
+
</div>
|
|
82
|
+
Entries before 1 May can't be changed.
|
|
83
|
+
<button class="forge-callout-link" type="button">Unlock</button>
|
|
84
|
+
<a class="forge-callout-link" href="/help" target="_blank" rel="noopener noreferrer">
|
|
85
|
+
Learn more<span class="forge-visually-hidden"> (opens in a new tab)</span>
|
|
86
|
+
</a>
|
|
87
|
+
</div>
|
|
88
|
+
<button class="forge-callout-close" type="button" aria-label="Close"><!-- an x icon --></button>
|
|
89
|
+
</div>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
- The visually hidden prefix (`Caution: `, `Critical: `) tells screen-reader users the intent the tint shows. Put it
|
|
93
|
+
in the heading when there is one, so both are read as one line; without a heading it starts the content.
|
|
94
|
+
- A callout that is part of the page has no role. One that appears in response to something the user did gets
|
|
95
|
+
`role="status"` (polite) or `role="alert"` (assertive).
|
|
96
|
+
- `.forge-callout-link` styles both the action `<button>` and the learn-more link.
|
|
97
|
+
- The heading, the action, the link and the close button are optional; the icon too (neutral has none by default).
|
|
98
|
+
|
|
99
|
+
## Versioning
|
|
100
|
+
|
|
101
|
+
Class names, the documented markup and the token names are public API. A change to any of them is a breaking change
|
|
102
|
+
in this package's [CHANGELOG](CHANGELOG.md).
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
These steps are for the Forge workspace (`sds-components-workspace`). Source files are in `src/`: one file per layer in
|
|
107
|
+
`src/layers/` and one per component in `src/components/`, listed in order by `src/index.css`. `scripts/build.js`
|
|
108
|
+
inlines them into `forge.css` and writes the other files into this folder; the built files are not committed.
|
|
109
|
+
|
|
110
|
+
In the workspace, nothing is published to see a change:
|
|
111
|
+
|
|
112
|
+
| You change | To see it |
|
|
113
|
+
|---|---|
|
|
114
|
+
| CSS or a token, in the showcase | `npm run styles:watch` in one terminal, `npm run app:serve` in another; a save rebuilds in about 0.1 s and the page updates |
|
|
115
|
+
| CSS or a token, in the library's tests | `npm run lib:test` (it builds forge-styles first) |
|
|
116
|
+
| A token the DevExtreme theme uses | also `npm run app:dx-theme`: the DevExtreme stylesheets are generated files |
|
|
117
|
+
|
|
118
|
+
Tests: `npm run styles:test`.
|
|
119
|
+
|
|
120
|
+
In an app in another repository:
|
|
121
|
+
|
|
122
|
+
1. **Try it locally:** `npm run styles:pack` writes the package as a `.tgz` into `dist/`; install it in the app with
|
|
123
|
+
`npm i <path>/dist/spicainternational-forge-styles-<version>.tgz`. Nothing reaches the registry. Reinstall after
|
|
124
|
+
each change.
|
|
125
|
+
2. **Let teams test it:** `npm run styles:ver-bump-beta && npm run styles:publish-beta`; apps install
|
|
126
|
+
`@spicainternational/forge-styles@beta`.
|
|
127
|
+
3. **Release:** set the version (`npm --workspace=@spicainternational/forge-styles version patch|minor`), add the
|
|
128
|
+
CHANGELOG entry, then `npm run styles:publish`. Publish forge-styles before forge-devextreme or the library when they
|
|
129
|
+
need the new version.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/forge-tokens.css
ADDED
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
/* Forge tokens: the forge-tokens and forge-theme layers of forge.css. */
|
|
2
|
+
@layer forge-reset, forge-tokens, forge-theme, forge-base, forge-layout, forge-components, forge-utilities, forge-dx-hacks;
|
|
3
|
+
|
|
4
|
+
/* ============================================================
|
|
5
|
+
TOKENS LAYER
|
|
6
|
+
Rules:
|
|
7
|
+
- Variables only
|
|
8
|
+
- No styling
|
|
9
|
+
============================================================ */
|
|
10
|
+
|
|
11
|
+
@layer forge-tokens {
|
|
12
|
+
:root {
|
|
13
|
+
/* -------------------- COLOR SEEDS -------------------- */
|
|
14
|
+
--forge-hue: 80;
|
|
15
|
+
--forge-chroma: 0.002;
|
|
16
|
+
/* The primary's blue: the portal blue (#3B8FC2) darkened to pass 4.5:1. Internal, not an app setting: the
|
|
17
|
+
primary's lightness only passes at this hue and chroma. A product's own color is --forge-brand-hue */
|
|
18
|
+
--forge-primary-hue: 239;
|
|
19
|
+
--forge-primary-chroma: 0.112;
|
|
20
|
+
--forge-brand-hue: 238;
|
|
21
|
+
|
|
22
|
+
/* -------------------- SURFACES (TONE-BASED) -------------------- */
|
|
23
|
+
/* As Material 3: the page ground and a 5-step container scale; components pick a step by use, the same step
|
|
24
|
+
in both themes, and the scale flips (lowest is the lightest tone in light, the darkest in dark).
|
|
25
|
+
- surface: the page, the modal
|
|
26
|
+
- container-lowest: cards, fields, lists, chips
|
|
27
|
+
- container-low: panels, the pane
|
|
28
|
+
- container: insets, disabled fields, secondary buttons
|
|
29
|
+
- container-high / -highest: the skeleton and the secondary button's fills (ink text) only, the primary as
|
|
30
|
+
text drops below 4.5:1 there in light
|
|
31
|
+
- bright: anything floating (popups, menus, dropdowns, drawers, DevExtreme popups). As Material 3's
|
|
32
|
+
surface-bright it doesn't flip: light in light, lighter than the page and the cards in dark. White in light
|
|
33
|
+
(Material 3 uses the page tone) so a dropdown matches the card it opens from */
|
|
34
|
+
--forge-surface: oklch(0.975 var(--forge-chroma) var(--forge-hue));
|
|
35
|
+
--forge-surface-container-lowest: oklch(0.999 var(--forge-chroma) var(--forge-hue));
|
|
36
|
+
--forge-surface-container-low: oklch(0.965 var(--forge-chroma) var(--forge-hue));
|
|
37
|
+
--forge-surface-container: oklch(0.95 var(--forge-chroma) var(--forge-hue));
|
|
38
|
+
--forge-surface-container-high: oklch(0.932 var(--forge-chroma) var(--forge-hue));
|
|
39
|
+
--forge-surface-container-highest: oklch(0.915 var(--forge-chroma) var(--forge-hue));
|
|
40
|
+
--forge-surface-bright: oklch(0.999 var(--forge-chroma) var(--forge-hue));
|
|
41
|
+
|
|
42
|
+
/* -------------------- TEXT -------------------- */
|
|
43
|
+
--forge-text-primary: oklch(0.2 var(--forge-chroma) var(--forge-hue));
|
|
44
|
+
--forge-text-secondary: oklch(0.475 var(--forge-chroma) var(--forge-hue));
|
|
45
|
+
--forge-text-tertiary: oklch(0.595 var(--forge-chroma) var(--forge-hue));
|
|
46
|
+
|
|
47
|
+
/* -------------------- BORDERS & RADII -------------------- */
|
|
48
|
+
--forge-border: oklch(0.9 var(--forge-chroma) var(--forge-hue));
|
|
49
|
+
/* The outline of form fields: a step more solid than a divider */
|
|
50
|
+
--forge-border-strong: oklch(0.84 var(--forge-chroma) var(--forge-hue));
|
|
51
|
+
/* A scrollbar thumb: light at rest, darker while the pointer is over its scrolling area (both themes follow,
|
|
52
|
+
the dark theme redefines the tokens these point at) */
|
|
53
|
+
--forge-scrollbar-thumb: var(--forge-border-strong);
|
|
54
|
+
--forge-scrollbar-thumb-hover: var(--forge-text-tertiary);
|
|
55
|
+
--forge-radius-sm: 4px;
|
|
56
|
+
--forge-radius-md: 8px;
|
|
57
|
+
--forge-radius-lg: 12px;
|
|
58
|
+
--forge-radius-xl: 16px;
|
|
59
|
+
--forge-radius-full: 9999px;
|
|
60
|
+
|
|
61
|
+
/* -------------------- SHADOWS -------------------- */
|
|
62
|
+
--forge-shadow-rest:
|
|
63
|
+
0 1px 2px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.04),
|
|
64
|
+
0 0 0 1px oklch(0.9 var(--forge-chroma) var(--forge-hue));
|
|
65
|
+
|
|
66
|
+
/* No ring: the edge of a panel on the surface, softer than a card's border */
|
|
67
|
+
--forge-shadow-soft:
|
|
68
|
+
0 1px 3px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.06),
|
|
69
|
+
0 1px 2px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.04);
|
|
70
|
+
|
|
71
|
+
--forge-shadow-hover:
|
|
72
|
+
0 4px 8px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.08),
|
|
73
|
+
0 0 0 1px oklch(0.88 var(--forge-chroma) var(--forge-hue));
|
|
74
|
+
|
|
75
|
+
/* Floating surfaces (menus, popovers, the drawer, the navigation callout): the edge is a 1px border of
|
|
76
|
+
--forge-border-overlay, snapped to device pixels so it stays sharp at 125% / 150% display scales (a 1px
|
|
77
|
+
spread ring in the shadow isn't snapped and smears over two device pixels). The shadow only lifts */
|
|
78
|
+
--forge-border-overlay: oklch(0.85 var(--forge-chroma) var(--forge-hue));
|
|
79
|
+
--forge-shadow-overlay: 0 12px 24px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.12);
|
|
80
|
+
|
|
81
|
+
/* A modal sits on a scrim. Its edge is one hairline border (snapped to device pixels, so sharp at any display
|
|
82
|
+
scale; a 1px spread ring next to it smears into a halo), dark and translucent so it reads on the surface and
|
|
83
|
+
on the scrim alike. Its shadow only lifts it: deeper than an overlay's, it's a large surface */
|
|
84
|
+
--forge-border-modal: oklch(0 0 0 / 0.1);
|
|
85
|
+
--forge-shadow-modal: 0 24px 48px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.16);
|
|
86
|
+
|
|
87
|
+
/* -------------------- TYPOGRAPHY -------------------- */
|
|
88
|
+
--forge-font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
|
|
89
|
+
/* Code, keys, tabular IDs. Roboto Mono's @font-face rules are under FONTS at the top */
|
|
90
|
+
--forge-font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
91
|
+
--forge-font-weight-medium: 500;
|
|
92
|
+
--forge-font-weight-bold: 600;
|
|
93
|
+
--forge-letter-spacing-tight: -0.02em;
|
|
94
|
+
/* UI text (the body, 14px): a little tighter than Inter's own spacing, and 22.4px lines at 14px, as on
|
|
95
|
+
angular.dev. Code keeps the mono font's own spacing */
|
|
96
|
+
--forge-letter-spacing-body: -0.01em;
|
|
97
|
+
/* Uppercase labels: capitals set tight read squashed, so they get room */
|
|
98
|
+
--forge-letter-spacing-caps: 0.03em;
|
|
99
|
+
--forge-line-height-body: 1.6;
|
|
100
|
+
|
|
101
|
+
--forge-size-2xs: 0.6875rem; /* 11px at a 16px root */
|
|
102
|
+
--forge-size-xs: 0.75rem; /* 12px at a 16px root */
|
|
103
|
+
--forge-size-sm: 0.875rem; /* 14px at a 16px root */
|
|
104
|
+
--forge-size-base: 1rem; /* 16px at a 16px root */
|
|
105
|
+
|
|
106
|
+
/* Heading sizes, 4px apart; the default size of h1-h6, and of any element with .forge-heading-xl ... -xs */
|
|
107
|
+
--forge-h1: 1.75rem; /* 28px at a 16px root, .forge-heading-xl */
|
|
108
|
+
--forge-h2: 1.5rem; /* 24px, .forge-heading-lg */
|
|
109
|
+
--forge-h3: 1.25rem; /* 20px, .forge-heading-md */
|
|
110
|
+
--forge-h4: 1rem; /* 16px, .forge-heading-sm */
|
|
111
|
+
--forge-h5: 0.875rem; /* 14px (body size, bold), .forge-heading-xs; also h6 */
|
|
112
|
+
/* The heading's size plus 6px, rounded up to the 4px grid: 28/36, 24/32, 20/28, 16/24, 14/20. The em resolves on
|
|
113
|
+
each heading, so a size override (a class, --forge-heading-size) gets its own line height. Set it on a heading
|
|
114
|
+
to override it (a display title). Without CSS round(), 1.25 (end of this layer) */
|
|
115
|
+
--forge-heading-line-height: round(up, 1em + 0.375rem, 0.25rem);
|
|
116
|
+
/* Table cells and dense lists */
|
|
117
|
+
--forge-line-height-snug: 1.35;
|
|
118
|
+
|
|
119
|
+
/* -------------------- CONTENT TYPOGRAPHY -------------------- */
|
|
120
|
+
--forge-content-base: 1rem;
|
|
121
|
+
--forge-content-line-height: 1.6;
|
|
122
|
+
|
|
123
|
+
/* -------------------- SPACING -------------------- */
|
|
124
|
+
--forge-space-1: 0.25rem;
|
|
125
|
+
--forge-space-2: 0.5rem;
|
|
126
|
+
--forge-space-3: 0.75rem;
|
|
127
|
+
--forge-space-4: 1rem;
|
|
128
|
+
--forge-space-5: 1.5rem;
|
|
129
|
+
--forge-space-6: 2rem;
|
|
130
|
+
|
|
131
|
+
/* -------------------- PRIMARY -------------------- */
|
|
132
|
+
/* The system's own color, a blue. Fills with text (primary button, selected day, primary badge), focus rings,
|
|
133
|
+
focus borders, the outline-primary segment's border and text. The same in every product. White on it 5.4:1,
|
|
134
|
+
as text on the surface 5:1.
|
|
135
|
+
Hover and active lower the chroma to stay in the sRGB gamut */
|
|
136
|
+
--forge-primary: oklch(0.52 var(--forge-primary-chroma) var(--forge-primary-hue));
|
|
137
|
+
--forge-primary-hover: oklch(0.47 0.106 var(--forge-primary-hue));
|
|
138
|
+
--forge-primary-active: oklch(0.43 0.097 var(--forge-primary-hue));
|
|
139
|
+
/* Text and icons on a --forge-primary background */
|
|
140
|
+
--forge-text-on-primary: oklch(0.995 var(--forge-chroma) var(--forge-hue));
|
|
141
|
+
|
|
142
|
+
/* -------------------- INTENT COLORS -------------------- */
|
|
143
|
+
/* The product's color, on --forge-brand-hue: only where the product shows itself (navigation, the pane, filters,
|
|
144
|
+
tabs), as a tint or mixed into the text color. Not behind text: white on it is 3.9:1 */
|
|
145
|
+
--forge-brand: oklch(0.6 0.12 var(--forge-brand-hue));
|
|
146
|
+
/* Text and icons on a --forge-brand background; the same in dark mode */
|
|
147
|
+
--forge-text-on-brand: oklch(1 0 0);
|
|
148
|
+
/* Brand as text on the page or side bar background (the current page in navigation): at least 4.5:1 on every
|
|
149
|
+
surface up to surface-container-high, also under the hover layer */
|
|
150
|
+
--forge-brand-text: oklch(0.45 0.13 var(--forge-brand-hue));
|
|
151
|
+
--forge-danger: oklch(0.66 0.15 31.05);
|
|
152
|
+
--forge-success: oklch(0.65 0.14 145);
|
|
153
|
+
/* Cyan, so it stays apart from the blue primary and brand */
|
|
154
|
+
--forge-info: oklch(0.6 0.11 215);
|
|
155
|
+
--forge-warning: oklch(0.85 0.16 81.95);
|
|
156
|
+
|
|
157
|
+
/* -------------------- INTERACTION COLORS -------------------- */
|
|
158
|
+
/* State layers, as Material 3: the text color laid over whatever is underneath, so hover and press show on
|
|
159
|
+
every surface in both themes. Translucent: an element with its own background stacks the layer on it,
|
|
160
|
+
background: linear-gradient(var(--forge-hover-bg) 0 0), <its background>. Dark mode doesn't redefine them,
|
|
161
|
+
they follow --forge-text-primary */
|
|
162
|
+
--forge-state-hover-opacity: 8%;
|
|
163
|
+
--forge-state-pressed-opacity: 12%;
|
|
164
|
+
--forge-hover-bg: color-mix(in srgb, var(--forge-text-primary) var(--forge-state-hover-opacity), transparent);
|
|
165
|
+
--forge-active-bg: color-mix(in srgb, var(--forge-text-primary) var(--forge-state-pressed-opacity), transparent);
|
|
166
|
+
|
|
167
|
+
/* Selected: a brand tint for the current or chosen item (a pressed filter chip, an active filter pill, the
|
|
168
|
+
side bar's current page). Opaque, the brand mixed into surface-container-lowest, so the item has exactly
|
|
169
|
+
the same color on any surface. The text is the brand mixed toward text-primary, at least 4.5:1 on the tint
|
|
170
|
+
in both themes. Dark mode doesn't redefine them, they follow --forge-brand, --forge-text-primary and
|
|
171
|
+
--forge-surface-container-lowest */
|
|
172
|
+
--forge-selected-tint: 16%;
|
|
173
|
+
--forge-selected-tint-hover: 24%;
|
|
174
|
+
--forge-selected-bg: color-mix(in oklab, var(--forge-brand) var(--forge-selected-tint), var(--forge-surface-container-lowest));
|
|
175
|
+
--forge-selected-bg-hover: color-mix(in oklab, var(--forge-brand) var(--forge-selected-tint-hover), var(--forge-surface-container-lowest));
|
|
176
|
+
/* 70%: at 75% the text fell to 4.4:1 on the hovered tint over white */
|
|
177
|
+
--forge-selected-text: color-mix(in oklab, var(--forge-brand) 70%, var(--forge-text-primary));
|
|
178
|
+
|
|
179
|
+
--forge-brand-hover: oklch(0.56 0.13 var(--forge-brand-hue));
|
|
180
|
+
--forge-brand-active: oklch(0.52 0.14 var(--forge-brand-hue));
|
|
181
|
+
|
|
182
|
+
--forge-danger-hover: oklch(0.62 0.16 31.05);
|
|
183
|
+
--forge-danger-active: oklch(0.58 0.17 31.05);
|
|
184
|
+
|
|
185
|
+
/* The primary ink: at least 3:1 against every background, also the active one (WCAG 1.4.11). -strong is kept for
|
|
186
|
+
rings drawn inside an element; both are the same now */
|
|
187
|
+
--forge-focus-ring: var(--forge-primary);
|
|
188
|
+
--forge-focus-ring-strong: var(--forge-primary);
|
|
189
|
+
|
|
190
|
+
/* -------------------- MOTION -------------------- */
|
|
191
|
+
--forge-motion-fast: 120ms;
|
|
192
|
+
--forge-motion-base: 180ms;
|
|
193
|
+
--forge-motion-slow: 240ms;
|
|
194
|
+
|
|
195
|
+
--forge-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
|
196
|
+
--forge-ease-linear: linear;
|
|
197
|
+
|
|
198
|
+
--forge-motion-distance-sm: 4px;
|
|
199
|
+
--forge-motion-distance-md: 8px;
|
|
200
|
+
|
|
201
|
+
/* -------------------- STATES -------------------- */
|
|
202
|
+
--forge-opacity-disabled: 0.5;
|
|
203
|
+
|
|
204
|
+
/* -------------------- LAYERS -------------------- */
|
|
205
|
+
/* z-index inside the page. Overlay is the CDK overlay container's own value (not set by Forge); native
|
|
206
|
+
dialogs sit in the top layer above all of them */
|
|
207
|
+
--forge-z-raised: 1;
|
|
208
|
+
--forge-z-sticky: 10;
|
|
209
|
+
--forge-z-overlay: 1000;
|
|
210
|
+
--forge-z-drawer: 1040;
|
|
211
|
+
|
|
212
|
+
/* -------------------- SIZES -------------------- */
|
|
213
|
+
/* Heights of buttons and single-line fields, so they line up in a row (DS 2.0); icon buttons and icons take
|
|
214
|
+
theirs when they are reworked */
|
|
215
|
+
--forge-control-height-md: 2.25rem; /* 36px */
|
|
216
|
+
--forge-control-height-sm: 1.75rem; /* 28px */
|
|
217
|
+
--forge-icon-button-md: 1.75rem; /* 28px */
|
|
218
|
+
--forge-icon-button-sm: 1.375rem; /* 22px */
|
|
219
|
+
--forge-icon-sm: 0.875rem; /* 14px */
|
|
220
|
+
--forge-icon-md: 1rem; /* 16px */
|
|
221
|
+
--forge-icon-lg: 1.25rem; /* 20px */
|
|
222
|
+
|
|
223
|
+
/* -------------------- SKELETON TOKENS -------------------- */
|
|
224
|
+
--forge-skeleton-bg: var(--forge-surface-container-highest);
|
|
225
|
+
--forge-skeleton-fg: var(--forge-surface-container-high);
|
|
226
|
+
--forge-skeleton-radius: var(--forge-radius-sm);
|
|
227
|
+
--forge-skeleton-shimmer-duration: 1.2s;
|
|
228
|
+
|
|
229
|
+
/* -------------------- AVATAR TOKENS -------------------- */
|
|
230
|
+
/* Lightness and chroma of an avatar's identity color; the hue comes from the person (--forge-avatar-hue) */
|
|
231
|
+
--forge-avatar-bg-lightness: 0.96;
|
|
232
|
+
--forge-avatar-bg-chroma: 0.02;
|
|
233
|
+
--forge-avatar-fg-lightness: 0.55;
|
|
234
|
+
--forge-avatar-fg-chroma: 0.15;
|
|
235
|
+
|
|
236
|
+
/* -------------------- CATEGORY TOKENS -------------------- */
|
|
237
|
+
/* Categorical marks (tags, tag groups): eight bg / text pairs from the avatar's formula, blue first. Text
|
|
238
|
+
passes 4.5:1 on its bg in both themes; hues 239, 183.4, 210.8 and 130.5 use text lightness 0.53, and some
|
|
239
|
+
chroma is lowered to stay in the sRGB gamut. The avatar keeps its own ten hues */
|
|
240
|
+
--forge-cat-1-bg: oklch(0.96 0.02 239);
|
|
241
|
+
--forge-cat-1-text: oklch(0.53 0.115 239);
|
|
242
|
+
--forge-cat-2-bg: oklch(0.96 0.02 321.2);
|
|
243
|
+
--forge-cat-2-text: oklch(0.55 0.15 321.2);
|
|
244
|
+
--forge-cat-3-bg: oklch(0.96 0.02 294.8);
|
|
245
|
+
--forge-cat-3-text: oklch(0.55 0.15 294.8);
|
|
246
|
+
--forge-cat-4-bg: oklch(0.96 0.015 28.8);
|
|
247
|
+
--forge-cat-4-text: oklch(0.55 0.15 28.8);
|
|
248
|
+
--forge-cat-5-bg: oklch(0.96 0.02 183.4);
|
|
249
|
+
--forge-cat-5-text: oklch(0.53 0.09 183.4);
|
|
250
|
+
--forge-cat-6-bg: oklch(0.96 0.02 210.8);
|
|
251
|
+
--forge-cat-6-text: oklch(0.53 0.09 210.8);
|
|
252
|
+
--forge-cat-7-bg: oklch(0.96 0.02 130.5);
|
|
253
|
+
--forge-cat-7-text: oklch(0.53 0.14 130.5);
|
|
254
|
+
--forge-cat-8-bg: oklch(0.96 0.02 9.6);
|
|
255
|
+
--forge-cat-8-text: oklch(0.55 0.15 9.6);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
@supports not (line-height: round(up, 1em, 1px)) {
|
|
259
|
+
:root {
|
|
260
|
+
--forge-heading-line-height: 1.25;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* ============================================================
|
|
266
|
+
DARK MODE (TOKEN OVERRIDES ONLY)
|
|
267
|
+
============================================================ */
|
|
268
|
+
|
|
269
|
+
@layer forge-theme {
|
|
270
|
+
/* ---- Dark mode ---- */
|
|
271
|
+
:root[data-theme="dark"] {
|
|
272
|
+
color-scheme: dark;
|
|
273
|
+
|
|
274
|
+
/* -------------------- SURFACES (TONE-BASED) -------------------- */
|
|
275
|
+
--forge-surface: oklch(0.16 var(--forge-chroma) var(--forge-hue));
|
|
276
|
+
--forge-surface-container-lowest: oklch(0.135 var(--forge-chroma) var(--forge-hue));
|
|
277
|
+
--forge-surface-container-low: oklch(0.18 var(--forge-chroma) var(--forge-hue));
|
|
278
|
+
--forge-surface-container: oklch(0.205 var(--forge-chroma) var(--forge-hue));
|
|
279
|
+
--forge-surface-container-high: oklch(0.24 var(--forge-chroma) var(--forge-hue));
|
|
280
|
+
--forge-surface-container-highest: oklch(0.28 var(--forge-chroma) var(--forge-hue));
|
|
281
|
+
--forge-surface-bright: oklch(0.24 var(--forge-chroma) var(--forge-hue));
|
|
282
|
+
|
|
283
|
+
--forge-text-primary: oklch(0.92 var(--forge-chroma) var(--forge-hue));
|
|
284
|
+
--forge-text-secondary: oklch(0.72 var(--forge-chroma) var(--forge-hue));
|
|
285
|
+
--forge-text-tertiary: oklch(0.635 var(--forge-chroma) var(--forge-hue));
|
|
286
|
+
|
|
287
|
+
--forge-border: oklch(0.3 var(--forge-chroma) var(--forge-hue));
|
|
288
|
+
--forge-border-strong: oklch(0.36 var(--forge-chroma) var(--forge-hue));
|
|
289
|
+
|
|
290
|
+
/* -------------------- SHADOWS -------------------- */
|
|
291
|
+
/* Rings lighter than the surface, drop shadows black and stronger to show on the dark surface */
|
|
292
|
+
--forge-shadow-rest:
|
|
293
|
+
0 1px 2px oklch(0 0 0 / 0.3),
|
|
294
|
+
0 0 0 1px oklch(0.3 var(--forge-chroma) var(--forge-hue));
|
|
295
|
+
|
|
296
|
+
/* Barely shows on the dark surface: the panel's edge there is the lighter container tone itself */
|
|
297
|
+
--forge-shadow-soft:
|
|
298
|
+
0 1px 3px oklch(0 0 0 / 0.3),
|
|
299
|
+
0 1px 2px oklch(0 0 0 / 0.2);
|
|
300
|
+
|
|
301
|
+
--forge-shadow-hover:
|
|
302
|
+
0 4px 8px oklch(0 0 0 / 0.4),
|
|
303
|
+
0 0 0 1px oklch(0.34 var(--forge-chroma) var(--forge-hue));
|
|
304
|
+
|
|
305
|
+
--forge-border-overlay: oklch(0.38 var(--forge-chroma) var(--forge-hue));
|
|
306
|
+
--forge-shadow-overlay: 0 12px 24px oklch(0 0 0 / 0.5);
|
|
307
|
+
|
|
308
|
+
--forge-border-modal: oklch(0.38 var(--forge-chroma) var(--forge-hue));
|
|
309
|
+
--forge-shadow-modal: 0 24px 48px oklch(0 0 0 / 0.6);
|
|
310
|
+
|
|
311
|
+
/* -------------------- SKELETON TOKENS -------------------- */
|
|
312
|
+
--forge-skeleton-bg: var(--forge-surface-container-high);
|
|
313
|
+
--forge-skeleton-fg: var(--forge-surface-container-highest);
|
|
314
|
+
|
|
315
|
+
/* -------------------- AVATAR TOKENS -------------------- */
|
|
316
|
+
--forge-avatar-bg-lightness: 0.32;
|
|
317
|
+
--forge-avatar-bg-chroma: 0.05;
|
|
318
|
+
--forge-avatar-fg-lightness: 0.85;
|
|
319
|
+
--forge-avatar-fg-chroma: 0.1;
|
|
320
|
+
|
|
321
|
+
/* -------------------- CATEGORY TOKENS -------------------- */
|
|
322
|
+
--forge-cat-1-bg: oklch(0.32 0.05 239);
|
|
323
|
+
--forge-cat-1-text: oklch(0.85 0.08 239);
|
|
324
|
+
--forge-cat-2-bg: oklch(0.32 0.05 321.2);
|
|
325
|
+
--forge-cat-2-text: oklch(0.85 0.1 321.2);
|
|
326
|
+
--forge-cat-3-bg: oklch(0.32 0.05 294.8);
|
|
327
|
+
--forge-cat-3-text: oklch(0.85 0.08 294.8);
|
|
328
|
+
--forge-cat-4-bg: oklch(0.32 0.05 28.8);
|
|
329
|
+
--forge-cat-4-text: oklch(0.85 0.08 28.8);
|
|
330
|
+
--forge-cat-5-bg: oklch(0.32 0.05 183.4);
|
|
331
|
+
--forge-cat-5-text: oklch(0.85 0.1 183.4);
|
|
332
|
+
--forge-cat-6-bg: oklch(0.32 0.05 210.8);
|
|
333
|
+
--forge-cat-6-text: oklch(0.85 0.1 210.8);
|
|
334
|
+
--forge-cat-7-bg: oklch(0.32 0.05 130.5);
|
|
335
|
+
--forge-cat-7-text: oklch(0.85 0.1 130.5);
|
|
336
|
+
--forge-cat-8-bg: oklch(0.32 0.05 9.6);
|
|
337
|
+
--forge-cat-8-text: oklch(0.85 0.08 9.6);
|
|
338
|
+
|
|
339
|
+
/* A lighter blue with dark text on it (7.4:1); hover and active get lighter still */
|
|
340
|
+
--forge-primary: oklch(0.72 var(--forge-primary-chroma) var(--forge-primary-hue));
|
|
341
|
+
--forge-primary-hover: oklch(0.77 var(--forge-primary-chroma) var(--forge-primary-hue));
|
|
342
|
+
--forge-primary-active: oklch(0.82 0.101 var(--forge-primary-hue));
|
|
343
|
+
--forge-text-on-primary: oklch(0.2 var(--forge-chroma) var(--forge-hue));
|
|
344
|
+
|
|
345
|
+
--forge-brand-hover: oklch(0.66 0.13 var(--forge-brand-hue));
|
|
346
|
+
--forge-brand-active: oklch(0.72 0.14 var(--forge-brand-hue));
|
|
347
|
+
--forge-brand-text: oklch(0.74 0.11 var(--forge-brand-hue));
|
|
348
|
+
|
|
349
|
+
--forge-danger-hover: oklch(0.71 0.16 31.05);
|
|
350
|
+
--forge-danger-active: oklch(0.76 0.17 31.05);
|
|
351
|
+
|
|
352
|
+
/* The secondary button's hover is a ghost button's hover on the page: -high in dark (-highest in light, the
|
|
353
|
+
fallback in the button's rule) */
|
|
354
|
+
--forge-button-secondary-bg-hover: var(--forge-surface-container-high);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
:root[data-theme="light"],
|
|
358
|
+
:root:not([data-theme]) {
|
|
359
|
+
color-scheme: light;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/* ---- Density ---- */
|
|
363
|
+
[data-density="compact"] {
|
|
364
|
+
--forge-space-1: 0.125rem;
|
|
365
|
+
--forge-space-2: 0.375rem;
|
|
366
|
+
--forge-space-3: 0.5rem;
|
|
367
|
+
--forge-space-4: 0.75rem;
|
|
368
|
+
--forge-space-5: 1rem;
|
|
369
|
+
--forge-space-6: 1.5rem;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|