@cocoar/vue-ui 3.4.0-beta.22 → 3.4.0-beta.29
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/dist/compact-fonts.d.ts +1 -0
- package/dist/compact-fonts.d.ts.map +1 -0
- package/dist/compact-fonts.js +4 -0
- package/dist/components/badge/CoarBadge.vue.d.ts.map +1 -1
- package/dist/components/card/CoarCard.vue.d.ts.map +1 -1
- package/dist/components/checkbox/CoarCheckbox.vue.d.ts +2 -2
- package/dist/components/checkbox/CoarCheckbox.vue.d.ts.map +1 -1
- package/dist/components/code-block/CoarCodeBlock.vue.d.ts +1 -1
- package/dist/components/code-block/CoarCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/data-list/CoarDataList.vue.d.ts.map +1 -1
- package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/scrollable-calendar/CoarScrollableCalendar.vue.d.ts.map +1 -1
- package/dist/components/date-time/time-picker/CoarTimePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePickerPanel.vue.d.ts.map +1 -1
- package/dist/components/dialog/CoarDialogShell.vue.d.ts.map +1 -1
- package/dist/components/form-field/CoarFormField.vue.d.ts +2 -2
- package/dist/components/form-field/CoarFormField.vue.d.ts.map +1 -1
- package/dist/components/icon/CoarIcon.vue.d.ts +3 -3
- package/dist/components/icon/CoarIcon.vue.d.ts.map +1 -1
- package/dist/components/input-frame/CoarInputFrame.vue.d.ts.map +1 -1
- package/dist/components/listbox/CoarListbox.vue.d.ts.map +1 -1
- package/dist/components/menu/CoarMenuItem.vue.d.ts.map +1 -1
- package/dist/components/menu/CoarSubExpand.vue.d.ts.map +1 -1
- package/dist/components/menu/CoarSubFlyout.vue.d.ts.map +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts.map +1 -1
- package/dist/components/otp-input/CoarOtpInput.vue.d.ts +2 -2
- package/dist/components/otp-input/CoarOtpInput.vue.d.ts.map +1 -1
- package/dist/components/overlay/CoarOverlayOutlet.vue.d.ts.map +1 -1
- package/dist/components/overlay/compact-context.d.ts +10 -0
- package/dist/components/overlay/compact-context.d.ts.map +1 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/overlay/index.d.ts.map +1 -1
- package/dist/components/overlay/useCompactPresentationContext.d.ts +33 -0
- package/dist/components/overlay/useCompactPresentationContext.d.ts.map +1 -0
- package/dist/components/panel-layout/internal/CoarPaneDivider.vue.d.ts.map +1 -1
- package/dist/components/password-input/CoarPasswordInput.vue.d.ts +1 -1
- package/dist/components/password-input/CoarPasswordInput.vue.d.ts.map +1 -1
- package/dist/components/scrollbar/vScrollbar.d.ts.map +1 -1
- package/dist/components/select/CoarMultiSelect.vue.d.ts.map +1 -1
- package/dist/components/select/CoarMultiSelectDropdownPanel.vue.d.ts.map +1 -1
- package/dist/components/select/CoarSelectDropdownPanel.vue.d.ts.map +1 -1
- package/dist/components/select/CoarTagSelectDropdownPanel.vue.d.ts.map +1 -1
- package/dist/components/sidebar/CoarSidebarGroup.vue.d.ts.map +1 -1
- package/dist/components/switch/CoarSwitch.vue.d.ts +2 -2
- package/dist/components/switch/CoarSwitch.vue.d.ts.map +1 -1
- package/dist/components/tabs/CoarTabGroup.vue.d.ts.map +1 -1
- package/dist/components/text-input/CoarTextInput.vue.d.ts +1 -1
- package/dist/components/text-input/CoarTextInput.vue.d.ts.map +1 -1
- package/dist/components/theme-editor/CoarPaletteEditor.vue.d.ts +8 -2
- package/dist/components/theme-editor/CoarPaletteEditor.vue.d.ts.map +1 -1
- package/dist/components/theme-editor/color-preview.d.ts +22 -0
- package/dist/components/theme-editor/color-preview.d.ts.map +1 -0
- package/dist/components/theme-editor/font-preview.d.ts +46 -0
- package/dist/components/theme-editor/font-preview.d.ts.map +1 -0
- package/dist/components/theme-editor/scheme-values.d.ts +12 -0
- package/dist/components/theme-editor/scheme-values.d.ts.map +1 -0
- package/dist/components/theme-editor/theme-editor-state.d.ts +199 -183
- package/dist/components/theme-editor/theme-editor-state.d.ts.map +1 -1
- package/dist/components/theme-scope/CoarThemeScope.vue.d.ts.map +1 -1
- package/dist/components/tree/CoarTreeNode.vue.d.ts.map +1 -1
- package/dist/composables/useDragDrop.d.ts.map +1 -1
- package/dist/composables/useDragImage.d.ts +2 -14
- package/dist/composables/useDragImage.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3439 -2056
- package/dist/onest-fonts.d.ts +1 -0
- package/dist/onest-fonts.d.ts.map +1 -0
- package/dist/onest-fonts.js +4 -0
- package/dist/theme/color-contrast.d.ts +10 -0
- package/dist/theme/color-contrast.d.ts.map +1 -0
- package/dist/theme/compact-packages/calendar.d.ts +8 -0
- package/dist/theme/compact-packages/calendar.d.ts.map +1 -0
- package/dist/theme/compact-packages/data-grid.d.ts +8 -0
- package/dist/theme/compact-packages/data-grid.d.ts.map +1 -0
- package/dist/theme/compact-packages/document-viewer.d.ts +8 -0
- package/dist/theme/compact-packages/document-viewer.d.ts.map +1 -0
- package/dist/theme/compact-packages/map.d.ts +11 -0
- package/dist/theme/compact-packages/map.d.ts.map +1 -0
- package/dist/theme/compact-packages/markdown-editor.d.ts +8 -0
- package/dist/theme/compact-packages/markdown-editor.d.ts.map +1 -0
- package/dist/theme/compact-packages/markdown.d.ts +14 -0
- package/dist/theme/compact-packages/markdown.d.ts.map +1 -0
- package/dist/theme/compact-packages/mermaid.d.ts +8 -0
- package/dist/theme/compact-packages/mermaid.d.ts.map +1 -0
- package/dist/theme/compact-packages/page-builder.d.ts +8 -0
- package/dist/theme/compact-packages/page-builder.d.ts.map +1 -0
- package/dist/theme/compact-packages/script-editor.d.ts +8 -0
- package/dist/theme/compact-packages/script-editor.d.ts.map +1 -0
- package/dist/theme/compact-theme.d.ts +11 -0
- package/dist/theme/compact-theme.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/calendar.d.ts +3 -0
- package/dist/theme/enterprise-packages/calendar.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/document-viewer.d.ts +3 -0
- package/dist/theme/enterprise-packages/document-viewer.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/map.d.ts +3 -0
- package/dist/theme/enterprise-packages/map.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/markdown.d.ts +7 -0
- package/dist/theme/enterprise-packages/markdown.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/mermaid.d.ts +3 -0
- package/dist/theme/enterprise-packages/mermaid.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/page-builder.d.ts +3 -0
- package/dist/theme/enterprise-packages/page-builder.d.ts.map +1 -0
- package/dist/theme/enterprise-packages/script-editor.d.ts +7 -0
- package/dist/theme/enterprise-packages/script-editor.d.ts.map +1 -0
- package/dist/theme/enterprise-theme.d.ts +8 -0
- package/dist/theme/enterprise-theme.d.ts.map +1 -0
- package/dist/theme/palette-inputs.d.ts +34 -0
- package/dist/theme/palette-inputs.d.ts.map +1 -0
- package/dist/theme/role-derived-tokens.d.ts +3 -0
- package/dist/theme/role-derived-tokens.d.ts.map +1 -0
- package/dist/theme/role-input-defaults.d.ts +5 -0
- package/dist/theme/role-input-defaults.d.ts.map +1 -0
- package/dist/theme/role-theme-contract.d.ts +8 -0
- package/dist/theme/role-theme-contract.d.ts.map +1 -0
- package/dist/theme/role-theme.d.ts +40 -0
- package/dist/theme/role-theme.d.ts.map +1 -0
- package/package.json +15 -4
- package/skills/cocoar-vue-ui/SKILL.md +2 -0
- package/skills/cocoar-vue-ui/references/components/calendar/index.md +26 -1
- package/skills/cocoar-vue-ui/references/components/data-grid.md +4 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/coar-document-viewer.md +4 -0
- package/skills/cocoar-vue-ui/references/components/form-field.md +10 -6
- package/skills/cocoar-vue-ui/references/components/listbox.md +2 -0
- package/skills/cocoar-vue-ui/references/components/map/index.md +5 -1
- package/skills/cocoar-vue-ui/references/components/markdown-editor.md +10 -0
- package/skills/cocoar-vue-ui/references/components/markdown-form.md +9 -0
- package/skills/cocoar-vue-ui/references/components/markdown.md +10 -0
- package/skills/cocoar-vue-ui/references/components/mermaid.md +11 -0
- package/skills/cocoar-vue-ui/references/components/script-editor.md +10 -0
- package/skills/cocoar-vue-ui/references/foundations/colors.md +32 -3
- package/skills/cocoar-vue-ui/references/foundations/compact-presentation.md +252 -0
- package/skills/cocoar-vue-ui/references/foundations/theming.md +96 -11
- package/skills/cocoar-vue-ui/references/foundations/typography.md +3 -0
- package/skills/cocoar-vue-ui/references/guide/migration-color-roles.md +28 -0
- package/skills/cocoar-vue-ui/references/guide/mobile.md +2 -2
- package/skills/cocoar-vue-ui/references/guide/theming.md +25 -0
- package/styles/tokens/all.css +6 -0
- package/styles/tokens/code-block.css +2 -2
- package/styles/tokens/colors-primitives-dark.css +50 -50
- package/styles/tokens/colors-primitives-light.css +50 -50
- package/styles/tokens/colors-usage.css +126 -111
- package/styles/tokens/compact.css +4426 -0
- package/styles/tokens/components-shared.css +4 -4
- package/styles/tokens/derived.css +525 -0
- package/styles/tokens/menu.css +21 -21
- package/styles/tokens/new-components.css +35 -35
- package/styles/tokens/select-overlay.css +12 -12
- package/styles/tokens/sidebar.css +12 -12
- package/styles/tokens/theme-none.css +99 -93
- package/styles/tokens/tooltip.css +4 -4
- package/styles/tokens/typography.css +19 -19
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Map (Preview)
|
|
4
4
|
|
|
5
|
-
**Devices:** desktop ready · tablet ready · phone partial —
|
|
5
|
+
**Devices:** desktop ready · tablet ready · phone partial — Touch pan/zoom; compact mobile enlarges zoom and list controls. Dense pins and vertices retain small spatial targets.
|
|
6
6
|
|
|
7
7
|
An interactive [Leaflet](https://leafletjs.com/) map for Vue 3. `<CoarMap>` is
|
|
8
8
|
**standalone and data-driven**: you feed it resolved `MapData` + `MapConfig` and
|
|
@@ -317,6 +317,10 @@ Until the map hydrates — and if Leaflet ever fails to load, or with JS off —
|
|
|
317
317
|
crawlable `<ol>` of the named points is shown and then hidden once the map is
|
|
318
318
|
live. The map container's height is `--coar-map-height` (default `360px`).
|
|
319
319
|
|
|
320
|
+
## Compact presentation (Preview)
|
|
321
|
+
|
|
322
|
+
Inside the experimental `.coar-compact` profile — on an ancestor or on the map — Leaflet's own controls, popups, tooltips and attribution use the library's text, radii and semantic colors (light and dark), and the selection ring follows the accent. With `.coar-mobile` as well, zoom buttons and the point list's drag handle get a 44px touch target. Pins and editor vertices keep their real hit geometry: expanded invisible targets would intercept neighbouring markers. Dense map markers therefore do not meet the same touch-target floor; the point list is an alternative for selecting pins. Map data — tiles, the route, shape dots, category colors, pin size — is not themed. `--coar-map-*` variables you set still win; outside the profile nothing changes.
|
|
323
|
+
|
|
320
324
|
## Security
|
|
321
325
|
|
|
322
326
|
Point text (`label`, `note`, `icon`) is treated as untrusted: popups are built
|
|
@@ -1318,6 +1318,16 @@ If you embed the editor next to a viewer pane (the playground's "viewer pane" to
|
|
|
1318
1318
|
| `--coar-markdown-link` | `var(--coar-text-brand-primary)` | Link color (also applied to inline code). |
|
|
1319
1319
|
| `--coar-markdown-border` | `var(--coar-border-neutral-tertiary)` | Used by tables, blockquote, `<hr>`. |
|
|
1320
1320
|
|
|
1321
|
+
## Compact presentation (Preview)
|
|
1322
|
+
|
|
1323
|
+
Inside an element with the class `coar-compact` (the experimental compact profile, working title) the
|
|
1324
|
+
editor follows the compact document layout of [`CoarMarkdown`](./markdown.md#theming) and tightens its
|
|
1325
|
+
own chrome: field-sized writing text (14 px, 16 px with `coar-mobile` so iOS does not zoom), a toolbar
|
|
1326
|
+
strip of one interactive row (36 px, 44 px with `coar-mobile`), 28 px floating-toolbar buttons (44 px
|
|
1327
|
+
with `coar-mobile`, wrapping within the viewport) and caption-sized text in the table and color
|
|
1328
|
+
pickers. The floating toolbar and the table handles are teleported to `<body>`; they carry the
|
|
1329
|
+
profile classes of the editor they belong to. Without `coar-compact` nothing changes.
|
|
1330
|
+
|
|
1321
1331
|
## Toolbar layout (`tools`)
|
|
1322
1332
|
|
|
1323
1333
|
Pass a `tools` array to control which buttons the **sidebar** toolbar exposes and
|
|
@@ -325,6 +325,15 @@ can still be typed, but formatting commands are not shown.
|
|
|
325
325
|
- `readonly` formats the values as a finished document. No field is editable.
|
|
326
326
|
- Fixed Markdown is never editable in either mode.
|
|
327
327
|
|
|
328
|
+
## Compact presentation (Preview)
|
|
329
|
+
|
|
330
|
+
Inside an element with the class `coar-compact` (the experimental compact profile, working title), the
|
|
331
|
+
form reads its colors from the semantic tokens instead of fixed light values, so it follows dark mode
|
|
332
|
+
and the accent: input-colored block frames with the control radius, the focus color on focus,
|
|
333
|
+
semantic error colors and 12 px error text, filled-in readonly values at weight 600 instead of 700, and
|
|
334
|
+
`design: 'basic'` controls with field-sized text and the height of the Cocoar inputs. Without the
|
|
335
|
+
class nothing changes.
|
|
336
|
+
|
|
328
337
|
## Validation
|
|
329
338
|
|
|
330
339
|
Validation is always calculated, while `show-errors` controls its visual
|
|
@@ -276,3 +276,13 @@ The markdown component uses CSS custom properties for theming:
|
|
|
276
276
|
--coar-markdown-border: var(--coar-border-neutral);
|
|
277
277
|
}
|
|
278
278
|
```
|
|
279
|
+
|
|
280
|
+
### Compact presentation (Preview)
|
|
281
|
+
|
|
282
|
+
Inside an element with the class `coar-compact` (the experimental compact profile, working title), the
|
|
283
|
+
shared stylesheet uses a denser reading layout: 14 px reading text (15 px with `coar-mobile`), headings
|
|
284
|
+
24 / 18 / 16 px at weight 600, 12 / 24 px block and section spacing, sentence-case table headers, inline
|
|
285
|
+
code as a quiet chip and legible frontmatter. Without the class nothing changes. The values are
|
|
286
|
+
`--coar-markdown-*` roles (`--coar-markdown-font-size`, `--coar-markdown-h1-font-size`,
|
|
287
|
+
`--coar-markdown-table-cell-padding`, …) that you can override inside the profile. Colors set in the
|
|
288
|
+
document (`<span style="color: …">`) are kept as they are.
|
|
@@ -166,6 +166,17 @@ exported as pure functions if you need to build your own Mermaid config:
|
|
|
166
166
|
| `readCssTokens(el?)` | `getComputedStyle`-backed token getter. |
|
|
167
167
|
| `makeCssColorResolver()` | Canvas-backed CSS-color → sRGB resolver (handles `oklch(...)`). |
|
|
168
168
|
|
|
169
|
+
### Compact presentation (Preview)
|
|
170
|
+
|
|
171
|
+
Inside an element with the class `coar-compact` (the experimental compact profile, working title), the
|
|
172
|
+
zoom viewport and its controls take the panel radius, the zoom buttons are 28 px (44 px with
|
|
173
|
+
`coar-mobile`, since they are the only way to zoom on touch), and the loading and error states use the
|
|
174
|
+
UI text size. The diagram itself keeps Mermaid's sizes.
|
|
175
|
+
|
|
176
|
+
Mermaid's configuration is global to the page. A page that uses one profile initializes Mermaid once,
|
|
177
|
+
as before; when a diagram of the other profile renders, Mermaid is initialized again with that
|
|
178
|
+
diagram's tokens.
|
|
179
|
+
|
|
169
180
|
## In markdown
|
|
170
181
|
|
|
171
182
|
To render diagrams from ` ```mermaid ` fences inside `<CoarMarkdown>`, don't wire
|
|
@@ -1250,6 +1250,16 @@ The editor container surfaces these CSS custom properties:
|
|
|
1250
1250
|
|
|
1251
1251
|
To register your own Monaco theme, call `monaco.editor.defineTheme('my-theme', {...})` anywhere in your app and pass it via the underlying editor instance (`editorRef.value?.getEditor().updateOptions({ theme: 'my-theme' })`).
|
|
1252
1252
|
|
|
1253
|
+
### Compact presentation (Preview)
|
|
1254
|
+
|
|
1255
|
+
Two more themes, `coar-compact-light` and `coar-compact-dark` (slate neutrals, line numbers at 4.5:1),
|
|
1256
|
+
are registered next to the two above, which stay unchanged. Monaco themes apply to every editor on the
|
|
1257
|
+
page, so the compact themes are used only when `<html>` or `<body>` has the class `coar-compact`
|
|
1258
|
+
(the experimental compact profile, working title); `theme` keeps choosing light or dark. The editor
|
|
1259
|
+
frame follows a local `coar-compact` area too (control radius), but Monaco's colors inside it do not:
|
|
1260
|
+
mixing default and compact editors on one page is not supported. The compact themes use fixed colors
|
|
1261
|
+
and do not follow token or accent overrides.
|
|
1262
|
+
|
|
1253
1263
|
### Font
|
|
1254
1264
|
|
|
1255
1265
|
The editor renders code in **Cascadia Code** (Microsoft's ligature-enabled coding font) with `Consolas`, `Monaco`, `Courier New` as fallback. Ligatures are enabled by default, so `!=`, `=>`, `===`, and `&&` render as combined glyphs. This matches `CoarCodeBlock` — both components share the same font stack.
|
|
@@ -434,6 +434,11 @@ A realistic card built entirely with semantic tokens. Toggle light/dark mode to
|
|
|
434
434
|
<code>--coar-background-accent-primary</code>
|
|
435
435
|
<span class="annotation-desc">Primary button</span>
|
|
436
436
|
</div>
|
|
437
|
+
<div class="annotation">
|
|
438
|
+
<span class="annotation-dot" style="background: var(--coar-text-on-accent)"></span>
|
|
439
|
+
<code>--coar-text-on-accent</code>
|
|
440
|
+
<span class="annotation-desc">Computed button ink</span>
|
|
441
|
+
</div>
|
|
437
442
|
<div class="annotation">
|
|
438
443
|
<span class="annotation-dot" style="background: var(--coar-border-neutral-tertiary)"></span>
|
|
439
444
|
<code>--coar-border-neutral-tertiary</code>
|
|
@@ -485,7 +490,7 @@ A realistic card built entirely with semantic tokens. Toggle light/dark mode to
|
|
|
485
490
|
.avatar-text {
|
|
486
491
|
font-size: 14px;
|
|
487
492
|
font-weight: 700;
|
|
488
|
-
color: var(--coar-text-on-bold);
|
|
493
|
+
color: var(--coar-text-on-accent, var(--coar-text-on-bold));
|
|
489
494
|
}
|
|
490
495
|
|
|
491
496
|
.card-header-text {
|
|
@@ -553,7 +558,7 @@ A realistic card built entirely with semantic tokens. Toggle light/dark mode to
|
|
|
553
558
|
border-radius: 8px;
|
|
554
559
|
border: none;
|
|
555
560
|
background: var(--coar-background-accent-primary);
|
|
556
|
-
color: var(--coar-text-on-bold);
|
|
561
|
+
color: var(--coar-text-on-accent, var(--coar-text-on-bold));
|
|
557
562
|
font-size: 13px;
|
|
558
563
|
font-weight: 600;
|
|
559
564
|
cursor: pointer;
|
|
@@ -676,7 +681,31 @@ All tokens follow a predictable pattern:
|
|
|
676
681
|
| `--coar-text-accent-primary` | Accent-colored text (links, highlights) |
|
|
677
682
|
| `--coar-text-accent-secondary` | Lighter accent text |
|
|
678
683
|
| `--coar-text-brand-primary` | Brand-colored text |
|
|
679
|
-
| `--coar-text-on-
|
|
684
|
+
| `--coar-text-on-accent` | Computed black or white on the primary accent fill |
|
|
685
|
+
| `--coar-text-on-success` | Computed black or white on the solid success fill |
|
|
686
|
+
| `--coar-text-on-error` | Computed black or white on the solid error fill |
|
|
687
|
+
| `--coar-text-on-warning` | Computed black or white on the solid warning fill |
|
|
688
|
+
| `--coar-text-on-info` | Computed black or white on the solid info fill |
|
|
689
|
+
| `--coar-text-on-bold` | Legacy white role; retained for direct use and as a fallback |
|
|
690
|
+
|
|
691
|
+
### Text on saturated fills (Preview)
|
|
692
|
+
|
|
693
|
+
The five `--coar-text-on-*` roles choose pure white or black from their actual
|
|
694
|
+
solid fill, using the stronger APCA contrast. They work with every preset and
|
|
695
|
+
without a theme. The same ink is used on hover and pressed states; links,
|
|
696
|
+
validation text and text on tinted surfaces continue to use their palette roles.
|
|
697
|
+
|
|
698
|
+
Set a role to override the calculation, including a `light-dark()` pair:
|
|
699
|
+
|
|
700
|
+
```css
|
|
701
|
+
.coar-theme--acme {
|
|
702
|
+
--coar-text-on-accent: light-dark(#102a43, #f0f8ff);
|
|
703
|
+
}
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
Overrides are retained even when contrast is low. APCA selection is not a WCAG
|
|
707
|
+
4.5:1 guarantee. `--coar-text-on-threshold` is the APCA luminance crossing used by
|
|
708
|
+
the CSS calculation; normally leave it unchanged.
|
|
680
709
|
|
|
681
710
|
### Border
|
|
682
711
|
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
<!-- Generated from apps/docs/foundations/compact-presentation.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
|
|
2
|
+
|
|
3
|
+
# Compact presentation (Preview)
|
|
4
|
+
|
|
5
|
+
The compact presentation is an experiment across the library, not a change of the default theme.
|
|
6
|
+
It uses smaller, normally weighted Inter text, Slate-tinted structure, restrained corners and
|
|
7
|
+
aligned controls. Existing props, events and data formats are unchanged.
|
|
8
|
+
|
|
9
|
+
Compact is a set of values for the tokens every theme uses. The library derives everything else
|
|
10
|
+
from them, with the same rules for every theme. There are two ways to apply the values:
|
|
11
|
+
|
|
12
|
+
- **As a theme of your own:** load the **Compact** preset in the [Theme Editor](./theming.md),
|
|
13
|
+
adjust it (another font, other sizes or colours) and ship the exported theme class. No
|
|
14
|
+
`.coar-compact` is involved.
|
|
15
|
+
- **With the class `.coar-compact`:** the entry the first betas introduced. It applies the same
|
|
16
|
+
values and stays supported; everything below that names the class holds for a theme class too.
|
|
17
|
+
|
|
18
|
+
## Compare this documentation
|
|
19
|
+
|
|
20
|
+
Use **Style → Bisher / Compact** in the navigation to switch the entire documentation:
|
|
21
|
+
the VitePress shell, prose and ordinary live component examples. In a narrower window, the
|
|
22
|
+
selector is in the main navigation menu. The mobile documentation has the same selector in its header.
|
|
23
|
+
|
|
24
|
+
Loading the **Compact** preset in the Theme Editor (the button at the bottom right) switches the
|
|
25
|
+
documentation the same way, shell and prose included, with values you can then edit.
|
|
26
|
+
|
|
27
|
+
The choice is remembered in this browser and follows page navigation. Embedded phone/tablet
|
|
28
|
+
demos follow it without reloading, so their form values and open dialogs remain intact.
|
|
29
|
+
Light/dark mode remains independent. If browser storage is blocked, switching still works
|
|
30
|
+
for the current visit.
|
|
31
|
+
|
|
32
|
+
**Bisher** remains the default. Examples that explicitly opt into Compact, including the
|
|
33
|
+
sample on this page, remain Compact in either site mode; explicit theme demonstrations keep
|
|
34
|
+
their own scopes. This documentation preference does not change an application's opt-in.
|
|
35
|
+
|
|
36
|
+
## Opt in
|
|
37
|
+
|
|
38
|
+
### With an exported theme
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import '@cocoar/vue-ui/styles';
|
|
42
|
+
import '@cocoar/vue-ui/fonts/compact'; // or the font your theme names
|
|
43
|
+
import './coar-theme--myapp.css'; // Theme Editor → Compact → Download CSS
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<html class="coar-theme--myapp">
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
See [Exporting a theme based on Compact](./theming.md#exporting-a-theme-based-on-compact) for what the
|
|
51
|
+
file contains.
|
|
52
|
+
|
|
53
|
+
### With `.coar-compact`
|
|
54
|
+
|
|
55
|
+
Keep the normal stylesheet import and load the optional font entry:
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
import '@cocoar/vue-ui/styles';
|
|
59
|
+
import '@cocoar/vue-ui/fonts/compact';
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
```vue
|
|
63
|
+
<CoarThemeScope mode="light">
|
|
64
|
+
<section class="coar-compact">
|
|
65
|
+
<!-- UI, calendar, grids, editors, viewer and map chrome -->
|
|
66
|
+
</section>
|
|
67
|
+
</CoarThemeScope>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Use `.coar-compact` on `html` for an entire application, or on a container for a local comparison.
|
|
71
|
+
Areas outside the class retain the existing desktop and mobile presentation. The library does not
|
|
72
|
+
paint an application's page background; use `background: var(--coar-background-neutral-primary)`
|
|
73
|
+
on your page or panel.
|
|
74
|
+
|
|
75
|
+
Load `@cocoar/vue-ui/fonts` as before if the same document also displays the legacy typography.
|
|
76
|
+
The compact entry self-hosts Inter 400, 500, 600 and 700; it does not load fonts from a CDN.
|
|
77
|
+
|
|
78
|
+
## Density and typography
|
|
79
|
+
|
|
80
|
+
| Role | Desktop | With `.coar-mobile` |
|
|
81
|
+
| --- | --- | --- |
|
|
82
|
+
| Body | 14 px / 1.5, weight 400 | 14 px / 1.5 |
|
|
83
|
+
| Actions and UI labels | 13 px, weight 400/500 | 14 px |
|
|
84
|
+
| Input text `xs / s / m / l` | 12 / 13 / 14 / 16 px | 16 / 16 / 16 / 18 px |
|
|
85
|
+
| Caption | 12 px | 12 px |
|
|
86
|
+
| Normal control | 36 px | 44 px |
|
|
87
|
+
| Controls `xs / s / m / l` | 24 / 32 / 36 / 44 px | 44 / 44 / 44 / 48 px |
|
|
88
|
+
| Control / panel radius | 6 / 8 px | 6 / 8 px |
|
|
89
|
+
|
|
90
|
+
Input text and action text are deliberately independent. A small visible icon is not a small touch
|
|
91
|
+
target. Dense calendar labels and document/code content have their own roles; they are not scaled
|
|
92
|
+
by a global zoom or density multiplier.
|
|
93
|
+
|
|
94
|
+
`--coar-field-font-size` sets the medium field text. Extra-small, small and large text default
|
|
95
|
+
to two pixels smaller, one pixel smaller and two pixels larger. Override those sizes independently
|
|
96
|
+
with `--coar-field-xs-font-size`, `--coar-field-s-font-size` and `--coar-field-l-font-size` on the
|
|
97
|
+
Compact boundary. Nested themes inherit these overrides; an explicit theme reset restores defaults.
|
|
98
|
+
`--coar-field-min-font-size` keeps all mobile field text at least 16 px without enlarging action text.
|
|
99
|
+
Single-line controls retain their existing heights. Multiline fields retain their previous minimum
|
|
100
|
+
row spacing and add leading when their text is larger than medium, so umlauts and descenders do not
|
|
101
|
+
clip or touch. Textareas with many rows can therefore grow to fit the larger type.
|
|
102
|
+
The playground's `/design-review/field-sizes` page exercises the same roles across text,
|
|
103
|
+
selection, date/time and OTP fields.
|
|
104
|
+
|
|
105
|
+
Fixed week grids keep a minimum day-column width and scroll horizontally inside the calendar
|
|
106
|
+
instead of clipping the last day. A horizontal gesture scrolls that overflow; range paging resumes
|
|
107
|
+
when all columns fit. Month overflow actions follow a separate target-size role. Timed-event resize
|
|
108
|
+
targets occupy a side rail, leaving the body available for moving. Short or narrow cards bound the
|
|
109
|
+
rail to half the card: they do not promise full-size touch targets, and arrow keys remain an alternative.
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<section class="coar-compact coar-mobile">…</section>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Live demo in phone size: [Compact fields and keyboard-aware sheet](https://docs.cocoar.dev/cocoar-ui-vue/mobile/#/compact)
|
|
116
|
+
|
|
117
|
+
<div class="coar-mobile">
|
|
118
|
+
|
|
119
|
+
**Demo — `mobile/demos/CompactDemo.vue`**
|
|
120
|
+
|
|
121
|
+
```vue
|
|
122
|
+
<script setup lang="ts">
|
|
123
|
+
import { ref } from 'vue';
|
|
124
|
+
import { CoarButton, CoarCheckbox, CoarFormField, CoarSelect, CoarTextInput, useDialog } from '@cocoar/vue-ui';
|
|
125
|
+
import '@cocoar/vue-ui/fonts/compact';
|
|
126
|
+
import SheetDemoContact, { type Contact } from './SheetDemoContact.vue';
|
|
127
|
+
|
|
128
|
+
const name = ref('Anna Berger');
|
|
129
|
+
const status = ref<string | null>('review');
|
|
130
|
+
const notify = ref(true);
|
|
131
|
+
const message = ref('Synthetic data only.');
|
|
132
|
+
const dialog = useDialog();
|
|
133
|
+
const contact: Contact = {
|
|
134
|
+
name: 'Anna Berger', email: 'anna@example.com', phone: '+43 1 234 567',
|
|
135
|
+
company: 'Example', street: 'Ringstraße 12', postcode: '1010',
|
|
136
|
+
city: 'Vienna', country: 'Austria', notes: 'Synthetic compact presentation sample.',
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
async function edit() {
|
|
140
|
+
const result = await dialog.open<Contact>(
|
|
141
|
+
SheetDemoContact,
|
|
142
|
+
{ title: 'Compact contact', presentation: 'sheet' },
|
|
143
|
+
{ contact },
|
|
144
|
+
).result;
|
|
145
|
+
message.value = result ? `Saved “${result.name}”.` : 'Editing cancelled.';
|
|
146
|
+
}
|
|
147
|
+
</script>
|
|
148
|
+
|
|
149
|
+
<template>
|
|
150
|
+
<section class="coar-compact compact-demo">
|
|
151
|
+
<p>Preview: 44 px controls, 14 px actions and separate 16 px input text.</p>
|
|
152
|
+
<CoarFormField label="Name"><CoarTextInput v-model="name" clearable /></CoarFormField>
|
|
153
|
+
<CoarFormField label="Status">
|
|
154
|
+
<CoarSelect v-model="status" :options="[
|
|
155
|
+
{ value: 'review', label: 'In Prüfung' },
|
|
156
|
+
{ value: 'planned', label: 'Geplant' },
|
|
157
|
+
{ value: 'done', label: 'Abgeschlossen' },
|
|
158
|
+
]" />
|
|
159
|
+
</CoarFormField>
|
|
160
|
+
<CoarCheckbox v-model="notify" label="Benachrichtigungen senden" />
|
|
161
|
+
<CoarButton full-width @click="edit">Edit compact contact</CoarButton>
|
|
162
|
+
<output>{{ message }}</output>
|
|
163
|
+
</section>
|
|
164
|
+
</template>
|
|
165
|
+
|
|
166
|
+
<style scoped>
|
|
167
|
+
.compact-demo { display: grid; gap: 12px; padding: 16px; background: var(--coar-background-neutral-primary); }
|
|
168
|
+
.compact-demo p { margin: 0; }
|
|
169
|
+
.compact-demo output { overflow-wrap: anywhere; color: var(--coar-text-neutral-secondary); }
|
|
170
|
+
</style>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
</div>
|
|
174
|
+
|
|
175
|
+
## Theme inputs and local specialization
|
|
176
|
+
|
|
177
|
+
`CoarThemeScope` continues to accept accent, semantic colors, fonts and component radii.
|
|
178
|
+
Without an explicit accent, Compact uses Slate (`#334155`) for its primary fill instead of the
|
|
179
|
+
legacy blue. An accent you name is used as you chose it: the primary fill shows the colour itself.
|
|
180
|
+
The palette follows the library's common curve in both cases, including its absolute chroma:
|
|
181
|
+
derived accent text, borders and interaction states can therefore be saturated blue even with
|
|
182
|
+
the Slate default. Hover and pressed fills use the default theme's steps for each colour scheme.
|
|
183
|
+
Normal field outlines use a muted Slate tone; hover strengthens them only slightly.
|
|
184
|
+
The `--coar-border-input` and `--coar-border-input-hover` roles remain independently
|
|
185
|
+
customizable, separate from focus and semantic error colors.
|
|
186
|
+
|
|
187
|
+
```vue
|
|
188
|
+
<CoarThemeScope :theme="{ accent: '#15803d', bodyFontFamily: 'Inter', buttonRadius: 8 }">
|
|
189
|
+
<section class="coar-compact">…</section>
|
|
190
|
+
</CoarThemeScope>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Apply shared role overrides on a presentation boundary (`.coar-compact`, `CoarThemeScope`, or
|
|
194
|
+
`.coar-theme-scope`), where dependent aliases are recalculated. Setting a source variable on an
|
|
195
|
+
arbitrary descendant does not recalculate aliases that CSS already resolved on its ancestor.
|
|
196
|
+
|
|
197
|
+
```html
|
|
198
|
+
<div class="coar-compact">
|
|
199
|
+
<section class="coar-theme-scope" style="--coar-ui-font-size: 14px; --coar-panel-radius: 10px">
|
|
200
|
+
…
|
|
201
|
+
</section>
|
|
202
|
+
</div>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Package roles stay independent where their meaning differs: grid row heights, calendar event
|
|
206
|
+
geometry, document pages and editor line heights are not interchangeable control heights.
|
|
207
|
+
Consumer-supplied event colors, map geometry, PDF content and saved page layouts are not rewritten.
|
|
208
|
+
|
|
209
|
+
Inside compact, `.coar-theme-none` resets brand inputs to the compact light defaults without
|
|
210
|
+
turning the presentation into a mixture of legacy and compact tokens. It retains the surrounding
|
|
211
|
+
mobile presentation. Use a sibling outside `.coar-compact` for a fully legacy area.
|
|
212
|
+
|
|
213
|
+
## Teleports and global renderers
|
|
214
|
+
|
|
215
|
+
Library overlays carry the theme in effect at their trigger, its local scope, mobile roles and
|
|
216
|
+
explicit overrides, including changes while open, whether the theme comes from `.coar-compact` or
|
|
217
|
+
from a theme class. Custom library-like teleports can use the Preview helper:
|
|
218
|
+
|
|
219
|
+
```ts
|
|
220
|
+
const presentation = useCompactPresentationContext(() => origin.value);
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
```vue
|
|
224
|
+
<Teleport to="body">
|
|
225
|
+
<div :class="presentation.classes" :style="presentation.style">…</div>
|
|
226
|
+
</Teleport>
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
The helper is exported from `@cocoar/vue-ui`; it observes source ancestors, not all computed CSS
|
|
230
|
+
properties. Register the origin as an element ref and keep it mounted while the tool is open.
|
|
231
|
+
|
|
232
|
+
- **Monaco:** themes are document-global. Compact editor colors activate only when the theme applies
|
|
233
|
+
to `html` or `body` (through `.coar-compact` or a theme class); local compact frames do not
|
|
234
|
+
promise an independent Monaco theme.
|
|
235
|
+
Compare legacy and compact editors in separate documents. Shared color roles are converted to
|
|
236
|
+
concrete Monaco colors; code typography remains independent of the UI scale.
|
|
237
|
+
- **Mermaid:** rendering is serialized with the configuration resolved from the theme in effect at
|
|
238
|
+
the diagram. Local mode and token changes rerender such diagrams; stored diagram source is unchanged.
|
|
239
|
+
- **Map:** Leaflet's controls, popups and tooltips follow the theme in effect at the map. Without a
|
|
240
|
+
theme the library leaves Leaflet's own styles, and yours, alone.
|
|
241
|
+
- **Page Builder:** authoring chrome uses the compact roles, including theme-aware accent ink for
|
|
242
|
+
selected canvas labels and frames. Saved layout and document geometry retain their meaning.
|
|
243
|
+
Embedded library widgets still use the host presentation.
|
|
244
|
+
|
|
245
|
+
The profile does not add missing touch features: Monaco editing, hover-only editor handles,
|
|
246
|
+
some viewer flyouts and desktop-oriented builder interactions retain their documented device limits.
|
|
247
|
+
Browser emulation is not native keyboard or safe-area acceptance.
|
|
248
|
+
|
|
249
|
+
This preview is for testing in real applications, not a completed design review. Native calendar
|
|
250
|
+
gestures and some grid editor and document viewer states still need verification. Keep the
|
|
251
|
+
theme class (or `.coar-compact`) behind an app-level toggle so testers can compare with the default
|
|
252
|
+
presentation.
|
|
@@ -21,9 +21,15 @@ import CoarThemeEditor from '@cocoar/vue-ui/theme-editor';
|
|
|
21
21
|
|
|
22
22
|
### Props
|
|
23
23
|
|
|
24
|
+
Mounted inside a `.coar-compact` area (the compatibility entry of the Preview
|
|
25
|
+
[compact presentation](./compact-presentation.md)), the editor targets that area rather than a
|
|
26
|
+
neighboring default area. Its teleported tools keep that area's presentation. The editor remains a
|
|
27
|
+
single live editor per document.
|
|
28
|
+
|
|
24
29
|
| Prop | Type | Default | Description |
|
|
25
30
|
|------|------|---------|-------------|
|
|
26
|
-
| `hideDarkToggle` | `boolean` | `false` | Hides the light/dark toggle. Set to `true` when your app manages dark mode itself. |
|
|
31
|
+
| `hideDarkToggle` | `boolean` | `false` | Hides the light/dark toggle. Set to `true` when your app manages dark mode itself; the editor then edits the colours of the scheme your app shows. |
|
|
32
|
+
| `fontPreview` | `boolean` | `true` | Fetches a font chosen in the editor from Google Fonts when the page does not have it, to preview it. See [Type](#type). |
|
|
27
33
|
|
|
28
34
|
## The Token Tree
|
|
29
35
|
|
|
@@ -46,7 +52,13 @@ Changing a primitive ripples through semantic tokens, which ripple through every
|
|
|
46
52
|
|
|
47
53
|
### Presets
|
|
48
54
|
|
|
49
|
-
|
|
55
|
+
Five built-in starting points: **Enterprise** (default), **Modern SaaS** (rounded), **Playful** (pill buttons, vivid accent), **Minimal** (sharp corners, no shadows) and **Compact** (Preview) (smaller Inter text, Slate surfaces, 36 px controls). Selecting a preset resets all other tabs to the preset's values.
|
|
56
|
+
|
|
57
|
+
A preset is a complete set of values on the same token contract. Modern SaaS, Playful and Minimal start from Enterprise and supply their own differences; Compact supplies the [compact presentation](./compact-presentation.md). Selecting a card loads its values without reloading the page, and every tab works on top of them. The editor starts with Enterprise, or Compact when mounted inside `.coar-compact`, but applies nothing to the app until you make a change.
|
|
58
|
+
|
|
59
|
+
### Values of this theme
|
|
60
|
+
|
|
61
|
+
Available for **every preset**. It lists the model's values in three groups: typography (body, action, field and caption text), sizes (control heights, row height, paddings, radii) and surfaces and text as a light and a dark colour each. Change any of them independently; the reset button of a row restores the value of the loaded preset. Every preset can be exported as a standalone stylesheet, including before any edit.
|
|
50
62
|
|
|
51
63
|
### Brand
|
|
52
64
|
|
|
@@ -60,11 +72,46 @@ Sets the five base hue values that anchor the entire palette:
|
|
|
60
72
|
| `--coar-warning` | `#cc821f` | Caution |
|
|
61
73
|
| `--coar-info` | `#5e6b84` | Neutral informational |
|
|
62
74
|
|
|
63
|
-
|
|
75
|
+
**Light and dark** (Preview). The Appearance switch at the top of the tab chooses the scheme you see and the one you edit. Every colour of the editor is calculated until you set it:
|
|
76
|
+
|
|
77
|
+
- A base colour is set in light. In dark it is locked and follows the light colour (or the dark half the preset gives it); unlock it to choose another dark colour, lock it again to follow light.
|
|
78
|
+
- Under each base colour, **Aa** shows the text on its solid fill (a primary button, a status badge) with its APCA contrast (Lc). The text colour is calculated for the best contrast in both schemes; unlock it to choose one. Below Lc 60 the editor warns that the text is hard to read; it never refuses the colour.
|
|
79
|
+
|
|
80
|
+
Each colour opens a **palette editor** (floating panel) for the scheme you edit, where you fine-tune L (lightness) and C (chroma) of every step 50–900, step 500 included, in oklch. A step you set is written as its `-lc` or `-lc-dark` input; the other scheme keeps its curve.
|
|
81
|
+
|
|
82
|
+
#### Base colours per scheme (Preview)
|
|
83
|
+
|
|
84
|
+
A value-based theme accepts one colour for both schemes, or a `light-dark()` pair,
|
|
85
|
+
through `--coar-theme-accent`, `--coar-theme-success`, `--coar-theme-error`,
|
|
86
|
+
`--coar-theme-warning` and `--coar-theme-info`. These inputs survive nested
|
|
87
|
+
light/dark boundaries and are carried into teleported overlays. For example,
|
|
88
|
+
over an exported theme:
|
|
89
|
+
|
|
90
|
+
```css
|
|
91
|
+
.coar-theme--acme {
|
|
92
|
+
--coar-theme-accent: light-dark(#1183cd, #facc15);
|
|
93
|
+
--coar-theme-success: light-dark(#15803d, #0d9488);
|
|
94
|
+
--coar-color-green-600-lc-dark: 0.8 0.08;
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Each palette step has its own `-lc` and `-lc-dark` input, including step 500
|
|
99
|
+
(`l c` preserves the base colour). The four status palettes use `green`, `red`,
|
|
100
|
+
`amber` and `slate` in their token names. Existing base and palette overrides
|
|
101
|
+
keep working; `CoarThemeScope` inputs still take precedence over preset values.
|
|
102
|
+
The Brand tab writes exactly these inputs, and only those you set.
|
|
64
103
|
|
|
65
104
|
### Semantic
|
|
66
105
|
|
|
67
|
-
|
|
106
|
+
Text on a solid accent or status fill uses its own computed role:
|
|
107
|
+
`--coar-text-on-accent`, `--coar-text-on-success`, `--coar-text-on-error`,
|
|
108
|
+
`--coar-text-on-warning` and `--coar-text-on-info` (Preview). Each chooses white or
|
|
109
|
+
black by APCA, with or without a preset. A theme can override a role with any
|
|
110
|
+
colour or a `light-dark()` pair; text on neutral or tinted surfaces remains
|
|
111
|
+
palette-derived. See [text on saturated fills](./colors.md#text-on-saturated-fills-preview)
|
|
112
|
+
and the [migration note](../guide/migration-color-roles.md).
|
|
113
|
+
|
|
114
|
+
Maps semantic roles to palette entries, for the scheme you edit. Each row shows the resolved color, lets you pick a palette (Accent / Red / Green / Amber / Slate) and a step (50–900), and has a reset button that turns accent-colored when changed. A role you set in one scheme keeps its default in the other; set in both, it is exported as a `light-dark()` pair.
|
|
68
115
|
|
|
69
116
|
This is the layer that connects intent to color: `--coar-background-semantic-error-bold` points at `Red / 600` by default. Reassigning it to `Amber / 600` would make all error surfaces amber — including form field borders, toast backgrounds, and the danger button — without touching any component code.
|
|
70
117
|
|
|
@@ -74,7 +121,15 @@ Controls the global radius scale (`xxs` → `xl`) plus per-component-group overr
|
|
|
74
121
|
|
|
75
122
|
### Type
|
|
76
123
|
|
|
77
|
-
Font family for body text and headings,
|
|
124
|
+
Font family for body text and headings. Choose Poppins, Inter, Onest, DM Sans, Nunito, Geist or the system font from the list, or **Other font…** to type any family name.
|
|
125
|
+
|
|
126
|
+
**Trying a font without installing it.** When the page does not have the family you chose or typed, the editor fetches it from Google Fonts to show it, and says so under the field. This is a preview only:
|
|
127
|
+
|
|
128
|
+
- The downloaded theme names the font and does not contain it. The file starts with a comment that lists each font and what your app has to load for it.
|
|
129
|
+
- The request goes to Google and carries the IP address of whoever uses the editor. It happens only for a font chosen in the editor, never when the editor mounts. Switch it off with `:font-preview="false"`; a font the page lacks then shows its fallback.
|
|
130
|
+
- A name Google Fonts does not know shows only where that font is installed on the device.
|
|
131
|
+
|
|
132
|
+
The library self-hosts three font entries, none of which loads anything from a CDN: `@cocoar/vue-ui/fonts` (Poppins, Inter 400 and 700, Cascadia Code), `@cocoar/vue-ui/fonts/compact` (Inter 400 to 700) and `@cocoar/vue-ui/fonts/onest` (Onest 400 to 700). Load any other family yourself, self-hosted or from your font provider.
|
|
78
133
|
|
|
79
134
|
### Spacing
|
|
80
135
|
|
|
@@ -88,16 +143,32 @@ Box shadow per component group (buttons never have shadows; cards, menus, dialog
|
|
|
88
143
|
|
|
89
144
|
A single duration multiplier that scales all `--coar-duration-*` tokens proportionally. Set to 0 for instant transitions, or push it above 2× to slow everything down for testing.
|
|
90
145
|
|
|
146
|
+
## Resetting
|
|
147
|
+
|
|
148
|
+
The reset button of a control restores the value of the loaded preset; a lock does the same for a colour of one scheme. **Reset** in the header removes everything the editor changed, in light and in dark, and nothing else: the theme your app has without the editor shows again. Light or dark mode, `.coar-mobile`, other theme scopes and the state of your app are left as they are.
|
|
149
|
+
|
|
91
150
|
## Exporting
|
|
92
151
|
|
|
93
|
-
Type a class name into the name field at the bottom of the editor (default: `custom`), then click **Download CSS
|
|
152
|
+
Type a class name into the name field at the bottom of the editor (default: `custom`), then click **Download CSS**. The live preview and the download are the same CSS, written for another class. Whatever preset you start from, the file contains every value a fresh app needs, with your changes in place, not only the differences against a preset the app would not have. A colour you left locked is written as its calculation; one you set is written as its value, or as a `light-dark()` pair where light and dark differ:
|
|
94
153
|
|
|
95
154
|
```css
|
|
96
|
-
/* coar-theme--myapp.css */
|
|
97
|
-
.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
155
|
+
/* coar-theme--myapp.css (shortened) */
|
|
156
|
+
@layer cocoar.tokens {
|
|
157
|
+
.coar-theme--myapp {
|
|
158
|
+
--coar-role-derivation: ; /* derive the dependent tokens from these values */
|
|
159
|
+
--coar-theme-accent: light-dark(#7c3aed, #a78bfa); /* a dark accent you unlocked */
|
|
160
|
+
--coar-color-accent-600-lc-dark: 0.72 0.12; /* a palette step you set in dark */
|
|
161
|
+
--coar-font-family-body: var(--coar-appearance-font-body, Inter, ui-sans-serif, system-ui, sans-serif);
|
|
162
|
+
--coar-ui-font-size: 13px;
|
|
163
|
+
/* … */
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.coar-mobile .coar-theme--myapp,
|
|
167
|
+
.coar-theme--myapp.coar-mobile,
|
|
168
|
+
.coar-theme--myapp .coar-mobile {
|
|
169
|
+
--coar-interactive-row-height: 44px; /* touch sizes where the theme meets .coar-mobile */
|
|
170
|
+
/* … */
|
|
171
|
+
}
|
|
101
172
|
}
|
|
102
173
|
```
|
|
103
174
|
|
|
@@ -119,8 +190,22 @@ import '@cocoar/vue-ui/styles';
|
|
|
119
190
|
import './coar-theme--myapp.css';
|
|
120
191
|
```
|
|
121
192
|
|
|
193
|
+
`--coar-role-derivation` (an empty value) is what makes the library derive palette steps, aliases and component roles from the values of the theme, on its class and on the scopes nested in it. The app needs the theme class and this file, loaded after the Cocoar stylesheet; it does not need `.coar-compact`. Dark mode and `.coar-mobile` stay separate choices of the app and combine with the theme.
|
|
194
|
+
|
|
195
|
+
The file is written into the cascade layer of the library's tokens, where `.coar-compact` is too. Your own unlayered styles therefore keep the last word, exactly as with the class: the theme sets body text to 14 px on its scope, and an app that declares `html { font-size: 16px }` itself keeps its 16 px (and the `rem` sizes that follow from it).
|
|
196
|
+
|
|
197
|
+
The file names a font, it does not ship one, and it starts with a comment saying what to load. Load the font your theme uses yourself: `import '@cocoar/vue-ui/fonts/compact'` for the Inter weights of the Compact preset, `import '@cocoar/vue-ui/fonts/onest'` for Onest, or your own `@font-face` rules for another family.
|
|
198
|
+
|
|
122
199
|
Because themes are classes, you can apply different themes to different subtrees:
|
|
123
200
|
|
|
201
|
+
> [!WARNING]
|
|
202
|
+
> Reliable isolation of **different nested presets** uses CSS `@scope` and requires
|
|
203
|
+
> Firefox 146+ (Chrome/Edge 119+ and Safari 18+ already support it). Older browsers
|
|
204
|
+
> retain the single-preset fallback, but outer preset values can leak into an inner
|
|
205
|
+
> preset. This does not raise the requirements for an ordinary single preset or
|
|
206
|
+
> light/dark switching. See [browser compatibility](../guide/theming.md#different-presets-inside-one-another-preview),
|
|
207
|
+
> including the Safari 26.0–26.3 native-field caveat. Put theme and mode classes on containers.
|
|
208
|
+
|
|
124
209
|
```html
|
|
125
210
|
<html class="coar-theme--myapp">
|
|
126
211
|
<!-- most of the app uses the custom theme -->
|
|
@@ -6,6 +6,9 @@ Our type system creates clear visual hierarchy and ensures readability across al
|
|
|
6
6
|
|
|
7
7
|
## Type Scale
|
|
8
8
|
|
|
9
|
+
These are the existing defaults. The opt-in [compact presentation](./compact-presentation.md) uses
|
|
10
|
+
Inter throughout with a smaller, separate UI/input scale; it does not change these defaults.
|
|
11
|
+
|
|
9
12
|
Each row shows the style rendered at its actual size, with font metadata alongside.
|
|
10
13
|
|
|
11
14
|
**Demo — `typography/demos/TypeScale.vue`**
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<!-- Generated from apps/docs/guide/migration-color-roles.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
|
|
2
|
+
|
|
3
|
+
# Migrating text on saturated fills
|
|
4
|
+
|
|
5
|
+
Primary and danger buttons, filled badges, selection marks and other saturated
|
|
6
|
+
accent surfaces now read their own `--coar-text-on-accent|success|error|warning|info`
|
|
7
|
+
role (Preview). Without an override, APCA chooses pure white or black from the
|
|
8
|
+
fill. This applies even without a theme or Theme Editor.
|
|
9
|
+
|
|
10
|
+
The library's default fills keep white text. A custom bright accent may now use
|
|
11
|
+
black instead of white. APCA and WCAG contrast ratios are different; automatic
|
|
12
|
+
selection does not guarantee a WCAG ratio of 4.5:1.
|
|
13
|
+
|
|
14
|
+
`--coar-text-on-bold` still exists and keeps its previous meaning, but changing it
|
|
15
|
+
alone no longer overrides text on these saturated fills. Themes that previously
|
|
16
|
+
set it should set the relevant new roles explicitly to keep their chosen ink:
|
|
17
|
+
|
|
18
|
+
```css
|
|
19
|
+
.coar-theme--acme {
|
|
20
|
+
--coar-text-on-accent: light-dark(#102a43, #f0f8ff);
|
|
21
|
+
--coar-text-on-error: #ffffff;
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
One ink is used for normal, hover and pressed fills. Palette-derived text on
|
|
26
|
+
neutral or softly tinted surfaces, including links, notes and validation
|
|
27
|
+
messages, is unaffected. Calendar event-specific ink policies and explicit
|
|
28
|
+
event text colours continue to work as before.
|
|
@@ -417,14 +417,14 @@ are only being added, and testing on real devices remains the job of the app.
|
|
|
417
417
|
|
|
418
418
|
| Page | Desktop | Tablet | Phone | Note |
|
|
419
419
|
|---|---|---|---|---|
|
|
420
|
-
| [Map](../components/map/index.md) | ready | ready | partial |
|
|
420
|
+
| [Map](../components/map/index.md) | ready | ready | partial | Touch pan/zoom; compact mobile enlarges zoom and list controls. Dense pins and vertices retain small spatial targets. |
|
|
421
421
|
| [Map Editor](../components/map/editor.md) | ready | partial | partial | Map editing works on touch; the point list's drag reorder is mouse-only and nothing is phone-adapted. |
|
|
422
422
|
|
|
423
423
|
**Calendar (@cocoar/vue-calendar)**
|
|
424
424
|
|
|
425
425
|
| Page | Desktop | Tablet | Phone | Note |
|
|
426
426
|
|---|---|---|---|---|
|
|
427
|
-
| [Calendar](../components/calendar/index.md) | ready | partial | planned |
|
|
427
|
+
| [Calendar](../components/calendar/index.md) | ready | partial | planned | Touch taps, paging and long-press selection work; legacy resize targets are 6 px. Compact targets stay smaller on short/crowded events. |
|
|
428
428
|
| [`<CoarCalendar>` — Composer](../components/calendar/coar-calendar.md) | ready | partial | planned | Taps, swipe paging and long-press selection work on touch; event resize handles are only 6 px tall. |
|
|
429
429
|
| [`<CoarYearView>` — Year View](../components/calendar/year-view.md) | ready | ready | planned | Tap to drill in works on touch; a phone presentation of the calendar is planned. |
|
|
430
430
|
| [Month Views](../components/calendar/month-view.md) | ready | partial | planned | Taps work on touch; multi-day bar resize handles are only 6 px and a touch on a pill always drags it. |
|