@spicainternational/forge-styles 0.0.0-stage → 0.1.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 +13 -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 +339 -0
- package/forge-tokens.json +176 -0
- package/forge.css +3261 -0
- package/package.json +33 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
First release. `forge.css` (tokens, light and dark themes, reset, base, layout, components, utilities) and its fonts
|
|
6
|
+
(Inter, Roboto Mono), until now copied by hand from the showcase.
|
|
7
|
+
|
|
8
|
+
- `forge-tokens.css`: the tokens alone (the `forge-tokens` and `forge-theme` layers).
|
|
9
|
+
- `forge-tokens.json`: the tokens as data, `{ source, root, dark }` (until now shipped by forge-devextreme).
|
|
10
|
+
- The callout's styles (`.forge-callout`, `--caution`, `--critical` and its parts), the first component in the
|
|
11
|
+
package; the markup is in the README.
|
|
12
|
+
- The `forge-dx-hacks` layer moved to `@spicainternational/forge-devextreme` (`css/forge-dx.css`); the layer keeps its
|
|
13
|
+
place in the order statement.
|
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/ngx-sds-components` 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,339 @@
|
|
|
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, secondary buttons
|
|
27
|
+
- container-low: panels, the pane
|
|
28
|
+
- container: insets, disabled fields
|
|
29
|
+
- container-high / -highest: the skeleton only, the primary as text drops below 4.5:1 there in light
|
|
30
|
+
- bright: anything floating (popups, menus, dropdowns, drawers, DevExtreme popups). As Material 3's
|
|
31
|
+
surface-bright it doesn't flip: light in light, lighter than the page and the cards in dark. White in light
|
|
32
|
+
(Material 3 uses the page tone) so a dropdown matches the card it opens from */
|
|
33
|
+
--forge-surface: oklch(0.975 var(--forge-chroma) var(--forge-hue));
|
|
34
|
+
--forge-surface-container-lowest: oklch(0.999 var(--forge-chroma) var(--forge-hue));
|
|
35
|
+
--forge-surface-container-low: oklch(0.965 var(--forge-chroma) var(--forge-hue));
|
|
36
|
+
--forge-surface-container: oklch(0.95 var(--forge-chroma) var(--forge-hue));
|
|
37
|
+
--forge-surface-container-high: oklch(0.932 var(--forge-chroma) var(--forge-hue));
|
|
38
|
+
--forge-surface-container-highest: oklch(0.915 var(--forge-chroma) var(--forge-hue));
|
|
39
|
+
--forge-surface-bright: oklch(0.999 var(--forge-chroma) var(--forge-hue));
|
|
40
|
+
|
|
41
|
+
/* -------------------- TEXT -------------------- */
|
|
42
|
+
--forge-text-primary: oklch(0.2 var(--forge-chroma) var(--forge-hue));
|
|
43
|
+
--forge-text-secondary: oklch(0.475 var(--forge-chroma) var(--forge-hue));
|
|
44
|
+
--forge-text-tertiary: oklch(0.595 var(--forge-chroma) var(--forge-hue));
|
|
45
|
+
|
|
46
|
+
/* -------------------- BORDERS & RADII -------------------- */
|
|
47
|
+
--forge-border: oklch(0.9 var(--forge-chroma) var(--forge-hue));
|
|
48
|
+
/* The outline of form fields: a step more solid than a divider */
|
|
49
|
+
--forge-border-strong: oklch(0.84 var(--forge-chroma) var(--forge-hue));
|
|
50
|
+
/* A scrollbar thumb: light at rest, darker while the pointer is over its scrolling area (both themes follow,
|
|
51
|
+
the dark theme redefines the tokens these point at) */
|
|
52
|
+
--forge-scrollbar-thumb: var(--forge-border-strong);
|
|
53
|
+
--forge-scrollbar-thumb-hover: var(--forge-text-tertiary);
|
|
54
|
+
--forge-radius-sm: 4px;
|
|
55
|
+
--forge-radius-md: 8px;
|
|
56
|
+
--forge-radius-lg: 12px;
|
|
57
|
+
--forge-radius-xl: 16px;
|
|
58
|
+
--forge-radius-full: 9999px;
|
|
59
|
+
|
|
60
|
+
/* -------------------- SHADOWS -------------------- */
|
|
61
|
+
--forge-shadow-rest:
|
|
62
|
+
0 1px 2px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.04),
|
|
63
|
+
0 0 0 1px oklch(0.9 var(--forge-chroma) var(--forge-hue));
|
|
64
|
+
|
|
65
|
+
/* No ring: the edge of a panel on the surface, softer than a card's border */
|
|
66
|
+
--forge-shadow-soft:
|
|
67
|
+
0 1px 3px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.06),
|
|
68
|
+
0 1px 2px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.04);
|
|
69
|
+
|
|
70
|
+
--forge-shadow-hover:
|
|
71
|
+
0 4px 8px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.08),
|
|
72
|
+
0 0 0 1px oklch(0.88 var(--forge-chroma) var(--forge-hue));
|
|
73
|
+
|
|
74
|
+
/* Floating surfaces (menus, popovers, the drawer, the navigation callout): the edge is a 1px border of
|
|
75
|
+
--forge-border-overlay, snapped to device pixels so it stays sharp at 125% / 150% display scales (a 1px
|
|
76
|
+
spread ring in the shadow isn't snapped and smears over two device pixels). The shadow only lifts */
|
|
77
|
+
--forge-border-overlay: oklch(0.85 var(--forge-chroma) var(--forge-hue));
|
|
78
|
+
--forge-shadow-overlay: 0 12px 24px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.12);
|
|
79
|
+
|
|
80
|
+
/* A modal sits on a scrim. Its edge is one hairline border (snapped to device pixels, so sharp at any display
|
|
81
|
+
scale; a 1px spread ring next to it smears into a halo), dark and translucent so it reads on the surface and
|
|
82
|
+
on the scrim alike. Its shadow only lifts it: deeper than an overlay's, it's a large surface */
|
|
83
|
+
--forge-border-modal: oklch(0 0 0 / 0.1);
|
|
84
|
+
--forge-shadow-modal: 0 24px 48px oklch(0.1 var(--forge-chroma) var(--forge-hue) / 0.16);
|
|
85
|
+
|
|
86
|
+
/* -------------------- TYPOGRAPHY -------------------- */
|
|
87
|
+
--forge-font: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
|
|
88
|
+
/* Code, keys, tabular IDs. Roboto Mono's @font-face rules are under FONTS at the top */
|
|
89
|
+
--forge-font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
90
|
+
--forge-font-weight-medium: 500;
|
|
91
|
+
--forge-font-weight-bold: 600;
|
|
92
|
+
--forge-letter-spacing-tight: -0.02em;
|
|
93
|
+
|
|
94
|
+
--forge-size-2xs: 0.6875rem; /* 11px at a 16px root */
|
|
95
|
+
--forge-size-xs: 0.75rem; /* 12px at a 16px root */
|
|
96
|
+
--forge-size-sm: 0.875rem; /* 14px at a 16px root */
|
|
97
|
+
--forge-size-base: 1rem; /* 16px at a 16px root */
|
|
98
|
+
|
|
99
|
+
/* Heading sizes, 4px apart; the default size of h1-h6, and of any element with .forge-heading-xl ... -xs */
|
|
100
|
+
--forge-h1: 1.75rem; /* 28px at a 16px root, .forge-heading-xl */
|
|
101
|
+
--forge-h2: 1.5rem; /* 24px, .forge-heading-lg */
|
|
102
|
+
--forge-h3: 1.25rem; /* 20px, .forge-heading-md */
|
|
103
|
+
--forge-h4: 1rem; /* 16px, .forge-heading-sm */
|
|
104
|
+
--forge-h5: 0.875rem; /* 14px (body size, bold), .forge-heading-xs; also h6 */
|
|
105
|
+
--forge-heading-line-height: 1.25;
|
|
106
|
+
/* Table cells and dense lists */
|
|
107
|
+
--forge-line-height-snug: 1.35;
|
|
108
|
+
|
|
109
|
+
/* -------------------- CONTENT TYPOGRAPHY -------------------- */
|
|
110
|
+
--forge-content-base: 1rem;
|
|
111
|
+
--forge-content-line-height: 1.6;
|
|
112
|
+
|
|
113
|
+
/* -------------------- SPACING -------------------- */
|
|
114
|
+
--forge-space-1: 0.25rem;
|
|
115
|
+
--forge-space-2: 0.5rem;
|
|
116
|
+
--forge-space-3: 0.75rem;
|
|
117
|
+
--forge-space-4: 1rem;
|
|
118
|
+
--forge-space-5: 1.5rem;
|
|
119
|
+
--forge-space-6: 2rem;
|
|
120
|
+
|
|
121
|
+
/* -------------------- PRIMARY -------------------- */
|
|
122
|
+
/* The system's own color, a blue. Fills with text (primary button, selected segment and day, primary badge),
|
|
123
|
+
focus rings and focus borders. The same in every product. White on it 5.4:1, as text on the surface 5:1.
|
|
124
|
+
Hover and active lower the chroma to stay in the sRGB gamut */
|
|
125
|
+
--forge-primary: oklch(0.52 var(--forge-primary-chroma) var(--forge-primary-hue));
|
|
126
|
+
--forge-primary-hover: oklch(0.47 0.106 var(--forge-primary-hue));
|
|
127
|
+
--forge-primary-active: oklch(0.43 0.097 var(--forge-primary-hue));
|
|
128
|
+
/* Text and icons on a --forge-primary background */
|
|
129
|
+
--forge-text-on-primary: oklch(0.995 var(--forge-chroma) var(--forge-hue));
|
|
130
|
+
|
|
131
|
+
/* -------------------- INTENT COLORS -------------------- */
|
|
132
|
+
/* The product's color, on --forge-brand-hue: only where the product shows itself (navigation, the pane, filters,
|
|
133
|
+
tabs), as a tint or mixed into the text color. Not behind text: white on it is 3.9:1 */
|
|
134
|
+
--forge-brand: oklch(0.6 0.12 var(--forge-brand-hue));
|
|
135
|
+
/* Text and icons on a --forge-brand background; the same in dark mode */
|
|
136
|
+
--forge-text-on-brand: oklch(1 0 0);
|
|
137
|
+
/* Brand as text on the page or side bar background (the current page in navigation): at least 4.5:1 on every
|
|
138
|
+
surface up to surface-container-high, also under the hover layer */
|
|
139
|
+
--forge-brand-text: oklch(0.45 0.13 var(--forge-brand-hue));
|
|
140
|
+
--forge-danger: oklch(0.66 0.15 31.05);
|
|
141
|
+
--forge-success: oklch(0.65 0.14 145);
|
|
142
|
+
/* Cyan, so it stays apart from the blue primary and brand */
|
|
143
|
+
--forge-info: oklch(0.6 0.11 215);
|
|
144
|
+
--forge-warning: oklch(0.85 0.16 81.95);
|
|
145
|
+
|
|
146
|
+
/* -------------------- INTERACTION COLORS -------------------- */
|
|
147
|
+
/* State layers, as Material 3: the text color laid over whatever is underneath, so hover and press show on
|
|
148
|
+
every surface in both themes. Translucent: an element with its own background stacks the layer on it,
|
|
149
|
+
background: linear-gradient(var(--forge-hover-bg) 0 0), <its background>. Dark mode doesn't redefine them,
|
|
150
|
+
they follow --forge-text-primary */
|
|
151
|
+
--forge-state-hover-opacity: 8%;
|
|
152
|
+
--forge-state-pressed-opacity: 12%;
|
|
153
|
+
--forge-hover-bg: color-mix(in srgb, var(--forge-text-primary) var(--forge-state-hover-opacity), transparent);
|
|
154
|
+
--forge-active-bg: color-mix(in srgb, var(--forge-text-primary) var(--forge-state-pressed-opacity), transparent);
|
|
155
|
+
|
|
156
|
+
--forge-brand-hover: oklch(0.56 0.13 var(--forge-brand-hue));
|
|
157
|
+
--forge-brand-active: oklch(0.52 0.14 var(--forge-brand-hue));
|
|
158
|
+
|
|
159
|
+
--forge-danger-hover: oklch(0.62 0.16 31.05);
|
|
160
|
+
--forge-danger-active: oklch(0.58 0.17 31.05);
|
|
161
|
+
|
|
162
|
+
/* The primary ink: at least 3:1 against every background, also the active one (WCAG 1.4.11). -strong is kept for
|
|
163
|
+
rings drawn inside an element; both are the same now */
|
|
164
|
+
--forge-focus-ring: var(--forge-primary);
|
|
165
|
+
--forge-focus-ring-strong: var(--forge-primary);
|
|
166
|
+
|
|
167
|
+
/* -------------------- MOTION -------------------- */
|
|
168
|
+
--forge-motion-fast: 120ms;
|
|
169
|
+
--forge-motion-base: 180ms;
|
|
170
|
+
--forge-motion-slow: 240ms;
|
|
171
|
+
|
|
172
|
+
--forge-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
|
173
|
+
--forge-ease-linear: linear;
|
|
174
|
+
|
|
175
|
+
--forge-motion-distance-sm: 4px;
|
|
176
|
+
--forge-motion-distance-md: 8px;
|
|
177
|
+
|
|
178
|
+
/* -------------------- STATES -------------------- */
|
|
179
|
+
--forge-opacity-disabled: 0.5;
|
|
180
|
+
|
|
181
|
+
/* -------------------- LAYERS -------------------- */
|
|
182
|
+
/* z-index inside the page. Overlay is the CDK overlay container's own value (not set by Forge); native
|
|
183
|
+
dialogs sit in the top layer above all of them */
|
|
184
|
+
--forge-z-raised: 1;
|
|
185
|
+
--forge-z-sticky: 10;
|
|
186
|
+
--forge-z-overlay: 1000;
|
|
187
|
+
--forge-z-drawer: 1040;
|
|
188
|
+
|
|
189
|
+
/* -------------------- SIZES -------------------- */
|
|
190
|
+
/* Heights of buttons and single-line fields, so they line up in a row (DS 2.0); icon buttons and icons take
|
|
191
|
+
theirs when they are reworked */
|
|
192
|
+
--forge-control-height-md: 2.25rem; /* 36px */
|
|
193
|
+
--forge-control-height-sm: 1.75rem; /* 28px */
|
|
194
|
+
--forge-icon-button-md: 1.75rem; /* 28px */
|
|
195
|
+
--forge-icon-button-sm: 1.375rem; /* 22px */
|
|
196
|
+
--forge-icon-sm: 0.875rem; /* 14px */
|
|
197
|
+
--forge-icon-md: 1rem; /* 16px */
|
|
198
|
+
--forge-icon-lg: 1.25rem; /* 20px */
|
|
199
|
+
|
|
200
|
+
/* -------------------- SKELETON TOKENS -------------------- */
|
|
201
|
+
--forge-skeleton-bg: var(--forge-surface-container-highest);
|
|
202
|
+
--forge-skeleton-fg: var(--forge-surface-container-high);
|
|
203
|
+
--forge-skeleton-radius: var(--forge-radius-sm);
|
|
204
|
+
--forge-skeleton-shimmer-duration: 1.2s;
|
|
205
|
+
|
|
206
|
+
/* -------------------- AVATAR TOKENS -------------------- */
|
|
207
|
+
/* Lightness and chroma of an avatar's identity color; the hue comes from the person (--forge-avatar-hue) */
|
|
208
|
+
--forge-avatar-bg-lightness: 0.96;
|
|
209
|
+
--forge-avatar-bg-chroma: 0.02;
|
|
210
|
+
--forge-avatar-fg-lightness: 0.55;
|
|
211
|
+
--forge-avatar-fg-chroma: 0.15;
|
|
212
|
+
|
|
213
|
+
/* -------------------- CATEGORY TOKENS -------------------- */
|
|
214
|
+
/* Categorical marks (tags, tag groups): eight bg / text pairs from the avatar's formula, blue first. Text
|
|
215
|
+
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
|
|
216
|
+
chroma is lowered to stay in the sRGB gamut. The avatar keeps its own ten hues */
|
|
217
|
+
--forge-cat-1-bg: oklch(0.96 0.02 239);
|
|
218
|
+
--forge-cat-1-text: oklch(0.53 0.115 239);
|
|
219
|
+
--forge-cat-2-bg: oklch(0.96 0.02 321.2);
|
|
220
|
+
--forge-cat-2-text: oklch(0.55 0.15 321.2);
|
|
221
|
+
--forge-cat-3-bg: oklch(0.96 0.02 294.8);
|
|
222
|
+
--forge-cat-3-text: oklch(0.55 0.15 294.8);
|
|
223
|
+
--forge-cat-4-bg: oklch(0.96 0.015 28.8);
|
|
224
|
+
--forge-cat-4-text: oklch(0.55 0.15 28.8);
|
|
225
|
+
--forge-cat-5-bg: oklch(0.96 0.02 183.4);
|
|
226
|
+
--forge-cat-5-text: oklch(0.53 0.09 183.4);
|
|
227
|
+
--forge-cat-6-bg: oklch(0.96 0.02 210.8);
|
|
228
|
+
--forge-cat-6-text: oklch(0.53 0.09 210.8);
|
|
229
|
+
--forge-cat-7-bg: oklch(0.96 0.02 130.5);
|
|
230
|
+
--forge-cat-7-text: oklch(0.53 0.14 130.5);
|
|
231
|
+
--forge-cat-8-bg: oklch(0.96 0.02 9.6);
|
|
232
|
+
--forge-cat-8-text: oklch(0.55 0.15 9.6);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/* ============================================================
|
|
237
|
+
DARK MODE (TOKEN OVERRIDES ONLY)
|
|
238
|
+
============================================================ */
|
|
239
|
+
|
|
240
|
+
@layer forge-theme {
|
|
241
|
+
/* ---- Dark mode ---- */
|
|
242
|
+
:root[data-theme="dark"] {
|
|
243
|
+
color-scheme: dark;
|
|
244
|
+
|
|
245
|
+
/* -------------------- SURFACES (TONE-BASED) -------------------- */
|
|
246
|
+
--forge-surface: oklch(0.16 var(--forge-chroma) var(--forge-hue));
|
|
247
|
+
--forge-surface-container-lowest: oklch(0.135 var(--forge-chroma) var(--forge-hue));
|
|
248
|
+
--forge-surface-container-low: oklch(0.18 var(--forge-chroma) var(--forge-hue));
|
|
249
|
+
--forge-surface-container: oklch(0.205 var(--forge-chroma) var(--forge-hue));
|
|
250
|
+
--forge-surface-container-high: oklch(0.24 var(--forge-chroma) var(--forge-hue));
|
|
251
|
+
--forge-surface-container-highest: oklch(0.28 var(--forge-chroma) var(--forge-hue));
|
|
252
|
+
--forge-surface-bright: oklch(0.24 var(--forge-chroma) var(--forge-hue));
|
|
253
|
+
|
|
254
|
+
--forge-text-primary: oklch(0.92 var(--forge-chroma) var(--forge-hue));
|
|
255
|
+
--forge-text-secondary: oklch(0.72 var(--forge-chroma) var(--forge-hue));
|
|
256
|
+
--forge-text-tertiary: oklch(0.635 var(--forge-chroma) var(--forge-hue));
|
|
257
|
+
|
|
258
|
+
--forge-border: oklch(0.3 var(--forge-chroma) var(--forge-hue));
|
|
259
|
+
--forge-border-strong: oklch(0.36 var(--forge-chroma) var(--forge-hue));
|
|
260
|
+
|
|
261
|
+
/* -------------------- SHADOWS -------------------- */
|
|
262
|
+
/* Rings lighter than the surface, drop shadows black and stronger to show on the dark surface */
|
|
263
|
+
--forge-shadow-rest:
|
|
264
|
+
0 1px 2px oklch(0 0 0 / 0.3),
|
|
265
|
+
0 0 0 1px oklch(0.3 var(--forge-chroma) var(--forge-hue));
|
|
266
|
+
|
|
267
|
+
/* Barely shows on the dark surface: the panel's edge there is the lighter container tone itself */
|
|
268
|
+
--forge-shadow-soft:
|
|
269
|
+
0 1px 3px oklch(0 0 0 / 0.3),
|
|
270
|
+
0 1px 2px oklch(0 0 0 / 0.2);
|
|
271
|
+
|
|
272
|
+
--forge-shadow-hover:
|
|
273
|
+
0 4px 8px oklch(0 0 0 / 0.4),
|
|
274
|
+
0 0 0 1px oklch(0.34 var(--forge-chroma) var(--forge-hue));
|
|
275
|
+
|
|
276
|
+
--forge-border-overlay: oklch(0.38 var(--forge-chroma) var(--forge-hue));
|
|
277
|
+
--forge-shadow-overlay: 0 12px 24px oklch(0 0 0 / 0.5);
|
|
278
|
+
|
|
279
|
+
--forge-border-modal: oklch(0.38 var(--forge-chroma) var(--forge-hue));
|
|
280
|
+
--forge-shadow-modal: 0 24px 48px oklch(0 0 0 / 0.6);
|
|
281
|
+
|
|
282
|
+
/* -------------------- SKELETON TOKENS -------------------- */
|
|
283
|
+
--forge-skeleton-bg: var(--forge-surface-container-high);
|
|
284
|
+
--forge-skeleton-fg: var(--forge-surface-container-highest);
|
|
285
|
+
|
|
286
|
+
/* -------------------- AVATAR TOKENS -------------------- */
|
|
287
|
+
--forge-avatar-bg-lightness: 0.32;
|
|
288
|
+
--forge-avatar-bg-chroma: 0.05;
|
|
289
|
+
--forge-avatar-fg-lightness: 0.85;
|
|
290
|
+
--forge-avatar-fg-chroma: 0.1;
|
|
291
|
+
|
|
292
|
+
/* -------------------- CATEGORY TOKENS -------------------- */
|
|
293
|
+
--forge-cat-1-bg: oklch(0.32 0.05 239);
|
|
294
|
+
--forge-cat-1-text: oklch(0.85 0.08 239);
|
|
295
|
+
--forge-cat-2-bg: oklch(0.32 0.05 321.2);
|
|
296
|
+
--forge-cat-2-text: oklch(0.85 0.1 321.2);
|
|
297
|
+
--forge-cat-3-bg: oklch(0.32 0.05 294.8);
|
|
298
|
+
--forge-cat-3-text: oklch(0.85 0.08 294.8);
|
|
299
|
+
--forge-cat-4-bg: oklch(0.32 0.05 28.8);
|
|
300
|
+
--forge-cat-4-text: oklch(0.85 0.08 28.8);
|
|
301
|
+
--forge-cat-5-bg: oklch(0.32 0.05 183.4);
|
|
302
|
+
--forge-cat-5-text: oklch(0.85 0.1 183.4);
|
|
303
|
+
--forge-cat-6-bg: oklch(0.32 0.05 210.8);
|
|
304
|
+
--forge-cat-6-text: oklch(0.85 0.1 210.8);
|
|
305
|
+
--forge-cat-7-bg: oklch(0.32 0.05 130.5);
|
|
306
|
+
--forge-cat-7-text: oklch(0.85 0.1 130.5);
|
|
307
|
+
--forge-cat-8-bg: oklch(0.32 0.05 9.6);
|
|
308
|
+
--forge-cat-8-text: oklch(0.85 0.08 9.6);
|
|
309
|
+
|
|
310
|
+
/* A lighter blue with dark text on it (7.4:1); hover and active get lighter still */
|
|
311
|
+
--forge-primary: oklch(0.72 var(--forge-primary-chroma) var(--forge-primary-hue));
|
|
312
|
+
--forge-primary-hover: oklch(0.77 var(--forge-primary-chroma) var(--forge-primary-hue));
|
|
313
|
+
--forge-primary-active: oklch(0.82 0.101 var(--forge-primary-hue));
|
|
314
|
+
--forge-text-on-primary: oklch(0.2 var(--forge-chroma) var(--forge-hue));
|
|
315
|
+
|
|
316
|
+
--forge-brand-hover: oklch(0.66 0.13 var(--forge-brand-hue));
|
|
317
|
+
--forge-brand-active: oklch(0.72 0.14 var(--forge-brand-hue));
|
|
318
|
+
--forge-brand-text: oklch(0.74 0.11 var(--forge-brand-hue));
|
|
319
|
+
|
|
320
|
+
--forge-danger-hover: oklch(0.71 0.16 31.05);
|
|
321
|
+
--forge-danger-active: oklch(0.76 0.17 31.05);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
:root[data-theme="light"],
|
|
325
|
+
:root:not([data-theme]) {
|
|
326
|
+
color-scheme: light;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* ---- Density ---- */
|
|
330
|
+
[data-density="compact"] {
|
|
331
|
+
--forge-space-1: 0.125rem;
|
|
332
|
+
--forge-space-2: 0.375rem;
|
|
333
|
+
--forge-space-3: 0.5rem;
|
|
334
|
+
--forge-space-4: 0.75rem;
|
|
335
|
+
--forge-space-5: 1rem;
|
|
336
|
+
--forge-space-6: 1.5rem;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|