@creatio-devkit/common 0.1000.3 → 0.1001.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/AI_GUIDES_INDEX.md +9 -4
- package/CHANGELOG.md +2 -1
- package/DESIGN_TOKENS_AI_GUIDE.md +366 -0
- package/REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md +5 -3
- package/REMOTE_COMPONENT_STYLING_AI_GUIDE.md +179 -0
- package/THIRD_PARTY_LICENSES.txt +12 -12
- package/fesm2022/creatio-devkit-common.mjs +17 -3
- package/fesm2022/creatio-devkit-common.mjs.map +1 -1
- package/package.json +2 -2
- package/types/creatio-devkit-common.d.ts +7 -0
package/AI_GUIDES_INDEX.md
CHANGED
|
@@ -8,6 +8,8 @@ These guides are complementary. In many tasks, you should read more than one.
|
|
|
8
8
|
|
|
9
9
|
- Use [DEFERRED_REMOTE_MIGRATION_AI_GUIDE.md](./DEFERRED_REMOTE_MIGRATION_AI_GUIDE.md) when migrating an existing remote entry from the old eager bootstrap flow to the deferred remote contract.
|
|
10
10
|
- Use [REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md](./REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md) when creating or updating the runtime part of a Freedom UI custom component.
|
|
11
|
+
- Use [REMOTE_COMPONENT_STYLING_AI_GUIDE.md](./REMOTE_COMPONENT_STYLING_AI_GUIDE.md) whenever a runtime component's `.scss`/template visuals are generated or modified. Treat it as mandatory.
|
|
12
|
+
- Use [DESIGN_TOKENS_AI_GUIDE.md](./DESIGN_TOKENS_AI_GUIDE.md) as the catalog of all `--crt-*` design token names and default values. It is a reference, not a task entry point.
|
|
11
13
|
- Use [WCAG_ACCESSIBILITY_AI_GUIDE.md](./WCAG_ACCESSIBILITY_AI_GUIDE.md) for any user-facing component work. Treat it as mandatory for runtime component development.
|
|
12
14
|
- Use [ICON_REQUIREMENTS_AI_GUIDE.md](./ICON_REQUIREMENTS_AI_GUIDE.md) when a component appears in Interface Designer, publishes designer metadata, or needs a toolbar icon.
|
|
13
15
|
|
|
@@ -15,8 +17,10 @@ These guides are complementary. In many tasks, you should read more than one.
|
|
|
15
17
|
|
|
16
18
|
| Task | Primary guide | Also read | Notes |
|
|
17
19
|
| --- | --- | --- | --- |
|
|
18
|
-
| Create a new runtime-only Freedom UI component | [REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md](./REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md) | [WCAG_ACCESSIBILITY_AI_GUIDE.md](./WCAG_ACCESSIBILITY_AI_GUIDE.md) | Default path for user-facing runtime component implementation. |
|
|
19
|
-
|
|
|
20
|
+
| Create a new runtime-only Freedom UI component | [REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md](./REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md) | [REMOTE_COMPONENT_STYLING_AI_GUIDE.md](./REMOTE_COMPONENT_STYLING_AI_GUIDE.md), [WCAG_ACCESSIBILITY_AI_GUIDE.md](./WCAG_ACCESSIBILITY_AI_GUIDE.md) | Default path for user-facing runtime component implementation. |
|
|
21
|
+
| Style a runtime component / make it look native | [REMOTE_COMPONENT_STYLING_AI_GUIDE.md](./REMOTE_COMPONENT_STYLING_AI_GUIDE.md) | [DESIGN_TOKENS_AI_GUIDE.md](./DESIGN_TOKENS_AI_GUIDE.md), [REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md](./REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md), [WCAG_ACCESSIBILITY_AI_GUIDE.md](./WCAG_ACCESSIBILITY_AI_GUIDE.md) | Use when the task is about colors, fonts, spacing, or theming. Token names/values come from the tokens catalog. |
|
|
22
|
+
| Look up a design token name or default value | [DESIGN_TOKENS_AI_GUIDE.md](./DESIGN_TOKENS_AI_GUIDE.md) | [REMOTE_COMPONENT_STYLING_AI_GUIDE.md](./REMOTE_COMPONENT_STYLING_AI_GUIDE.md) | Catalog of all `--crt-*` tokens (semantic, palette, typography, spacing, radius). Reference only — consumption rules live in the styling guide. |
|
|
23
|
+
| Create a component that also appears in Interface Designer | [REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md](./REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md) | [REMOTE_COMPONENT_STYLING_AI_GUIDE.md](./REMOTE_COMPONENT_STYLING_AI_GUIDE.md), [WCAG_ACCESSIBILITY_AI_GUIDE.md](./WCAG_ACCESSIBILITY_AI_GUIDE.md), [ICON_REQUIREMENTS_AI_GUIDE.md](./ICON_REQUIREMENTS_AI_GUIDE.md) | Runtime behavior, styling, accessibility, and designer icon requirements all apply. |
|
|
20
24
|
| Add or update a toolbar icon for a designer-visible component | [ICON_REQUIREMENTS_AI_GUIDE.md](./ICON_REQUIREMENTS_AI_GUIDE.md) | [REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md](./REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md) if runtime metadata is also changing | Use this when the task is mainly about icon assets or designer presentation. |
|
|
21
25
|
| Review or fix keyboard navigation, ARIA, labels, focus, or screen-reader behavior | [WCAG_ACCESSIBILITY_AI_GUIDE.md](./WCAG_ACCESSIBILITY_AI_GUIDE.md) | [REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md](./REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md) if component code also changes | Use this for accessibility-first work. |
|
|
22
26
|
| Migrate an old eager remote to the deferred remote contract | [DEFERRED_REMOTE_MIGRATION_AI_GUIDE.md](./DEFERRED_REMOTE_MIGRATION_AI_GUIDE.md) | | Use this when the current remote still bootstraps via `main.ts -> bootstrap.ts -> AppModule`. The same guide can also support staged migration, but do not assume the final state must already be fully deferred unless the task says so. |
|
|
@@ -26,8 +30,9 @@ These guides are complementary. In many tasks, you should read more than one.
|
|
|
26
30
|
|
|
27
31
|
1. If the task is about changing the remote entry architecture from eager bootstrap toward deferred features, start with [DEFERRED_REMOTE_MIGRATION_AI_GUIDE.md](./DEFERRED_REMOTE_MIGRATION_AI_GUIDE.md). This includes full migrations and staged migrations, but do not assume the final state must already be pure deferred unless the task says so explicitly.
|
|
28
32
|
2. Otherwise, if the task is about component runtime behavior, inputs, outputs, rendering, handlers, validators, or registration, start with [REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md](./REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md).
|
|
29
|
-
3.
|
|
30
|
-
4. If the
|
|
33
|
+
3. Whenever the component has visuals (any `.scss` or styled template), also read [REMOTE_COMPONENT_STYLING_AI_GUIDE.md](./REMOTE_COMPONENT_STYLING_AI_GUIDE.md). It is the authoritative source for design-token usage; the token names and default values it references live in [DESIGN_TOKENS_AI_GUIDE.md](./DESIGN_TOKENS_AI_GUIDE.md).
|
|
34
|
+
4. If the task affects a user-facing component, also read [WCAG_ACCESSIBILITY_AI_GUIDE.md](./WCAG_ACCESSIBILITY_AI_GUIDE.md).
|
|
35
|
+
5. If the component is visible in Interface Designer or the task includes icon work, also read [ICON_REQUIREMENTS_AI_GUIDE.md](./ICON_REQUIREMENTS_AI_GUIDE.md).
|
|
31
36
|
|
|
32
37
|
## When You Are Unsure
|
|
33
38
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
# 0.
|
|
1
|
+
# 0.1001.0
|
|
2
|
+
- fix - `BaseViewElementRegistry.getViewElementPropertiesDefaultValues` no longer reports a synthetic `visible: true` default for a type that is absent from the view element registry. Entries that are plain configuration objects rather than registered view elements (for example timeline quick filters such as `TimelineFilter_Entity`) previously inherited that default, which made the design time defaults filter strip `visible` from the saved schema. Registered types, including minimal or lazy stub registrations, keep reporting the default unchanged.
|
|
2
3
|
- fix - Published typings are the API Extractor trimmed rollup again: the `package.json` types entry now points at the trimmed d.ts, so `@internal` declarations are no longer visible to consumers (regression since the Angular 21 upgrade).
|
|
3
4
|
- feature - `DataSourceLoadParameters` is now `@public`.
|
|
4
5
|
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
# Design Tokens AI Guide
|
|
2
|
+
|
|
3
|
+
**ATTENTION AI AGENT:** This is a reference catalog, not documentation. Use these token names and default values exactly.
|
|
4
|
+
|
|
5
|
+
**Audience:** Any AI guide or task that needs Creatio `--crt-*` design token names and values.
|
|
6
|
+
|
|
7
|
+
**Scope:** All globally-defined `--crt-*` design tokens — those declared on `:root` or the active theme's root, which therefore inherit everywhere (including into a runtime component's shadow root): names, default-theme values, naming conventions, and where each token is defined (its scope). All documented values are those of Creatio's **default theme**; other themes redefine the theme tokens (primitives stay constant).
|
|
8
|
+
|
|
9
|
+
**Related guide:** `REMOTE_COMPONENT_STYLING_AI_GUIDE.md` — how a Shadow DOM runtime component consumes these tokens via `var(--crt-..., <fallback>)`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Naming conventions
|
|
14
|
+
|
|
15
|
+
- **Intents:** `primary` (main brand — primary actions, links, selection), `secondary` (headings, actionable text, base icons, secondary CTAs), `accent` (highlights and active-state emphasis — e.g. active tab, current-day marker), `error` / `success` (status messaging).
|
|
16
|
+
- **`on-<intent>`** = text/icon color to place **on top of** that intent's fill (ensures contrast).
|
|
17
|
+
- **`subtle`** = lightest tint, **`soft`** = light tint; `-hover` / `-selected` = interaction states. For intent background fills that gap is `palette-10` vs `palette-50`: a `-subtle` fill sits almost on top of `background-base` and can be nearly invisible there — when a tinted surface must read as distinct from an adjacent base surface, use `-soft`.
|
|
18
|
+
- Most components only need `text-body`, `text-muted`, `background-base`, `border-base`; reach for intent variants for emphasis, states, and messaging.
|
|
19
|
+
- **Prefer semantic tokens over raw palette/primitive tokens** — semantic tokens already encode the right shade per theme and adapt automatically.
|
|
20
|
+
|
|
21
|
+
This catalog is split into two blocks: **Theme tokens** (set by the active theme — palettes, colors, typography, font-family) and **Primitives** (the theme-independent `:root` foundation — spacing, radius, font/size scales, weights, base + glass colors).
|
|
22
|
+
|
|
23
|
+
In every table, the **Default** column gives the token's value under Creatio's default theme — a literal for primitives, or a `var(--crt-...)` reference for theme tokens (follow the reference to its own table for the literal).
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Theme tokens
|
|
28
|
+
|
|
29
|
+
Declared per theme on the active theme's root class. They adapt when the theme changes. Prefer the semantic color and typography-role tokens; **palettes** and **font-family** are the raw theme foundations those build on.
|
|
30
|
+
|
|
31
|
+
### Colors · Text
|
|
32
|
+
|
|
33
|
+
| Purpose | Token | Default |
|
|
34
|
+
|---------|-------|---------|
|
|
35
|
+
| Default body text | `--crt-color-text-body` | `var(--crt-color-base-dark)` |
|
|
36
|
+
| Secondary / muted text | `--crt-color-text-muted` | `var(--crt-palette-neutral-600)` |
|
|
37
|
+
| Heading text | `--crt-color-text-heading` | `var(--crt-palette-secondary-500)` |
|
|
38
|
+
| Disabled text | `--crt-color-text-disabled` | `var(--crt-palette-neutral-500)` |
|
|
39
|
+
| Link text | `--crt-color-text-link` | `var(--crt-palette-primary-500)` |
|
|
40
|
+
| Link text (hover) | `--crt-color-text-link-hover` | `var(--crt-palette-primary-600)` |
|
|
41
|
+
| Actionable text | `--crt-color-text-action` | `var(--crt-palette-secondary-500)` |
|
|
42
|
+
| Actionable text (hover) | `--crt-color-text-action-hover` | `var(--crt-palette-primary-500)` |
|
|
43
|
+
| Primary-intent text | `--crt-color-text-primary` | `var(--crt-palette-primary-500)` |
|
|
44
|
+
| Text on primary fill | `--crt-color-text-on-primary` | `var(--crt-color-base-light)` |
|
|
45
|
+
| Text on primary subtle fill | `--crt-color-text-on-primary-subtle` | `var(--crt-palette-primary-900)` |
|
|
46
|
+
| Text on primary soft fill | `--crt-color-text-on-primary-soft` | `var(--crt-palette-primary-900)` |
|
|
47
|
+
| Secondary-intent text | `--crt-color-text-secondary` | `var(--crt-palette-secondary-500)` |
|
|
48
|
+
| Text on secondary fill | `--crt-color-text-on-secondary` | `var(--crt-color-base-light)` |
|
|
49
|
+
| Text on secondary subtle fill | `--crt-color-text-on-secondary-subtle` | `var(--crt-palette-secondary-900)` |
|
|
50
|
+
| Text on secondary soft fill | `--crt-color-text-on-secondary-soft` | `var(--crt-palette-secondary-900)` |
|
|
51
|
+
| Accent-intent text | `--crt-color-text-accent` | `var(--crt-palette-accent-500)` |
|
|
52
|
+
| Text on accent fill | `--crt-color-text-on-accent` | `var(--crt-color-base-light)` |
|
|
53
|
+
| Text on accent subtle fill | `--crt-color-text-on-accent-subtle` | `var(--crt-palette-accent-900)` |
|
|
54
|
+
| Text on accent soft fill | `--crt-color-text-on-accent-soft` | `var(--crt-palette-accent-900)` |
|
|
55
|
+
| Error text | `--crt-color-text-error` | `var(--crt-palette-error-500)` |
|
|
56
|
+
| Text on error fill | `--crt-color-text-on-error` | `var(--crt-color-base-light)` |
|
|
57
|
+
| Text on error subtle fill | `--crt-color-text-on-error-subtle` | `var(--crt-palette-error-900)` |
|
|
58
|
+
| Text on error soft fill | `--crt-color-text-on-error-soft` | `var(--crt-palette-error-900)` |
|
|
59
|
+
| Success text | `--crt-color-text-success` | `var(--crt-palette-success-500)` |
|
|
60
|
+
| Text on success fill | `--crt-color-text-on-success` | `var(--crt-color-base-light)` |
|
|
61
|
+
| Text on success subtle fill | `--crt-color-text-on-success-subtle` | `var(--crt-palette-success-900)` |
|
|
62
|
+
| Text on success soft fill | `--crt-color-text-on-success-soft` | `var(--crt-palette-success-900)` |
|
|
63
|
+
|
|
64
|
+
### Colors · Background
|
|
65
|
+
|
|
66
|
+
| Purpose | Token | Default |
|
|
67
|
+
|---------|-------|---------|
|
|
68
|
+
| Component / page background | `--crt-color-background-base` | `var(--crt-color-base-light)` |
|
|
69
|
+
| Canvas (translucent base) | `--crt-color-background-canvas` | `rgb(from var(--crt-color-background-base) r g b / 90%)` |
|
|
70
|
+
| Hover surface (generic) | `--crt-color-background-interaction-hover` | `var(--crt-palette-primary-25)` |
|
|
71
|
+
| Selected surface (generic) | `--crt-color-background-interaction-selected` | `var(--crt-palette-primary-50)` |
|
|
72
|
+
| Disabled surface (subtle) | `--crt-color-background-disabled-subtle` | `var(--crt-palette-neutral-50)` |
|
|
73
|
+
| Disabled surface (soft) | `--crt-color-background-disabled-soft` | `var(--crt-palette-neutral-200)` |
|
|
74
|
+
| Primary fill | `--crt-color-background-primary` | `var(--crt-palette-primary-500)` |
|
|
75
|
+
| Primary fill (hover) | `--crt-color-background-primary-hover` | `var(--crt-palette-primary-600)` |
|
|
76
|
+
| Primary fill (selected) | `--crt-color-background-primary-selected` | `var(--crt-palette-primary-700)` |
|
|
77
|
+
| Primary subtle | `--crt-color-background-primary-subtle` | `var(--crt-palette-primary-10)` |
|
|
78
|
+
| Primary subtle (hover) | `--crt-color-background-primary-subtle-hover` | `var(--crt-palette-primary-25)` |
|
|
79
|
+
| Primary subtle (selected) | `--crt-color-background-primary-subtle-selected` | `var(--crt-palette-primary-50)` |
|
|
80
|
+
| Primary soft | `--crt-color-background-primary-soft` | `var(--crt-palette-primary-50)` |
|
|
81
|
+
| Primary soft (hover) | `--crt-color-background-primary-soft-hover` | `var(--crt-palette-primary-100)` |
|
|
82
|
+
| Primary soft (selected) | `--crt-color-background-primary-soft-selected` | `var(--crt-palette-primary-200)` |
|
|
83
|
+
| Secondary fill | `--crt-color-background-secondary` | `var(--crt-palette-secondary-500)` |
|
|
84
|
+
| Secondary fill (hover) | `--crt-color-background-secondary-hover` | `var(--crt-palette-secondary-600)` |
|
|
85
|
+
| Secondary fill (selected) | `--crt-color-background-secondary-selected` | `var(--crt-palette-secondary-700)` |
|
|
86
|
+
| Secondary subtle | `--crt-color-background-secondary-subtle` | `var(--crt-palette-secondary-10)` |
|
|
87
|
+
| Secondary subtle (hover) | `--crt-color-background-secondary-subtle-hover` | `var(--crt-palette-secondary-25)` |
|
|
88
|
+
| Secondary subtle (selected) | `--crt-color-background-secondary-subtle-selected` | `var(--crt-palette-secondary-50)` |
|
|
89
|
+
| Secondary soft | `--crt-color-background-secondary-soft` | `var(--crt-palette-secondary-50)` |
|
|
90
|
+
| Secondary soft (hover) | `--crt-color-background-secondary-soft-hover` | `var(--crt-palette-secondary-100)` |
|
|
91
|
+
| Secondary soft (selected) | `--crt-color-background-secondary-soft-selected` | `var(--crt-palette-secondary-200)` |
|
|
92
|
+
| Accent fill | `--crt-color-background-accent` | `var(--crt-palette-accent-500)` |
|
|
93
|
+
| Accent fill (hover) | `--crt-color-background-accent-hover` | `var(--crt-palette-accent-600)` |
|
|
94
|
+
| Accent fill (selected) | `--crt-color-background-accent-selected` | `var(--crt-palette-accent-700)` |
|
|
95
|
+
| Accent subtle | `--crt-color-background-accent-subtle` | `var(--crt-palette-accent-10)` |
|
|
96
|
+
| Accent subtle (hover) | `--crt-color-background-accent-subtle-hover` | `var(--crt-palette-accent-25)` |
|
|
97
|
+
| Accent subtle (selected) | `--crt-color-background-accent-subtle-selected` | `var(--crt-palette-accent-50)` |
|
|
98
|
+
| Accent soft | `--crt-color-background-accent-soft` | `var(--crt-palette-accent-50)` |
|
|
99
|
+
| Accent soft (hover) | `--crt-color-background-accent-soft-hover` | `var(--crt-palette-accent-100)` |
|
|
100
|
+
| Accent soft (selected) | `--crt-color-background-accent-soft-selected` | `var(--crt-palette-accent-200)` |
|
|
101
|
+
| Error fill | `--crt-color-background-error` | `var(--crt-palette-error-500)` |
|
|
102
|
+
| Error fill (hover) | `--crt-color-background-error-hover` | `var(--crt-palette-error-600)` |
|
|
103
|
+
| Error fill (selected) | `--crt-color-background-error-selected` | `var(--crt-palette-error-700)` |
|
|
104
|
+
| Error subtle | `--crt-color-background-error-subtle` | `var(--crt-palette-error-10)` |
|
|
105
|
+
| Error subtle (hover) | `--crt-color-background-error-subtle-hover` | `var(--crt-palette-error-25)` |
|
|
106
|
+
| Error subtle (selected) | `--crt-color-background-error-subtle-selected` | `var(--crt-palette-error-50)` |
|
|
107
|
+
| Error soft | `--crt-color-background-error-soft` | `var(--crt-palette-error-50)` |
|
|
108
|
+
| Error soft (hover) | `--crt-color-background-error-soft-hover` | `var(--crt-palette-error-100)` |
|
|
109
|
+
| Error soft (selected) | `--crt-color-background-error-soft-selected` | `var(--crt-palette-error-200)` |
|
|
110
|
+
| Success fill | `--crt-color-background-success` | `var(--crt-palette-success-500)` |
|
|
111
|
+
| Success fill (hover) | `--crt-color-background-success-hover` | `var(--crt-palette-success-600)` |
|
|
112
|
+
| Success fill (selected) | `--crt-color-background-success-selected` | `var(--crt-palette-success-700)` |
|
|
113
|
+
| Success subtle | `--crt-color-background-success-subtle` | `var(--crt-palette-success-10)` |
|
|
114
|
+
| Success subtle (hover) | `--crt-color-background-success-subtle-hover` | `var(--crt-palette-success-25)` |
|
|
115
|
+
| Success subtle (selected) | `--crt-color-background-success-subtle-selected` | `var(--crt-palette-success-50)` |
|
|
116
|
+
| Success soft | `--crt-color-background-success-soft` | `var(--crt-palette-success-50)` |
|
|
117
|
+
| Success soft (hover) | `--crt-color-background-success-soft-hover` | `var(--crt-palette-success-100)` |
|
|
118
|
+
| Success soft (selected) | `--crt-color-background-success-soft-selected` | `var(--crt-palette-success-200)` |
|
|
119
|
+
|
|
120
|
+
### Colors · Border
|
|
121
|
+
|
|
122
|
+
| Purpose | Token | Default |
|
|
123
|
+
|---------|-------|---------|
|
|
124
|
+
| Default border | `--crt-color-border-base` | `var(--crt-palette-neutral-100)` |
|
|
125
|
+
| Muted border | `--crt-color-border-muted` | `var(--crt-palette-neutral-50)` |
|
|
126
|
+
| Selected / focused border | `--crt-color-border-selected` | `var(--crt-palette-primary-500)` |
|
|
127
|
+
| Disabled border | `--crt-color-border-disabled` | `var(--crt-palette-neutral-100)` |
|
|
128
|
+
| Primary border | `--crt-color-border-primary` | `var(--crt-palette-primary-500)` |
|
|
129
|
+
| Primary border (subtle) | `--crt-color-border-primary-subtle` | `var(--crt-palette-primary-100)` |
|
|
130
|
+
| Primary border (soft) | `--crt-color-border-primary-soft` | `var(--crt-palette-primary-200)` |
|
|
131
|
+
| Secondary border | `--crt-color-border-secondary` | `var(--crt-palette-secondary-500)` |
|
|
132
|
+
| Secondary border (subtle) | `--crt-color-border-secondary-subtle` | `var(--crt-palette-secondary-100)` |
|
|
133
|
+
| Secondary border (soft) | `--crt-color-border-secondary-soft` | `var(--crt-palette-secondary-200)` |
|
|
134
|
+
| Accent border | `--crt-color-border-accent` | `var(--crt-palette-accent-500)` |
|
|
135
|
+
| Accent border (subtle) | `--crt-color-border-accent-subtle` | `var(--crt-palette-accent-100)` |
|
|
136
|
+
| Accent border (soft) | `--crt-color-border-accent-soft` | `var(--crt-palette-accent-200)` |
|
|
137
|
+
| Error border | `--crt-color-border-error` | `var(--crt-palette-error-500)` |
|
|
138
|
+
| Error border (subtle) | `--crt-color-border-error-subtle` | `var(--crt-palette-error-100)` |
|
|
139
|
+
| Error border (soft) | `--crt-color-border-error-soft` | `var(--crt-palette-error-200)` |
|
|
140
|
+
| Success border | `--crt-color-border-success` | `var(--crt-palette-success-500)` |
|
|
141
|
+
| Success border (subtle) | `--crt-color-border-success-subtle` | `var(--crt-palette-success-100)` |
|
|
142
|
+
| Success border (soft) | `--crt-color-border-success-soft` | `var(--crt-palette-success-200)` |
|
|
143
|
+
|
|
144
|
+
### Colors · Icon
|
|
145
|
+
|
|
146
|
+
| Purpose | Token | Default |
|
|
147
|
+
|---------|-------|---------|
|
|
148
|
+
| Base icon | `--crt-color-icon-base` | `var(--crt-palette-secondary-500)` |
|
|
149
|
+
| Actionable icon | `--crt-color-icon-action` | `var(--crt-color-text-action)` |
|
|
150
|
+
| Actionable icon (hover) | `--crt-color-icon-action-hover` | `var(--crt-color-text-action-hover)` |
|
|
151
|
+
| Muted icon | `--crt-color-icon-muted` | `var(--crt-color-text-muted)` |
|
|
152
|
+
| Disabled icon | `--crt-color-icon-disabled` | `var(--crt-color-text-disabled)` |
|
|
153
|
+
| Primary icon | `--crt-color-icon-primary` | `var(--crt-color-text-primary)` |
|
|
154
|
+
| Icon on primary fill | `--crt-color-icon-on-primary` | `var(--crt-color-text-on-primary)` |
|
|
155
|
+
| Icon on primary subtle fill | `--crt-color-icon-on-primary-subtle` | `var(--crt-color-text-on-primary-subtle)` |
|
|
156
|
+
| Icon on primary soft fill | `--crt-color-icon-on-primary-soft` | `var(--crt-color-text-on-primary-soft)` |
|
|
157
|
+
| Secondary icon | `--crt-color-icon-secondary` | `var(--crt-color-text-secondary)` |
|
|
158
|
+
| Icon on secondary fill | `--crt-color-icon-on-secondary` | `var(--crt-color-text-on-secondary)` |
|
|
159
|
+
| Icon on secondary subtle fill | `--crt-color-icon-on-secondary-subtle` | `var(--crt-color-text-on-secondary-subtle)` |
|
|
160
|
+
| Icon on secondary soft fill | `--crt-color-icon-on-secondary-soft` | `var(--crt-color-text-on-secondary-soft)` |
|
|
161
|
+
| Accent icon | `--crt-color-icon-accent` | `var(--crt-color-text-accent)` |
|
|
162
|
+
| Icon on accent fill | `--crt-color-icon-on-accent` | `var(--crt-color-text-on-accent)` |
|
|
163
|
+
| Icon on accent subtle fill | `--crt-color-icon-on-accent-subtle` | `var(--crt-color-text-on-accent-subtle)` |
|
|
164
|
+
| Icon on accent soft fill | `--crt-color-icon-on-accent-soft` | `var(--crt-color-text-on-accent-soft)` |
|
|
165
|
+
| Error icon | `--crt-color-icon-error` | `var(--crt-color-text-error)` |
|
|
166
|
+
| Icon on error fill | `--crt-color-icon-on-error` | `var(--crt-color-text-on-error)` |
|
|
167
|
+
| Icon on error subtle fill | `--crt-color-icon-on-error-subtle` | `var(--crt-color-text-on-error-subtle)` |
|
|
168
|
+
| Icon on error soft fill | `--crt-color-icon-on-error-soft` | `var(--crt-color-text-on-error-soft)` |
|
|
169
|
+
| Success icon | `--crt-color-icon-success` | `var(--crt-color-text-success)` |
|
|
170
|
+
| Icon on success fill | `--crt-color-icon-on-success` | `var(--crt-color-text-on-success)` |
|
|
171
|
+
| Icon on success subtle fill | `--crt-color-icon-on-success-subtle` | `var(--crt-color-text-on-success-subtle)` |
|
|
172
|
+
| Icon on success soft fill | `--crt-color-icon-on-success-soft` | `var(--crt-color-text-on-success-soft)` |
|
|
173
|
+
|
|
174
|
+
### Colors · Effect
|
|
175
|
+
|
|
176
|
+
| Purpose | Token | Default |
|
|
177
|
+
|---------|-------|---------|
|
|
178
|
+
| Drop shadow color | `--crt-color-shadow` | `rgb(from var(--crt-color-base-dark) r g b / 10%)` |
|
|
179
|
+
|
|
180
|
+
### Palettes
|
|
181
|
+
|
|
182
|
+
`--crt-palette-<hue>-<shade>`. Hues: `primary`, `secondary`, `accent`, `neutral`, `error`, `success`. Shades: `10, 25, 50, 100, 200, 300, 400, 500, 600, 700, 800, 900` (`500` is the base). Prefer a semantic token over a raw palette token; use palettes only for bespoke visuals (charts, custom badges) where no semantic role fits.
|
|
183
|
+
|
|
184
|
+
| Shade | primary | secondary | accent | neutral | error | success |
|
|
185
|
+
|-------|---------|-----------|--------|---------|-------|---------|
|
|
186
|
+
| 10 | `#f7f8fb` | `#f6f7f8` | `#fdf8f7` | `#f9f9f9` | `#fcf8f7` | `#f7f9f7` |
|
|
187
|
+
| 25 | `#eff4fb` | `#eef0f2` | `#fef4f1` | `#f4f4f4` | `#fbf2f0` | `#f1f6f0` |
|
|
188
|
+
| 50 | `#e3ebfa` | `#e1e5e9` | `#ffece7` | `#ededed` | `#fbe9e5` | `#e6f0e5` |
|
|
189
|
+
| 100 | `#cbdbf8` | `#c8cfd7` | `#ffddd5` | `#dfdfdf` | `#f9d7cf` | `#d1e4ce` |
|
|
190
|
+
| 200 | `#9bbaf2` | `#96a4b3` | `#ffbeaf` | `#c4c4c4` | `#f4b2a3` | `#a6cda2` |
|
|
191
|
+
| 300 | `#6c99ea` | `#667b91` | `#ff9c86` | `#a9a9a9` | `#eb8c77` | `#7cb575` |
|
|
192
|
+
| 400 | `#3d76e1` | `#39536f` | `#ff7659` | `#8e8e8e` | `#e0634a` | `#4f9d47` |
|
|
193
|
+
| 500 | `#004fd6` | `#0d2e4e` | `#ff4013` | `#757575` | `#d2310d` | `#0b8500` |
|
|
194
|
+
| 600 | `#0041b5` | `#072949` | `#d42d00` | `#606060` | `#b12200` | `#076e00` |
|
|
195
|
+
| 700 | `#003495` | `#032443` | `#a72100` | `#4c4c4c` | `#8e1900` | `#045900` |
|
|
196
|
+
| 800 | `#002877` | `#001f3e` | `#7d1600` | `#393939` | `#6d1100` | `#024400` |
|
|
197
|
+
| 900 | `#001c5a` | `#001b37` | `#550b00` | `#272727` | `#4d0900` | `#013000` |
|
|
198
|
+
|
|
199
|
+
### Typography
|
|
200
|
+
|
|
201
|
+
Each role exposes `-font-family`, `-font-size`, `-font-weight`, `-line-height`, and `-letter-spacing` tokens. Pick the role that matches the UI element; common roles first, `large-*` are display sizes used rarely.
|
|
202
|
+
|
|
203
|
+
| Role | When to use | size / weight / line-height / letter-spacing | font-family |
|
|
204
|
+
|------|-------------|----------------------------------------------|-------------|
|
|
205
|
+
| `--crt-body-1-*` | Primary body text | 14 / 500 / 20 / 0 | `--crt-font-family-body` |
|
|
206
|
+
| `--crt-body-2-*` | **Default UI text** (labels, values, table cells) | 13 / 500 / 20 / 0 | `--crt-font-family-body` |
|
|
207
|
+
| `--crt-caption-*` | Captions, helper text, field labels | 12 / 500 / 16 / 0 | `--crt-font-family-body` |
|
|
208
|
+
| `--crt-headline-1-*` | Page-level title | 24 / 600 / 32 / 0 | `--crt-font-family-heading` |
|
|
209
|
+
| `--crt-headline-2-*` | Card / widget title | 20 / 500 / 26 / 0 | `--crt-font-family-heading` |
|
|
210
|
+
| `--crt-headline-3-*` | Section title | 18 / 500 / 24 / 0 | `--crt-font-family-heading` |
|
|
211
|
+
| `--crt-headline-4-*` | Small section title | 16 / 500 / 20 / 0 | `--crt-font-family-heading` |
|
|
212
|
+
| `--crt-headline-5-*` | Smallest / dense title | 14 / 500 / 18 / 0 | `--crt-font-family-heading` |
|
|
213
|
+
| `--crt-button-*` | Button label | 14 / 500 / 16 / 0 | `--crt-font-family-body` |
|
|
214
|
+
| `--crt-button-small-*` | Compact button label | 12 / 500 / 16 / 0 | `--crt-font-family-body` |
|
|
215
|
+
| `--crt-overline-*` | Overline / tiny tracked label | 10 / 400 / 12 / 0.05em | `--crt-font-family-body` |
|
|
216
|
+
| `--crt-large-1-*` | Hero / splash display | 54 / 500 / 70 / 0 | `--crt-font-family-heading` |
|
|
217
|
+
| `--crt-large-2-*` | Large display | 36 / 500 / 44 / 0 | `--crt-font-family-heading` |
|
|
218
|
+
| `--crt-large-3-*` | Display | 32 / 500 / 40 / 0 | `--crt-font-family-heading` |
|
|
219
|
+
| `--crt-large-4-*` | Small display | 28 / 500 / 36 / 0 | `--crt-font-family-heading` |
|
|
220
|
+
|
|
221
|
+
### Font family
|
|
222
|
+
|
|
223
|
+
| Token | Default |
|
|
224
|
+
|-------|---------|
|
|
225
|
+
| `--crt-font-family-heading` | `'Montserrat', sans-serif` |
|
|
226
|
+
| `--crt-font-family-body` | `'Montserrat', sans-serif` |
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## Primitives
|
|
231
|
+
|
|
232
|
+
> **Do not override or redefine these tokens in themes or runtime component styles.** They are the theme-independent foundation declared on `:root` and remain constant across every theme; reassigning a primitive value there breaks visual consistency product-wide. Consume them only via `var(...)`; theme tokens (above) build on these.
|
|
233
|
+
|
|
234
|
+
### Dimensions
|
|
235
|
+
|
|
236
|
+
Both scales below are fixed and **non-contiguous** — use only a step listed in the table; never interpolate or invent a value (e.g. there is no `--crt-radius-500`).
|
|
237
|
+
|
|
238
|
+
#### Spacing
|
|
239
|
+
|
|
240
|
+
> Use `--crt-spacing-*` for gaps / padding / margins.
|
|
241
|
+
|
|
242
|
+
| Token | Default |
|
|
243
|
+
|-------|---------|
|
|
244
|
+
| `--crt-spacing-0` | 0 |
|
|
245
|
+
| `--crt-spacing-50` | 2px |
|
|
246
|
+
| `--crt-spacing-100` | 4px |
|
|
247
|
+
| `--crt-spacing-150` | 6px |
|
|
248
|
+
| `--crt-spacing-200` | 8px |
|
|
249
|
+
| `--crt-spacing-250` | 10px |
|
|
250
|
+
| `--crt-spacing-300` | 12px |
|
|
251
|
+
| `--crt-spacing-400` | 16px |
|
|
252
|
+
| `--crt-spacing-500` | 20px |
|
|
253
|
+
| `--crt-spacing-600` | 24px |
|
|
254
|
+
| `--crt-spacing-700` | 28px |
|
|
255
|
+
| `--crt-spacing-800` | 32px |
|
|
256
|
+
| `--crt-spacing-900` | 36px |
|
|
257
|
+
| `--crt-spacing-1000` | 40px |
|
|
258
|
+
|
|
259
|
+
#### Radius
|
|
260
|
+
|
|
261
|
+
> Use `--crt-radius-*` for corner rounding; `--crt-radius-infinite` for pills / circles.
|
|
262
|
+
|
|
263
|
+
| Token | Default |
|
|
264
|
+
|-------|---------|
|
|
265
|
+
| `--crt-radius-0` | 0 |
|
|
266
|
+
| `--crt-radius-50` | 2px |
|
|
267
|
+
| `--crt-radius-100` | 4px |
|
|
268
|
+
| `--crt-radius-150` | 6px |
|
|
269
|
+
| `--crt-radius-200` | 8px |
|
|
270
|
+
| `--crt-radius-250` | 10px |
|
|
271
|
+
| `--crt-radius-300` | 12px |
|
|
272
|
+
| `--crt-radius-400` | 16px |
|
|
273
|
+
| `--crt-radius-600` | 24px |
|
|
274
|
+
| `--crt-radius-800` | 32px |
|
|
275
|
+
| `--crt-radius-infinite` | 999px |
|
|
276
|
+
|
|
277
|
+
### Typography scales
|
|
278
|
+
|
|
279
|
+
Used to compose typography roles; prefer the semantic `--crt-<role>-*` tokens above instead of these raw scales.
|
|
280
|
+
|
|
281
|
+
#### Font size
|
|
282
|
+
|
|
283
|
+
| Token | Default |
|
|
284
|
+
|-------|---------|
|
|
285
|
+
| `--crt-font-size-50` | 10px |
|
|
286
|
+
| `--crt-font-size-100` | 12px |
|
|
287
|
+
| `--crt-font-size-200` | 13px |
|
|
288
|
+
| `--crt-font-size-300` | 14px |
|
|
289
|
+
| `--crt-font-size-400` | 16px |
|
|
290
|
+
| `--crt-font-size-500` | 18px |
|
|
291
|
+
| `--crt-font-size-600` | 20px |
|
|
292
|
+
| `--crt-font-size-700` | 24px |
|
|
293
|
+
| `--crt-font-size-800` | 28px |
|
|
294
|
+
| `--crt-font-size-900` | 32px |
|
|
295
|
+
| `--crt-font-size-1000` | 36px |
|
|
296
|
+
| `--crt-font-size-1100` | 54px |
|
|
297
|
+
|
|
298
|
+
#### Line height
|
|
299
|
+
|
|
300
|
+
| Token | Default |
|
|
301
|
+
|-------|---------|
|
|
302
|
+
| `--crt-line-height-50` | 12px |
|
|
303
|
+
| `--crt-line-height-100` | 16px |
|
|
304
|
+
| `--crt-line-height-200` | 18px |
|
|
305
|
+
| `--crt-line-height-300` | 20px |
|
|
306
|
+
| `--crt-line-height-400` | 24px |
|
|
307
|
+
| `--crt-line-height-500` | 26px |
|
|
308
|
+
| `--crt-line-height-600` | 32px |
|
|
309
|
+
| `--crt-line-height-700` | 36px |
|
|
310
|
+
| `--crt-line-height-800` | 40px |
|
|
311
|
+
| `--crt-line-height-900` | 44px |
|
|
312
|
+
| `--crt-line-height-1000` | 70px |
|
|
313
|
+
|
|
314
|
+
#### Font weight
|
|
315
|
+
|
|
316
|
+
| Token | Default |
|
|
317
|
+
|-------|---------|
|
|
318
|
+
| `--crt-font-weight-thin` | 200 |
|
|
319
|
+
| `--crt-font-weight-light` | 300 |
|
|
320
|
+
| `--crt-font-weight-regular` | 400 |
|
|
321
|
+
| `--crt-font-weight-medium` | 500 |
|
|
322
|
+
| `--crt-font-weight-semi-bold` | 600 |
|
|
323
|
+
| `--crt-font-weight-bold` | 700 |
|
|
324
|
+
| `--crt-font-weight-extra-bold` | 800 |
|
|
325
|
+
| `--crt-font-weight-black` | 900 |
|
|
326
|
+
|
|
327
|
+
### Color primitives
|
|
328
|
+
|
|
329
|
+
Raw color values on `:root`. Base colors seed the light/dark anchors; glass tokens are for translucent / glassmorphic surfaces.
|
|
330
|
+
|
|
331
|
+
#### Base colors
|
|
332
|
+
|
|
333
|
+
| Token | Default |
|
|
334
|
+
|-------|---------|
|
|
335
|
+
| `--crt-color-base-light` | `#ffffff` |
|
|
336
|
+
| `--crt-color-base-dark` | `#181818` |
|
|
337
|
+
|
|
338
|
+
#### Glass
|
|
339
|
+
|
|
340
|
+
For translucent / glassmorphic surfaces only.
|
|
341
|
+
|
|
342
|
+
| Shade | `--crt-glass-color-light-<shade>` | `--crt-glass-color-dark-<shade>` |
|
|
343
|
+
|-------|-----------------------------------|----------------------------------|
|
|
344
|
+
| 50 | `rgba(255,255,255,0.05)` | `rgba(24,24,24,0.05)` |
|
|
345
|
+
| 100 | `rgba(255,255,255,0.1)` | `rgba(24,24,24,0.1)` |
|
|
346
|
+
| 200 | `rgba(255,255,255,0.2)` | `rgba(24,24,24,0.2)` |
|
|
347
|
+
| 300 | `rgba(255,255,255,0.3)` | `rgba(24,24,24,0.3)` |
|
|
348
|
+
| 400 | `rgba(255,255,255,0.4)` | `rgba(24,24,24,0.4)` |
|
|
349
|
+
| 500 | `rgba(255,255,255,0.5)` | `rgba(24,24,24,0.5)` |
|
|
350
|
+
| 600 | `rgba(255,255,255,0.6)` | `rgba(24,24,24,0.6)` |
|
|
351
|
+
| 700 | `rgba(255,255,255,0.7)` | `rgba(24,24,24,0.7)` |
|
|
352
|
+
| 800 | `rgba(255,255,255,0.8)` | `rgba(24,24,24,0.8)` |
|
|
353
|
+
| 900 | `rgba(255,255,255,0.9)` | `rgba(24,24,24,0.9)` |
|
|
354
|
+
|
|
355
|
+
| Token | Default |
|
|
356
|
+
|-------|---------|
|
|
357
|
+
| `--crt-color-text-glassmorphic-base` | `#ffffff` |
|
|
358
|
+
| `--crt-color-text-glassmorphic-muted` | `#bababa` |
|
|
359
|
+
| `--crt-color-text-glassmorphic-disabled` | `rgba(255,255,255,0.6)` |
|
|
360
|
+
| `--crt-color-icon-glassmorphic-base` | `#ffffff` |
|
|
361
|
+
| `--crt-color-icon-glassmorphic-muted` | `#bababa` |
|
|
362
|
+
|
|
363
|
+
> Note: `--crt-color-text-glassmorphic-*` / `--crt-color-icon-glassmorphic-*` are named like semantic text/icon colors but are **primitives** on `:root` — do not confuse them with `--crt-color-text-body` / `--crt-color-icon-base`.
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
Last updated: 2026-07-30
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
- When in doubt, use camelCase variants: `isDisabled`, `isReadOnly`, `currentValue`
|
|
12
12
|
|
|
13
13
|
**Related guides:**
|
|
14
|
-
- **Design-time guide:** See REMOTE_COMPONENT_DESIGN_TIME_AI_GUIDE.md from @creatio
|
|
14
|
+
- **Design-time guide:** See REMOTE_COMPONENT_DESIGN_TIME_AI_GUIDE.md from @creatio/interface-designer package
|
|
15
|
+
- **Styling guide:** See REMOTE_COMPONENT_STYLING_AI_GUIDE.md from @creatio-devkit/common package (MANDATORY whenever the component has any `.scss` / styled template — design-token usage, theming)
|
|
15
16
|
- **Accessibility guide:** See WCAG_ACCESSIBILITY_AI_GUIDE.md from @creatio-devkit/common package (MANDATORY for all components)
|
|
16
17
|
- **Icon guide:** See ICON_REQUIREMENTS_AI_GUIDE.md from @creatio-devkit/common package
|
|
17
18
|
|
|
@@ -662,7 +663,7 @@ export class {{COMPONENT_NAME_PASCAL}}Component {
|
|
|
662
663
|
|
|
663
664
|
@Input()
|
|
664
665
|
@CrtInput()
|
|
665
|
-
public color = '
|
|
666
|
+
public color = 'var(--crt-color-text-body, #181818)';
|
|
666
667
|
|
|
667
668
|
@Input()
|
|
668
669
|
@CrtInput()
|
|
@@ -1050,6 +1051,7 @@ export default {
|
|
|
1050
1051
|
- [ ] **MANDATORY: Run WCAG code audit against WCAG_ACCESSIBILITY_AI_GUIDE.md**
|
|
1051
1052
|
- [ ] **MANDATORY: WCAG audit has 0 critical and 0 major violations (BLOCKING)**
|
|
1052
1053
|
- [ ] **MANDATORY: WCAG accessibility requirements met (see WCAG_ACCESSIBILITY_AI_GUIDE.md)**
|
|
1054
|
+
- [ ] **MANDATORY: If the component has visuals, styling audited against REMOTE_COMPONENT_STYLING_AI_GUIDE.md — colors/fonts/spacing/radius all on --crt-* tokens, no hardcoded chrome**
|
|
1053
1055
|
- [ ] Accessibility: Semantic HTML used (button, input, label, etc.)
|
|
1054
1056
|
- [ ] Accessibility: All interactive elements have accessible names
|
|
1055
1057
|
- [ ] Accessibility: Keyboard support (Tab, Enter, Space, Escape)
|
|
@@ -1490,7 +1492,7 @@ public readonly myEvent = new EventEmitter<MyType>();
|
|
|
1490
1492
|
display: block;
|
|
1491
1493
|
}
|
|
1492
1494
|
.my-class {
|
|
1493
|
-
color:
|
|
1495
|
+
color: var(--crt-color-text-body, #181818);
|
|
1494
1496
|
}
|
|
1495
1497
|
`],
|
|
1496
1498
|
})
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Remote Component Styling AI Guide
|
|
2
|
+
|
|
3
|
+
**ATTENTION AI AGENT:** This is a directive instruction set, not documentation. Follow rules exactly.
|
|
4
|
+
|
|
5
|
+
**Audience:** AI assistant styling the **runtime** part of a Creatio Freedom UI custom (remote) component.
|
|
6
|
+
|
|
7
|
+
**Scope:** Make every generated runtime component consume Creatio **design tokens** (CSS custom properties) for colors, typography, spacing, and radius — instead of hardcoded values — so the component inherits the system look and adapts to theme switching automatically.
|
|
8
|
+
|
|
9
|
+
**Related guides:**
|
|
10
|
+
- **Runtime behavior guide:** See REMOTE_COMPONENT_RUNTIME_AI_GUIDE.md from @creatio-devkit/common package — read FIRST. It owns component structure, inputs/outputs, registration, tests.
|
|
11
|
+
- **Design tokens catalog:** See DESIGN_TOKENS_AI_GUIDE.md from @creatio-devkit/common package — catalog of all `--crt-*` token names and default values.
|
|
12
|
+
- **Accessibility guide:** See WCAG_ACCESSIBILITY_AI_GUIDE.md from @creatio-devkit/common package — focus-visible, color-contrast, and "color not sole indicator" rules interact with styling.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Shadow DOM Encapsulation
|
|
17
|
+
|
|
18
|
+
Runtime remote components are generated with **`encapsulation: ViewEncapsulation.ShadowDom`** (a hard requirement of the runtime guide). CSS rules defined outside the component — global stylesheets, theme classes, shared SCSS partials, system utility classes — do not apply inside the shadow root.
|
|
19
|
+
|
|
20
|
+
**What DOES cross the shadow boundary:**
|
|
21
|
+
- **CSS Custom Properties (design tokens).** Custom properties inherit down the DOM tree and pierce shadow boundaries: a token declared on an ancestor (`:root`, or the active theme's root class on the app root) is readable inside your shadow root via `var(--crt-...)`. The active theme redefines these tokens, so your `var(--crt-...)` values adapt to theme switching for free — conversely, a hardcoded hex stays fixed and breaks when the theme changes.
|
|
22
|
+
- Inherited typed properties such as `font-family` and `color` **if** you let them inherit onto `:host`.
|
|
23
|
+
|
|
24
|
+
**Therefore the only way to be visually consistent is to consume `--crt-*` design tokens via `var(...)`.** This is mandatory, not stylistic.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## `:host` baseline (ALWAYS include this block first)
|
|
29
|
+
|
|
30
|
+
Styling assumes the runtime component is generated with `encapsulation: ViewEncapsulation.ShadowDom` (per the runtime guide) — that is the boundary tokens pierce. Set the system font and base text color on `:host` once; everything inside the shadow tree then inherits the correct typography by default.
|
|
31
|
+
|
|
32
|
+
```scss
|
|
33
|
+
:host {
|
|
34
|
+
display: block;
|
|
35
|
+
|
|
36
|
+
/* Inherit the system UI typography — body-2 is the default UI text role */
|
|
37
|
+
font-family: var(--crt-body-2-font-family, 'Montserrat', sans-serif);
|
|
38
|
+
font-size: var(--crt-body-2-font-size, 13px);
|
|
39
|
+
font-weight: var(--crt-body-2-font-weight, 500);
|
|
40
|
+
line-height: var(--crt-body-2-line-height, 20px);
|
|
41
|
+
letter-spacing: var(--crt-body-2-letter-spacing, 0);
|
|
42
|
+
color: var(--crt-color-text-body, var(--crt-color-base-dark, #181818));
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Rules:**
|
|
47
|
+
- ALWAYS declare the `:host` typography + color baseline. This is what makes the component inherit the system look with zero extra work.
|
|
48
|
+
- ALWAYS provide a **fallback** in every `var(--crt-..., <fallback>)` — the second argument. It is what renders in isolated unit tests or any host that is not wrapped in a Creatio theme. Take the fallback from the token's catalog entry (see Choosing tokens below).
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Choosing tokens
|
|
53
|
+
|
|
54
|
+
All token **names, default-theme values, naming conventions, and scope** live in one place: **DESIGN_TOKENS_AI_GUIDE.md**. Use it as the catalog; this guide only covers how to apply tokens in a Shadow DOM runtime component.
|
|
55
|
+
|
|
56
|
+
- **Prefer semantic tokens** (named by role: `--crt-color-text-*`, `--crt-color-background-*`, `--crt-color-border-*`, `--crt-color-icon-*`, and the `--crt-<role>-*` typography roles). They encode the right shade per theme and adapt automatically. Reach for raw palette/primitive tokens only when no semantic role fits.
|
|
57
|
+
- **Use only tokens listed in the tokens guide.** Those are defined globally (`:root` or the active theme's root) and therefore inherit into your shadow root.
|
|
58
|
+
- **Every `var(--crt-..., <fallback>)` needs a fallback taken from the catalog.** For a primitive the catalog Default is a literal — use it directly. For every theme color token the Default is itself a `var(--crt-...)` reference (e.g. `--crt-color-text-muted` → `var(--crt-palette-neutral-600)`): prefer keeping that reference as the fallback and giving it the referenced primitive's literal as its own fallback — `color: var(--crt-color-text-muted, var(--crt-palette-neutral-600, #606060));`. A fully resolved literal fallback (`var(--crt-color-text-muted, #606060)`) is also acceptable. Either way, take both the reference and the literal from the catalog — NEVER eyeball or approximate a value.
|
|
59
|
+
- **Spacing & radius are fixed scales, not arbitrary px — never invent a step; confirm the exact `--crt-spacing-*` / `--crt-radius-*` value in the tokens guide before use.**
|
|
60
|
+
- **Match the typography role to the element.** Use `--crt-button-*` for button / keypad / clickable-control labels, `--crt-headline-*` for titles, `--crt-body-*` for body text, `--crt-caption-*` for helper text. Do NOT default every text element to `--crt-body-*`: a `<button>` styled with `--crt-body-1-*` is tokenized but off-role, so it will not match native controls when the theme changes fonts/metrics. A role is five tokens — `-font-family`, `-font-size`, `-font-weight`, `-line-height`, and `-letter-spacing`; apply all five (letter-spacing is non-zero for tracked roles such as `--crt-overline-*`, so omitting it breaks those roles).
|
|
61
|
+
- **Tinted surfaces — `subtle` vs `soft`.** `subtle` is the *lightest* tint (≈ `palette-10`) and sits almost on top of `background-base`; a `-subtle` fill placed directly on a base surface can be nearly invisible. When a tinted control must read as distinct from an adjacent base surface, use `-soft` (a light tint, ≈ `palette-50`) and confirm the two surfaces are visually separable.
|
|
62
|
+
- **Fallbacks are not the themed values.** The fallback renders only outside a theme (unit tests, un-themed hosts). A token's real value under a theme can differ substantially from a naive guess — e.g. `--crt-color-background-primary-subtle` resolves to a near-white tint, not a mid-blue. Verify the component inside a running Creatio theme, never by its fallbacks alone.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## PATTERNS (copy, then adapt)
|
|
67
|
+
|
|
68
|
+
The patterns below cover the common shapes (text/value, surface, interactive control). Adapt them per element — button, text input, select, checkbox, menu, or field label — keeping every color, font, spacing, and radius on a `--crt-*` token; the HARD FAIL table below lists the rejection rules.
|
|
69
|
+
|
|
70
|
+
### Pattern A — Text / value display
|
|
71
|
+
|
|
72
|
+
```scss
|
|
73
|
+
.value {
|
|
74
|
+
color: var(--crt-color-text-body, var(--crt-color-base-dark, #181818));
|
|
75
|
+
}
|
|
76
|
+
.value--muted {
|
|
77
|
+
color: var(--crt-color-text-muted, var(--crt-palette-neutral-600, #606060));
|
|
78
|
+
font-family: var(--crt-caption-font-family, 'Montserrat', sans-serif);
|
|
79
|
+
font-size: var(--crt-caption-font-size, 12px);
|
|
80
|
+
font-weight: var(--crt-caption-font-weight, 500);
|
|
81
|
+
line-height: var(--crt-caption-line-height, 16px);
|
|
82
|
+
letter-spacing: var(--crt-caption-letter-spacing, 0);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Pattern B — Surface / card
|
|
87
|
+
|
|
88
|
+
```scss
|
|
89
|
+
.card {
|
|
90
|
+
background: var(--crt-color-background-base, var(--crt-color-base-light, #ffffff));
|
|
91
|
+
border: 1px solid var(--crt-color-border-base, var(--crt-palette-neutral-100, #dfdfdf));
|
|
92
|
+
border-radius: var(--crt-radius-200, 8px);
|
|
93
|
+
padding: var(--crt-spacing-400, 16px);
|
|
94
|
+
box-shadow: 0 1px 4px var(--crt-color-shadow, rgb(24 24 24 / 10%));
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Pattern C — Interactive control / button
|
|
99
|
+
|
|
100
|
+
Use the intent's fill/state triad — `background` → `-hover` → `-selected` (map `-selected` to `:active`) — with the matching `text-on-<intent>` color and the `--crt-button-*` typography role. Give every interactive control a `:focus-visible` ring from `--crt-color-border-selected`.
|
|
101
|
+
|
|
102
|
+
```scss
|
|
103
|
+
.button {
|
|
104
|
+
font-family: var(--crt-button-font-family, 'Montserrat', sans-serif);
|
|
105
|
+
font-size: var(--crt-button-font-size, 14px);
|
|
106
|
+
font-weight: var(--crt-button-font-weight, 500);
|
|
107
|
+
line-height: var(--crt-button-line-height, 16px);
|
|
108
|
+
letter-spacing: var(--crt-button-letter-spacing, 0);
|
|
109
|
+
|
|
110
|
+
color: var(--crt-color-text-on-primary, var(--crt-color-base-light, #ffffff));
|
|
111
|
+
background: var(--crt-color-background-primary, var(--crt-palette-primary-500, #004fd6));
|
|
112
|
+
border: 1px solid var(--crt-color-background-primary, var(--crt-palette-primary-500, #004fd6));
|
|
113
|
+
border-radius: var(--crt-radius-100, 4px);
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
transition: background-color 0.15s ease, border-color 0.15s ease;
|
|
116
|
+
}
|
|
117
|
+
.button:hover { background: var(--crt-color-background-primary-hover, var(--crt-palette-primary-600, #0041b5)); }
|
|
118
|
+
.button:active { background: var(--crt-color-background-primary-selected, var(--crt-palette-primary-700, #003495)); }
|
|
119
|
+
.button:focus-visible {
|
|
120
|
+
outline: 2px solid var(--crt-color-border-selected, var(--crt-palette-primary-500, #004fd6));
|
|
121
|
+
outline-offset: 1px;
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**Rules:**
|
|
126
|
+
- Keep the state set complete: define `:hover`, `:active`, AND `:focus-visible` for every interactive control — a control with only `:hover` looks unfinished and fails keyboard affordance.
|
|
127
|
+
- A lower-emphasis control on a base surface uses a `-soft` fill (not `-subtle`, which is near-white) with its `text-on-<intent>-soft` text.
|
|
128
|
+
- Never remove the focus outline without a visible `:focus-visible` alternative (see WCAG guide).
|
|
129
|
+
|
|
130
|
+
### Exception — presentational value exposed as a component @Input
|
|
131
|
+
|
|
132
|
+
The hardcoded-value rules in this guide are about **UI chrome**. If the component exposes a user-configurable presentational value (a color, font size, spacing, radius…), that is a **data value**, not chrome, so binding it inline is correct. But default it to the matching **token** (not a literal like `'black'` or `'12px'`), and still use tokens for all surrounding chrome.
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
@Input() @CrtInput()
|
|
136
|
+
public accentColor = 'var(--crt-color-text-action, var(--crt-palette-secondary-500, #0d2e4e))';
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<span class="status" [style.color]="accentColor">{{ text }}</span>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## HARD FAIL
|
|
146
|
+
|
|
147
|
+
Generation MUST be rejected and regenerated if any of these appear in a runtime component:
|
|
148
|
+
|
|
149
|
+
| Rule | Wrong | Correct |
|
|
150
|
+
|------|---------|-----------|
|
|
151
|
+
| Hardcoded UI text/surface color | `color: #444;` / `background: #fff;` | `color: var(--crt-color-text-body, var(--crt-color-base-dark, #181818));` |
|
|
152
|
+
| Hardcoded UI font-family | `font-family: 'Roboto';` | `font-family: var(--crt-body-2-font-family, 'Montserrat', sans-serif);` |
|
|
153
|
+
| Raw px font-size for a known role | `font-size: 13px;` | `font-size: var(--crt-body-2-font-size, 13px);` |
|
|
154
|
+
| `var()` without fallback | `color: var(--crt-color-text-body);` | `color: var(--crt-color-text-body, var(--crt-color-base-dark, #181818));` |
|
|
155
|
+
| Presentational `@Input` defaults to a literal | `public color = 'black';` | `public accentColor = 'var(--crt-color-text-action, var(--crt-palette-secondary-500, #0d2e4e))';` (see the exception above) |
|
|
156
|
+
| Color as the only state signal | red text only for error | icon/text + `--crt-color-text-error` (see WCAG guide) |
|
|
157
|
+
|
|
158
|
+
**Exception to _Hardcoded UI font-family_:** `'Courier New', monospace` is allowed ONLY for code/raw-data display (the design system has no monospace token).
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Styling checklist (add to the runtime generation checklist)
|
|
163
|
+
|
|
164
|
+
```markdown
|
|
165
|
+
- [ ] :host declares font-family + font-size + font-weight + line-height + letter-spacing + color from --crt-body-2-* / --crt-color-text-body
|
|
166
|
+
- [ ] Every UI color uses a --crt-* color token (semantic preferred); no hardcoded hex for chrome
|
|
167
|
+
- [ ] Every text element uses a --crt-<role>-* typography group (all five tokens, incl. letter-spacing), not raw px
|
|
168
|
+
- [ ] Button / clickable-control labels use the --crt-button-* role (not --crt-body-*)
|
|
169
|
+
- [ ] Spacing/radius use --crt-spacing-* / --crt-radius-*
|
|
170
|
+
- [ ] Presentational @Input defaults to a token, not a literal
|
|
171
|
+
- [ ] Every var(--crt-*) has a fallback taken from the catalog — the token's Default reference chained down to its primitive literal, or that literal directly; never an eyeballed value
|
|
172
|
+
- [ ] Interactive controls define :hover, :active, AND :focus-visible — all from tokens
|
|
173
|
+
- [ ] Card / surface elevation uses --crt-color-shadow (theme-scoped), not a hardcoded shadow color
|
|
174
|
+
- [ ] Tinted surfaces are deliberately distinguishable from the base surface (soft vs subtle chosen on purpose, not by name alone)
|
|
175
|
+
- [ ] Color is never the sole state indicator (WCAG)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
Last updated: 2026-07-20
|