@supersoniks/concorde 5.0.3 → 5.0.5
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/.agents/skills/concorde-component-docs/SKILL.md +194 -0
- package/.agents/skills/concorde-component-docs/template.md +45 -0
- package/ai/cursor/rules/concorde-theme.mdc +1 -1
- package/ai/cursor/rules/concorde.mdc +1 -1
- package/ai/skills/concorde/SKILL.md +1 -1
- package/ai/skills/concorde-theme/SKILL.md +21 -10
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +515 -521
- package/concorde-core.es.js +5151 -5056
- package/dist/concorde-core.bundle.js +515 -521
- package/dist/concorde-core.es.js +5151 -5056
- package/dist/docs-mock-api-sw.js +2 -0
- package/dist/docs-mock-api-sw.js.map +2 -2
- package/docs/assets/index-CD4WyL6o.css +1 -0
- package/docs/assets/{index-BnK6OS7w.js → index-wVZpLVYW.js} +815 -808
- package/docs/crawl/core/components/ui/alert/alert.html +76 -5
- package/docs/crawl/core/components/ui/alert-messages/alert-messages.html +113 -5
- package/docs/crawl/core/components/ui/badge/badge.html +57 -8
- package/docs/crawl/core/components/ui/captcha/captcha.html +90 -8
- package/docs/crawl/core/components/ui/card/card.html +122 -12
- package/docs/crawl/core/components/ui/divider/divider.html +117 -31
- package/docs/crawl/core/components/ui/form/fieldset/fieldset.html +232 -101
- package/docs/crawl/core/components/ui/form/form-actions/form-actions.html +95 -52
- package/docs/crawl/core/components/ui/form/form-layout/form-layout.html +97 -38
- package/docs/crawl/core/components/ui/group/group.html +60 -38
- package/docs/crawl/core/components/ui/icon/icon.html +136 -47
- package/docs/crawl/core/components/ui/image/image.html +118 -6
- package/docs/crawl/core/components/ui/link/link.html +65 -7
- package/docs/crawl/core/components/ui/loader/loader.html +97 -23
- package/docs/crawl/core/components/ui/menu/menu.html +162 -90
- package/docs/crawl/core/components/ui/modal/modal.html +275 -50
- package/docs/crawl/core/components/ui/pop/pop.html +242 -124
- package/docs/crawl/core/components/ui/progress/progress.html +103 -30
- package/docs/crawl/core/components/ui/table/table.html +303 -171
- package/docs/crawl/core/components/ui/theme/theme.html +131 -0
- package/docs/crawl/core/components/ui/toast/toast.html +170 -59
- package/docs/crawl/core/components/ui/tooltip/tooltip.html +90 -29
- package/docs/crawl/docs/_decorators/ancestor-attribute.html +3 -2
- package/docs/crawl/docs/_getting-started/start.html +1 -1
- package/docs/crawl/docs/_getting-started/theming.html +311 -63
- package/docs/crawl/hubs/form-components.html +71 -49
- package/docs/crawl/index.html +7 -6
- package/docs/docs-mock-api-sw.js +2 -0
- package/docs/docs-mock-api-sw.js.map +2 -2
- package/docs/index.html +6 -4
- package/docs/llms-full.txt +1468 -405
- package/docs/llms.txt +23 -30
- package/docs/sitemap.xml +3 -0
- package/docs/src/core/components/ui/alert/alert.md +21 -2
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/docs/src/core/components/ui/badge/badge.md +19 -6
- package/docs/src/core/components/ui/captcha/captcha.md +65 -6
- package/docs/src/core/components/ui/card/card.md +73 -10
- package/docs/src/core/components/ui/divider/divider.md +107 -13
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +175 -99
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +75 -52
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +109 -34
- package/docs/src/core/components/ui/group/group.md +36 -36
- package/docs/src/core/components/ui/icon/icon.md +132 -43
- package/docs/src/core/components/ui/image/image.md +35 -3
- package/docs/src/core/components/ui/link/link.md +43 -5
- package/docs/src/core/components/ui/loader/loader.md +79 -22
- package/docs/src/core/components/ui/menu/menu.md +133 -92
- package/docs/src/core/components/ui/modal/modal.md +163 -47
- package/docs/src/core/components/ui/pop/pop.md +217 -123
- package/docs/src/core/components/ui/progress/progress.md +76 -30
- package/docs/src/core/components/ui/table/table.md +147 -171
- package/docs/src/core/components/ui/theme/theme.md +122 -0
- package/docs/src/core/components/ui/toast/toast.md +108 -58
- package/docs/src/core/components/ui/tooltip/tooltip.md +68 -26
- package/docs/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/docs/src/docs/_getting-started/start.md +1 -1
- package/docs/src/docs/_getting-started/theming.md +223 -61
- package/docs/src/docs/search/docs-search.json +2504 -399
- package/docs/src/tsconfig.json +18 -0
- package/index.html +4 -2
- package/package.json +7 -1
- package/public/docs-mock-api-sw.js +2 -0
- package/public/docs-mock-api-sw.js.map +2 -2
- package/src/core/components/ui/_css/align.ts +1 -0
- package/src/core/components/ui/_css/type.ts +86 -8
- package/src/core/components/ui/_i18n/ui-aria-labels.ts +8 -0
- package/src/core/components/ui/alert/alert.md +21 -2
- package/src/core/components/ui/alert-messages/alert-messages.md +85 -0
- package/src/core/components/ui/badge/badge.md +19 -6
- package/src/core/components/ui/badge/badge.ts +8 -9
- package/src/core/components/ui/button/button.ts +5 -15
- package/src/core/components/ui/captcha/captcha.md +65 -6
- package/src/core/components/ui/card/card.md +73 -10
- package/src/core/components/ui/card/card.ts +24 -22
- package/src/core/components/ui/divider/divider.md +107 -13
- package/src/core/components/ui/divider/divider.ts +40 -33
- package/src/core/components/ui/form/fieldset/fieldset.md +175 -99
- package/src/core/components/ui/form/fieldset/fieldset.ts +15 -28
- package/src/core/components/ui/form/fieldset/legend.ts +13 -13
- package/src/core/components/ui/form/form-actions/form-actions.md +75 -52
- package/src/core/components/ui/form/form-actions/form-actions.ts +7 -5
- package/src/core/components/ui/form/form-layout/form-layout.md +109 -34
- package/src/core/components/ui/form/form-layout/form-layout.ts +27 -24
- package/src/core/components/ui/form/textarea/textarea.ts +4 -3
- package/src/core/components/ui/group/group.md +36 -36
- package/src/core/components/ui/group/group.ts +5 -10
- package/src/core/components/ui/icon/icon.md +132 -43
- package/src/core/components/ui/image/image.md +35 -3
- package/src/core/components/ui/link/link.md +43 -5
- package/src/core/components/ui/loader/loader.md +79 -22
- package/src/core/components/ui/loader/loader.ts +67 -27
- package/src/core/components/ui/loader/styles/fixed.ts +6 -11
- package/src/core/components/ui/menu/menu.md +133 -92
- package/src/core/components/ui/menu/menu.ts +53 -58
- package/src/core/components/ui/modal/modal.md +163 -47
- package/src/core/components/ui/modal/modal.ts +2 -4
- package/src/core/components/ui/pop/pop.md +217 -123
- package/src/core/components/ui/pop/pop.ts +0 -1
- package/src/core/components/ui/progress/progress.md +76 -30
- package/src/core/components/ui/progress/progress.ts +25 -56
- package/src/core/components/ui/table/table-caption.ts +2 -2
- package/src/core/components/ui/table/table-tbody.ts +3 -3
- package/src/core/components/ui/table/table-td.ts +23 -18
- package/src/core/components/ui/table/table-th.ts +8 -8
- package/src/core/components/ui/table/table-tr.ts +4 -4
- package/src/core/components/ui/table/table.md +147 -171
- package/src/core/components/ui/table/table.ts +20 -19
- package/src/core/components/ui/theme/theme-collection/auto.ts +15 -0
- package/src/core/components/ui/theme/theme-collection/core-variables.ts +8 -31
- package/src/core/components/ui/theme/theme-collection/dark.ts +1 -7
- package/src/core/components/ui/theme/theme-collection/light.ts +30 -26
- package/src/core/components/ui/theme/theme.md +122 -0
- package/src/core/components/ui/theme/theme.ts +30 -7
- package/src/core/components/ui/toast/toast-item.ts +6 -9
- package/src/core/components/ui/toast/toast.md +108 -58
- package/src/core/components/ui/toast/types.ts +1 -1
- package/src/core/components/ui/tooltip/tooltip.md +68 -26
- package/src/core/decorators/subscriber/ancestorAttribute.spec.ts +26 -0
- package/src/core/decorators/subscriber/ancestorAttribute.ts +3 -4
- package/src/core/utils/AncestorAttributeObserver.ts +183 -70
- package/src/docs/_decorators/ancestor-attribute.md +3 -2
- package/src/docs/_getting-started/start.md +1 -1
- package/src/docs/_getting-started/theming.md +223 -61
- package/src/docs/code.ts +125 -58
- package/src/docs/header/header.ts +62 -54
- package/src/docs/mock-api/router.ts +2 -0
- package/src/docs/navigation/navigation.ts +6 -3
- package/src/docs/search/docs-search.json +2504 -399
- package/src/docs/search/markdown-renderer.ts +6 -6
- package/src/docs/search/search.ts +4 -4
- package/src/docs/tailwind/css/tailwind.css +6 -5
- package/src/tsconfig.json +18 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +19 -0
- package/docs/assets/index--GpD7R7a.css +0 -1
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Tooltip — Concorde</title>
|
|
7
|
-
<meta name="description" content="
|
|
8
|
-
<meta name="keywords" content="Concorde, supersoniks, core/components/ui/tooltip/tooltip, tooltip, Tooltip, UI component, sonic-tooltip, web component">
|
|
7
|
+
<meta name="description" content="Tooltip shows a short label on hover (and on focus when the trigger can receive focus). Wrap the trigger in the default slot—buttons, icons, or plain text. Default placement is top (center-aligned). A">
|
|
8
|
+
<meta name="keywords" content="Concorde, supersoniks, core/components/ui/tooltip/tooltip, tooltip, Tooltip, UI component, sonic-tooltip, web component, label, placement, top, disabled, bottom, left, right, -start">
|
|
9
9
|
<meta name="concorde-doc-id" content="core/components/ui/tooltip/tooltip">
|
|
10
10
|
<link rel="canonical" href="https://concorde.supersoniks.org/crawl/core/components/ui/tooltip/tooltip.html">
|
|
11
11
|
</head>
|
|
@@ -15,63 +15,124 @@
|
|
|
15
15
|
</header>
|
|
16
16
|
<main>
|
|
17
17
|
<article>
|
|
18
|
-
<p class="doc-lead" id="doc-summary"><strong>Concorde UI component — Tooltip</strong>.
|
|
18
|
+
<p class="doc-lead" id="doc-summary"><strong>Concorde UI component — Tooltip</strong>. Tooltip shows a short label on hover (and on focus when the trigger can receive focus). Wrap the trigger in the default slot—buttons, icons, or plain text. Default placement is top (center-aligned). A <span>Doc ID: <code>core/components/ui/tooltip/tooltip</code>. Keywords: Concorde, supersoniks, core/components/ui/tooltip/tooltip, tooltip, Tooltip, UI component, sonic-tooltip, web component, label, placement, top, disabled, bottom, left, right, -start. URL: <a href="https://concorde.supersoniks.org/crawl/core/components/ui/tooltip/tooltip.html">https://concorde.supersoniks.org/crawl/core/components/ui/tooltip/tooltip.html</a>.</span></p>
|
|
19
19
|
<h1 id="tooltip">Tooltip</h1>
|
|
20
|
-
<
|
|
20
|
+
<p>Tooltip shows a short <strong><code>label</code></strong> on hover (and on focus when the trigger can receive focus). Wrap the trigger in the default slot—buttons, icons, or plain text. Default <strong><code>placement</code></strong> is <strong><code>top</code></strong> (center-aligned). An empty <strong><code>label</code></strong> hides the bubble the same way as <strong><code>disabled</code></strong>.</p>
|
|
21
|
+
<h2 id="basic-example">Basic example</h2>
|
|
22
|
+
<pre><code><sonic-tooltip label="Additional context on hover">
|
|
23
|
+
<sonic-button variant="outline">Hover me</sonic-button>
|
|
24
|
+
</sonic-tooltip>
|
|
21
25
|
</code></pre>
|
|
22
26
|
<h2 id="placement">Placement</h2>
|
|
23
|
-
<p>
|
|
24
|
-
<pre><code><
|
|
25
|
-
<sonic-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<sonic-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<sonic-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<sonic-
|
|
35
|
-
|
|
27
|
+
<p>Use <strong><code>top</code></strong> · <strong><code>bottom</code></strong> · <strong><code>left</code></strong> · <strong><code>right</code></strong> for the main axis. Add <strong><code>-start</code></strong> or <strong><code>-end</code></strong> to align the bubble along the anchor edge.</p>
|
|
28
|
+
<pre><code><div class="flex flex-wrap gap-2">
|
|
29
|
+
<sonic-tooltip placement="top" label="Top">
|
|
30
|
+
<sonic-button>Top</sonic-button>
|
|
31
|
+
</sonic-tooltip>
|
|
32
|
+
<sonic-tooltip placement="bottom" label="Bottom">
|
|
33
|
+
<sonic-button>Bottom</sonic-button>
|
|
34
|
+
</sonic-tooltip>
|
|
35
|
+
<sonic-tooltip placement="right" label="Right">
|
|
36
|
+
<sonic-button>Right</sonic-button>
|
|
37
|
+
</sonic-tooltip>
|
|
38
|
+
<sonic-tooltip placement="left" label="Left">
|
|
39
|
+
<sonic-button>Left</sonic-button>
|
|
40
|
+
</sonic-tooltip>
|
|
41
|
+
</div>
|
|
36
42
|
</code></pre>
|
|
37
|
-
<
|
|
43
|
+
<h3 id="aligned-placements">Aligned placements</h3>
|
|
38
44
|
<pre><code><div class="flex gap-3 flex-wrap">
|
|
39
|
-
<sonic-tooltip placement="top-start" label="
|
|
45
|
+
<sonic-tooltip placement="top-start" label="Top start">
|
|
40
46
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Top start</sonic-button>
|
|
41
47
|
</sonic-tooltip>
|
|
42
|
-
<sonic-tooltip placement="top-end" label="
|
|
48
|
+
<sonic-tooltip placement="top-end" label="Top end">
|
|
43
49
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Top end</sonic-button>
|
|
44
50
|
</sonic-tooltip>
|
|
45
|
-
<sonic-tooltip placement="bottom-start" label="
|
|
51
|
+
<sonic-tooltip placement="bottom-start" label="Bottom start">
|
|
46
52
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Bottom start</sonic-button>
|
|
47
53
|
</sonic-tooltip>
|
|
48
|
-
<sonic-tooltip placement="bottom-end" label="
|
|
54
|
+
<sonic-tooltip placement="bottom-end" label="Bottom end">
|
|
49
55
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Bottom end</sonic-button>
|
|
50
56
|
</sonic-tooltip>
|
|
51
|
-
<sonic-tooltip placement="right-start" label="
|
|
57
|
+
<sonic-tooltip placement="right-start" label="Right start">
|
|
52
58
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Right start</sonic-button>
|
|
53
59
|
</sonic-tooltip>
|
|
54
|
-
<sonic-tooltip placement="right-end" label="
|
|
60
|
+
<sonic-tooltip placement="right-end" label="Right end">
|
|
55
61
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Right end</sonic-button>
|
|
56
62
|
</sonic-tooltip>
|
|
57
|
-
<sonic-tooltip placement="left-start" label="
|
|
63
|
+
<sonic-tooltip placement="left-start" label="Left start">
|
|
58
64
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Left start</sonic-button>
|
|
59
65
|
</sonic-tooltip>
|
|
60
|
-
<sonic-tooltip placement="left-end" label="
|
|
66
|
+
<sonic-tooltip placement="left-end" label="Left end">
|
|
61
67
|
<sonic-button class="size-40 bg-neutral-200 rounded-lg">Left end</sonic-button>
|
|
62
68
|
</sonic-tooltip>
|
|
63
69
|
</div>
|
|
64
70
|
</code></pre>
|
|
71
|
+
<h2 id="label-formatting">Label formatting</h2>
|
|
72
|
+
<p><strong><code>label</code></strong> supports line breaks (<code>\n</code> in markup or multiline text). Lines are trimmed; <strong><code>&nbsp;</code></strong> is normalized to spaces. <strong><code>white-space: pre-line</code></strong> preserves breaks in the bubble (max width <strong>18rem</strong>).</p>
|
|
73
|
+
<pre><code><sonic-tooltip label="First line&#10;Second line">
|
|
74
|
+
<sonic-button variant="outline">Multiline label</sonic-button>
|
|
75
|
+
</sonic-tooltip>
|
|
76
|
+
</code></pre>
|
|
65
77
|
<h2 id="focusable">Focusable</h2>
|
|
66
|
-
<
|
|
67
|
-
|
|
78
|
+
<p>On non-interactive triggers, set <strong><code>focusable</code></strong> so the host gets <strong><code>tabindex="0"</code></strong> and the tooltip opens on keyboard focus as well as hover.</p>
|
|
79
|
+
<pre><code><sonic-tooltip
|
|
80
|
+
focusable
|
|
81
|
+
label="The Concorde made its first transatlantic crossing on September 26, 1973"
|
|
82
|
+
>
|
|
83
|
+
<sonic-icon library="iconoir" name="chat-bubble-question"></sonic-icon>
|
|
84
|
+
Focus or hover this text
|
|
68
85
|
</sonic-tooltip>
|
|
69
86
|
</code></pre>
|
|
70
87
|
<h2 id="disabled">Disabled</h2>
|
|
71
|
-
<pre><code><sonic-tooltip disabled label="
|
|
88
|
+
<pre><code><sonic-tooltip disabled label="Not shown">
|
|
72
89
|
<sonic-button>Tooltip disabled</sonic-button>
|
|
73
90
|
</sonic-tooltip>
|
|
74
91
|
</code></pre>
|
|
92
|
+
<h2 id="accessibility">Accessibility</h2>
|
|
93
|
+
<p>The bubble uses <strong><code>popover="hint"</code></strong> (non-modal, no pointer capture). Prefer <strong><code>focusable</code></strong> when the slotted content is not already focusable. When the Popover API is unavailable, the host falls back to the native <strong><code>title</code></strong> attribute with a single-line label. Opacity transitions respect <strong><code>prefers-reduced-motion</code></strong>.</p>
|
|
94
|
+
<h2 id="api-reference">API reference</h2>
|
|
95
|
+
<table>
|
|
96
|
+
<thead>
|
|
97
|
+
<tr>
|
|
98
|
+
<th>Attribute</th>
|
|
99
|
+
<th>Values</th>
|
|
100
|
+
<th>Description</th>
|
|
101
|
+
</tr>
|
|
102
|
+
</thead>
|
|
103
|
+
<tbody><tr>
|
|
104
|
+
<td><code>label</code></td>
|
|
105
|
+
<td>string</td>
|
|
106
|
+
<td>Tooltip copy; whitespace-only values suppress the bubble</td>
|
|
107
|
+
</tr>
|
|
108
|
+
<tr>
|
|
109
|
+
<td><code>placement</code></td>
|
|
110
|
+
<td><code>top</code> (default) · <code>bottom</code> · <code>left</code> · <code>right</code> · <code>top-start</code> · <code>top-end</code> · <code>bottom-start</code> · <code>bottom-end</code> · <code>left-start</code> · <code>left-end</code> · <code>right-start</code> · <code>right-end</code></td>
|
|
111
|
+
<td>Position relative to the trigger; repositions while open</td>
|
|
112
|
+
</tr>
|
|
113
|
+
<tr>
|
|
114
|
+
<td><code>disabled</code></td>
|
|
115
|
+
<td>boolean</td>
|
|
116
|
+
<td>Suppress show/hide; sets <strong><code>tabindex="-1"</code></strong> on the host</td>
|
|
117
|
+
</tr>
|
|
118
|
+
<tr>
|
|
119
|
+
<td><code>focusable</code></td>
|
|
120
|
+
<td>boolean</td>
|
|
121
|
+
<td>Add <strong><code>tabindex="0"</code></strong> on the host for keyboard access</td>
|
|
122
|
+
</tr>
|
|
123
|
+
</tbody></table>
|
|
124
|
+
<table>
|
|
125
|
+
<thead>
|
|
126
|
+
<tr>
|
|
127
|
+
<th>Slot</th>
|
|
128
|
+
<th>Description</th>
|
|
129
|
+
</tr>
|
|
130
|
+
</thead>
|
|
131
|
+
<tbody><tr>
|
|
132
|
+
<td><em>(default)</em></td>
|
|
133
|
+
<td>Trigger content (hover target)</td>
|
|
134
|
+
</tr>
|
|
135
|
+
</tbody></table>
|
|
75
136
|
|
|
76
137
|
</article>
|
|
77
138
|
</main>
|
|
@@ -66,10 +66,11 @@ export class DemoAncestorAttribute extends LitElement {
|
|
|
66
66
|
<li>By default (<code>dynamic: false</code>), the value is read once at connect time and is not updated afterward</li>
|
|
67
67
|
<li>With <code>{ dynamic: true }</code>, the property stays in sync when:<ul>
|
|
68
68
|
<li>an ancestor <strong>changes</strong> the attribute value</li>
|
|
69
|
-
<li>a <strong>closer</strong> ancestor <strong>gains</strong> the attribute (
|
|
70
|
-
<li>the
|
|
69
|
+
<li>a <strong>closer</strong> ancestor <strong>gains</strong> / <strong>loses</strong> the attribute (fallback / <code>null</code>)</li>
|
|
70
|
+
<li>the component is <strong>reparented</strong> (no extra opt-in) — parent <code>childList</code> only reacts if <em>this</em> node moves</li>
|
|
71
71
|
</ul>
|
|
72
72
|
</li>
|
|
73
|
+
<li>Observers are <strong>shared</strong> (one per ancestor attribute / one per parent) so large lists of <code>sonic-icon</code> stay cheap on Firefox.</li>
|
|
73
74
|
<li>When <code>dynamic</code> is enabled, updates also propagate to <code>@subscribe</code> / <code>@bind</code> paths that depend on the decorated property (e.g. <code>${dataProvider}</code>)</li>
|
|
74
75
|
</ul>
|
|
75
76
|
<h3 id="dynamic-mode">Dynamic mode</h3>
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
<p class="doc-lead" id="doc-summary"><strong>Concorde guide — Introduction</strong>. Based on lit.dev, Concorde is a collection of web components for shared apps and websites. <span>Doc ID: <code>docs/_getting-started/start</code>. Keywords: Concorde, supersoniks, docs/_getting-started/start, start, Introduction, guide, get, set, formDataProvider, @ancestorAttribute, @bind, serviceURL, yarn ai:sync, AGENTS.md. URL: <a href="https://concorde.supersoniks.org/crawl/docs/_getting-started/start.html">https://concorde.supersoniks.org/crawl/docs/_getting-started/start.html</a>.</span></p>
|
|
19
19
|
<h1 id="introduction">Introduction</h1>
|
|
20
20
|
<h2 id="what-is-concorde">What is Concorde?</h2>
|
|
21
|
-
<p>Based on <strong><a href="https://lit.dev">lit.dev</a></strong>, Concorde is a collection of web components for shared apps and websites.<br>Build UIs without tying components to a specific host stack, while keeping visual consistency through
|
|
21
|
+
<p>Based on <strong><a href="https://lit.dev">lit.dev</a></strong>, Concorde is a collection of web components for shared apps and websites.<br>Build UIs without tying components to a specific host stack, while keeping visual consistency through the smallest set of CSS variables needed to define a theme.</p>
|
|
22
22
|
<h2 id="why-and-use-case">Why and use case</h2>
|
|
23
23
|
<p>In 2022, Supersoniks needed a new ticketing stack for nearly 100 sites — mobile apps, modern sites, and legacy PHP without bundlers.<br>One composable web-component library replaced many one-off apps. Lit was chosen for broad runtime compatibility.</p>
|
|
24
24
|
<h3 id="stack">Stack</h3>
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>
|
|
7
|
-
<meta name="description" content="
|
|
8
|
-
<meta name="keywords" content="Concorde, supersoniks, docs/_getting-started/theming, theming,
|
|
6
|
+
<title>Customization — Concorde</title>
|
|
7
|
+
<meta name="description" content="Concorde components ship with default styles (fallback values in each component and in <sonic-theme>).">
|
|
8
|
+
<meta name="keywords" content="Concorde, supersoniks, docs/_getting-started/theming, theming, Customization, guide, , :root, theme="custom", --sc-*, theme="light", "dark", "auto", auto, prefers-color-scheme">
|
|
9
9
|
<meta name="concorde-doc-id" content="docs/_getting-started/theming">
|
|
10
10
|
<link rel="canonical" href="https://concorde.supersoniks.org/crawl/docs/_getting-started/theming.html">
|
|
11
11
|
</head>
|
|
@@ -15,69 +15,317 @@
|
|
|
15
15
|
</header>
|
|
16
16
|
<main>
|
|
17
17
|
<article>
|
|
18
|
-
<p class="doc-lead" id="doc-summary"><strong>Concorde guide —
|
|
19
|
-
<h1 id="
|
|
20
|
-
<h2 id="
|
|
21
|
-
<p>
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
These styles are scoped and do not impact the outside.</li>
|
|
27
|
-
<li>We use CSS variables as the value of properties intended to be customized from the outside.
|
|
28
|
-
For each variable, we define a default value to have a simple but consistent base style.</li>
|
|
29
|
-
<li>We only rewrite inheritable properties with hard values if they are truly specific to the component.</li>
|
|
30
|
-
<li>The <code><style></code> tag as a direct child can be used as a last resort, especially if there is a need for particularly dynamic customization. Performance is reduced.</li>
|
|
31
|
-
</ul>
|
|
32
|
-
</li>
|
|
33
|
-
<li><strong>During use / from the outside:</strong>
|
|
34
|
-
We define values for <strong>inheritable CSS properties</strong> (e.g., font-_, color...) using tools like Tailwind.
|
|
35
|
-
We modify the value of <strong>CSS variables</strong> used by the component.</li>
|
|
36
|
-
</ul>
|
|
37
|
-
<h2 id="choosing-style-presets-via-reactive-properties">Choosing Style Presets via Reactive Properties:</h2>
|
|
38
|
-
<p>The declaration of reactive properties is useful for selecting a particular configuration that mostly affects a set of properties.</p>
|
|
39
|
-
<p>For example, a <code>size</code> property (xs, sm, md, xl) will affect margins, font, line heights to align them with the corresponding CSS vars, which can be customized using the methods mentioned earlier if necessary.</p>
|
|
40
|
-
<p>It is recommended to use the <code>{reflect: true}</code> property for reactive properties that have an associated style on the <code>:host()</code>. For example: <code>:host([type='primary']){...}</code></p>
|
|
41
|
-
<p>☢️ <strong>Caution:</strong> Passing class names via reactive properties / HTML attributes of the component should be avoided as it can quickly lead to difficult-to-manage situations.</p>
|
|
42
|
-
<h4 id="css-display-property">CSS "display" Property</h4>
|
|
43
|
-
<p>By default, the display property is <code>inline</code>.
|
|
44
|
-
Therefore, be careful to define it according to the needs, as one might mistakenly expect it to be <code>block</code> as with a regular <code><div></code>.</p>
|
|
45
|
-
<p>☢️ <strong>Caution:</strong> Defining the <code>display</code> property as <code>contents</code> may seem attractive at first, but:</p>
|
|
46
|
-
<ul>
|
|
47
|
-
<li>It almost always leads to the creation of wrappers to style the content (instead of using <code>:host</code>).</li>
|
|
48
|
-
<li>It is no longer possible to directly add classes to the component or style it from the outside.
|
|
49
|
-
Ultimately, the amount of code to write increases significantly.</li>
|
|
50
|
-
</ul>
|
|
51
|
-
<h2 id="tailwind-functional-classes">TAILWIND Functional Classes</h2>
|
|
52
|
-
<p><a href="https://tailwindcss.com/">tailwind</a> has been integrated into Concorde and is available in scoped components (with Shadow DOM).
|
|
53
|
-
To use it, you need to import the following:</p>
|
|
54
|
-
<pre><code class="language-javascript">import { tailwind } from "@supersoniks/concorde/la-billetterie/ui/theme/theme";
|
|
18
|
+
<p class="doc-lead" id="doc-summary"><strong>Concorde guide — Customization</strong>. Concorde components ship with default styles (fallback values in each component and in <sonic-theme>). <span>Doc ID: <code>docs/_getting-started/theming</code>. Keywords: Concorde, supersoniks, docs/_getting-started/theming, theming, Customization, guide, , :root, theme="custom", --sc-*, theme="light", "dark", "auto", auto, prefers-color-scheme. URL: <a href="https://concorde.supersoniks.org/crawl/docs/_getting-started/theming.html">https://concorde.supersoniks.org/crawl/docs/_getting-started/theming.html</a>.</span></p>
|
|
19
|
+
<h1 id="customization">Customization</h1>
|
|
20
|
+
<h2 id="theme-first-customization">Theme-first customization</h2>
|
|
21
|
+
<p>Concorde components ship with <strong>default styles</strong> (fallback values in each component and in <code><sonic-theme></code>).<br>You do not need to define any CSS variables to get a usable UI.</p>
|
|
22
|
+
<p>To align the kit with your brand, override <strong>only the essential theme tokens</strong> on <code><sonic-theme></code>, on <code>:root</code>, or in a project stylesheet.<br>Concorde derives radius steps, button/input rounding, shadows, and most per-component layout from these primitives—<strong>do not copy long lists of derived variables</strong> unless you have a specific need.</p>
|
|
23
|
+
<pre><code class="language-html"><sonic-theme color font class="block bg-base min-h-screen">
|
|
24
|
+
<!-- your app -->
|
|
25
|
+
</sonic-theme>
|
|
55
26
|
</code></pre>
|
|
56
|
-
<
|
|
57
|
-
<pre><code class="language-javascript">static styles = [tailwind];
|
|
27
|
+
<pre><code class="language-javascript">import "@supersoniks/concorde/theme";
|
|
58
28
|
</code></pre>
|
|
59
|
-
<
|
|
60
|
-
<
|
|
29
|
+
<table>
|
|
30
|
+
<thead>
|
|
31
|
+
<tr>
|
|
32
|
+
<th>Attribute</th>
|
|
33
|
+
<th>Effect</th>
|
|
34
|
+
</tr>
|
|
35
|
+
</thead>
|
|
36
|
+
<tbody><tr>
|
|
37
|
+
<td><em>(omit)</em> | <code>theme="custom"</code></td>
|
|
38
|
+
<td>Default: core tokens + your <code>--sc-*</code>; no built-in light/dark palette</td>
|
|
39
|
+
</tr>
|
|
40
|
+
<tr>
|
|
41
|
+
<td><code>theme="light"</code> | <code>"dark"</code> | <code>"auto"</code></td>
|
|
42
|
+
<td>Opt-in presets; <code>auto</code> follows <code>prefers-color-scheme</code></td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr>
|
|
45
|
+
<td><code>class="bg-base block"</code> (Tailwind)</td>
|
|
46
|
+
<td>Page/surface background (<code>--sc-base</code>)</td>
|
|
47
|
+
</tr>
|
|
48
|
+
<tr>
|
|
49
|
+
<td><code>color</code></td>
|
|
50
|
+
<td>Text color (<code>--sc-base-content</code>)</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td><code>font</code></td>
|
|
54
|
+
<td>Base font family/weight (<code>--sc-font-family-base</code>, etc.)</td>
|
|
55
|
+
</tr>
|
|
56
|
+
</tbody></table>
|
|
57
|
+
<p>Popovers, modals, and toasts mount under the nearest <code><sonic-theme></code>.</p>
|
|
58
|
+
<h2 id="customization-example">Customization example</h2>
|
|
59
|
+
<p>Example (full brand override on <code><sonic-theme></code> or <code>:root</code>). Set every essential token below; derived radii and shadows still come from the theme engine—only <code>--sc-rounded</code> is listed here.</p>
|
|
60
|
+
<pre><code class="language-css">sonic-theme {
|
|
61
|
+
/* Semantic fills */
|
|
62
|
+
--sc-primary: #353429;
|
|
63
|
+
--sc-secondary: #f43f5e;
|
|
64
|
+
--sc-info: #7c3aed;
|
|
65
|
+
--sc-danger: #d71839;
|
|
66
|
+
--sc-warning: #f97316;
|
|
67
|
+
--sc-success: #10b981;
|
|
68
|
+
--sc-contrast: #111;
|
|
69
|
+
|
|
70
|
+
/* Text/icons on semantic fills */
|
|
71
|
+
--sc-primary-content: #fff;
|
|
72
|
+
--sc-secondary-content: #fff;
|
|
73
|
+
--sc-info-content: #fff;
|
|
74
|
+
--sc-danger-content: #fff;
|
|
75
|
+
--sc-warning-content: #fff;
|
|
76
|
+
--sc-success-content: #fff;
|
|
77
|
+
--sc-contrast-content: #fff;
|
|
78
|
+
|
|
79
|
+
/* Neutral fills */
|
|
80
|
+
--sc-base: #fff;
|
|
81
|
+
--sc-base-50: #f6f6f5;
|
|
82
|
+
--sc-base-100: #ededec;
|
|
83
|
+
--sc-base-200: #d7d7d4;
|
|
84
|
+
--sc-base-300: #c8c7c4;
|
|
85
|
+
--sc-base-400: #a8a7a2;
|
|
86
|
+
--sc-base-500: #94938c;
|
|
87
|
+
--sc-base-600: #76756c;
|
|
88
|
+
--sc-base-700: #59584e;
|
|
89
|
+
--sc-base-800: #47463b;
|
|
90
|
+
--sc-base-900: #353429;
|
|
91
|
+
|
|
92
|
+
/* Text/icons on neutral surfaces */
|
|
93
|
+
--sc-base-content: var(--sc-base-900);
|
|
94
|
+
|
|
95
|
+
/* Typography */
|
|
96
|
+
--sc-font-family-base: "Oswald", system-ui, -apple-system, "Segoe UI", Roboto,
|
|
97
|
+
"Helvetica Neue", Arial, sans-serif;
|
|
98
|
+
--sc-headings-font-family: "alternate-gothic-compressed", system-ui, sans-serif;
|
|
99
|
+
--sc-headings-line-height: 1.1;
|
|
100
|
+
--sc-headings-font-weight: bold;
|
|
101
|
+
--sc-headings-text-transform: none;
|
|
102
|
+
|
|
103
|
+
/* Shape (primitive only) */
|
|
104
|
+
--sc-rounded: 0;
|
|
105
|
+
|
|
106
|
+
/* Forms */
|
|
107
|
+
--sc-border-width: 0.2rem;
|
|
108
|
+
--sc-form-height: 2em;
|
|
109
|
+
--sc-input-bg: var(--sc-base);
|
|
110
|
+
--sc-input-color: var(--sc-base-content);
|
|
111
|
+
--sc-input-border-color: var(--sc-input-color);
|
|
112
|
+
--sc-input-active-bg: var(--sc-primary);
|
|
113
|
+
--sc-input-active-color: var(--sc-primary-content);
|
|
114
|
+
--sc-input-active-border-color: var(--sc-primary);
|
|
115
|
+
}
|
|
116
|
+
</code></pre>
|
|
117
|
+
<p><sonic-button href="https://delanfranchi.github.io/concordecolors/"> Palette generator: concordecolors</sonic-button></p>
|
|
118
|
+
<p><strong>Without these overrides</strong>, components keep Concorde’s per-component fallbacks. Built-in light/dark palettes apply only when you set <code>theme="light"</code>, <code>theme="dark"</code>, or <code>theme="auto"</code>.</p>
|
|
119
|
+
<p><strong>What we intentionally avoid:</strong> large public <code>--sc-alert-*</code> / <code>--sc-badge-*</code> APIs or <code>::part()</code> styling hooks on most components. Prefer attributes (<code>type</code>, <code>status</code>, <code>size</code>, …) and the theme tokens above.</p>
|
|
120
|
+
<h2 id="only-essential-css-variables-public-theme-api">Only essential CSS variables (public theme API)</h2>
|
|
121
|
+
<p>These are the <strong>smallest set</strong> we recommend customizing. Everything else should stay internal to the theme or to components (<code>--sc_*</code> private variables, attributes like <code>type</code>, <code>size</code>, <code>variant</code>).</p>
|
|
122
|
+
<h3 id="surfaces-and-foreground">Surfaces and foreground</h3>
|
|
123
|
+
<p>Tokens <strong>without</strong> a <code>-content</code> suffix are <strong>fill / background</strong> colors.<br>Tokens <strong>with</strong> <code>-content</code> are <strong>text and icons</strong> on top of the matching fill (solid buttons, badges, alerts, etc.).</p>
|
|
124
|
+
<h4 id="neutral-fills">Neutral fills</h4>
|
|
125
|
+
<table>
|
|
126
|
+
<thead>
|
|
127
|
+
<tr>
|
|
128
|
+
<th>Variable</th>
|
|
129
|
+
<th>Role</th>
|
|
130
|
+
</tr>
|
|
131
|
+
</thead>
|
|
132
|
+
<tbody><tr>
|
|
133
|
+
<td><code>--sc-base</code></td>
|
|
134
|
+
<td>Main surface / page background</td>
|
|
135
|
+
</tr>
|
|
136
|
+
<tr>
|
|
137
|
+
<td><code>--sc-base-50</code> … <code>--sc-base-900</code></td>
|
|
138
|
+
<td>Neutral scale (borders, subtle backgrounds, muted UI)</td>
|
|
139
|
+
</tr>
|
|
140
|
+
</tbody></table>
|
|
141
|
+
<h4 id="neutral-foreground">Neutral foreground</h4>
|
|
142
|
+
<table>
|
|
143
|
+
<thead>
|
|
144
|
+
<tr>
|
|
145
|
+
<th>Variable</th>
|
|
146
|
+
<th>Role</th>
|
|
147
|
+
</tr>
|
|
148
|
+
</thead>
|
|
149
|
+
<tbody><tr>
|
|
150
|
+
<td><code>--sc-base-content</code></td>
|
|
151
|
+
<td>Default body text and icons on neutral surfaces</td>
|
|
152
|
+
</tr>
|
|
153
|
+
</tbody></table>
|
|
154
|
+
<h4 id="semantic-fills">Semantic fills</h4>
|
|
155
|
+
<table>
|
|
156
|
+
<thead>
|
|
157
|
+
<tr>
|
|
158
|
+
<th>Variable</th>
|
|
159
|
+
<th>Role</th>
|
|
160
|
+
</tr>
|
|
161
|
+
</thead>
|
|
162
|
+
<tbody><tr>
|
|
163
|
+
<td><code>--sc-primary</code></td>
|
|
164
|
+
<td>Primary actions, links, emphasis</td>
|
|
165
|
+
</tr>
|
|
166
|
+
<tr>
|
|
167
|
+
<td><code>--sc-secondary</code></td>
|
|
168
|
+
<td>Secondary brand accent (when used)</td>
|
|
169
|
+
</tr>
|
|
170
|
+
<tr>
|
|
171
|
+
<td><code>--sc-info</code>, <code>--sc-success</code>, <code>--sc-warning</code>, <code>--sc-danger</code></td>
|
|
172
|
+
<td>Status and feedback</td>
|
|
173
|
+
</tr>
|
|
174
|
+
<tr>
|
|
175
|
+
<td><code>--sc-contrast</code></td>
|
|
176
|
+
<td>High-contrast fills (e.g. on media)</td>
|
|
177
|
+
</tr>
|
|
178
|
+
</tbody></table>
|
|
179
|
+
<h4 id="semantic-foreground">Semantic foreground</h4>
|
|
180
|
+
<table>
|
|
181
|
+
<thead>
|
|
182
|
+
<tr>
|
|
183
|
+
<th>Variable</th>
|
|
184
|
+
<th>Role</th>
|
|
185
|
+
</tr>
|
|
186
|
+
</thead>
|
|
187
|
+
<tbody><tr>
|
|
188
|
+
<td><code>--sc-primary-content</code>, <code>--sc-secondary-content</code>, …</td>
|
|
189
|
+
<td>Text/icons on the matching semantic <strong>fill</strong> (<code>--sc-primary</code>, etc.)</td>
|
|
190
|
+
</tr>
|
|
191
|
+
</tbody></table>
|
|
192
|
+
<h3 id="shape">Shape</h3>
|
|
193
|
+
<table>
|
|
194
|
+
<thead>
|
|
195
|
+
<tr>
|
|
196
|
+
<th>Variable</th>
|
|
197
|
+
<th>Role</th>
|
|
198
|
+
</tr>
|
|
199
|
+
</thead>
|
|
200
|
+
<tbody><tr>
|
|
201
|
+
<td><code>--sc-rounded</code></td>
|
|
202
|
+
<td><strong>Single primitive</strong> corner radius; the theme computes <code>--sc-rounded-sm</code>, <code>--sc-btn-rounded</code>, <code>--sc-input-rounded</code>, etc.</td>
|
|
203
|
+
</tr>
|
|
204
|
+
</tbody></table>
|
|
205
|
+
<h3 id="typography">Typography</h3>
|
|
206
|
+
<table>
|
|
207
|
+
<thead>
|
|
208
|
+
<tr>
|
|
209
|
+
<th>Variable</th>
|
|
210
|
+
<th>Role</th>
|
|
211
|
+
</tr>
|
|
212
|
+
</thead>
|
|
213
|
+
<tbody><tr>
|
|
214
|
+
<td><code>--sc-font-family-base</code></td>
|
|
215
|
+
<td>Body UI text</td>
|
|
216
|
+
</tr>
|
|
217
|
+
<tr>
|
|
218
|
+
<td><code>--sc-font-weight-base</code>, <code>--sc-font-style-base</code></td>
|
|
219
|
+
<td>Optional</td>
|
|
220
|
+
</tr>
|
|
221
|
+
<tr>
|
|
222
|
+
<td><code>--sc-headings-font-family</code>, <code>--sc-headings-line-height</code>, <code>--sc-headings-font-weight</code>, <code>--sc-headings-text-transform</code></td>
|
|
223
|
+
<td>Headings (modal titles, etc.)</td>
|
|
224
|
+
</tr>
|
|
225
|
+
</tbody></table>
|
|
226
|
+
<h3 id="forms-only-if-you-customize-inputs-globally">Forms (only if you customize inputs globally)</h3>
|
|
227
|
+
<p>Interactive controls expose a few extra <strong>theme-level</strong> tokens; prefer these over styling individual inputs from outside.</p>
|
|
228
|
+
<table>
|
|
229
|
+
<thead>
|
|
230
|
+
<tr>
|
|
231
|
+
<th>Variable</th>
|
|
232
|
+
<th>Role</th>
|
|
233
|
+
</tr>
|
|
234
|
+
</thead>
|
|
235
|
+
<tbody><tr>
|
|
236
|
+
<td><code>--sc-border-width</code></td>
|
|
237
|
+
<td>Default border thickness</td>
|
|
238
|
+
</tr>
|
|
239
|
+
<tr>
|
|
240
|
+
<td><code>--sc-form-height</code></td>
|
|
241
|
+
<td>Control height</td>
|
|
242
|
+
</tr>
|
|
243
|
+
<tr>
|
|
244
|
+
<td><code>--sc-input-bg</code>, <code>--sc-input-color</code>, <code>--sc-input-border-color</code></td>
|
|
245
|
+
<td>Default field chrome</td>
|
|
246
|
+
</tr>
|
|
247
|
+
<tr>
|
|
248
|
+
<td><code>--sc-input-active-bg</code>, <code>--sc-input-active-color</code>, <code>--sc-input-active-border-color</code></td>
|
|
249
|
+
<td>Focus/active state</td>
|
|
250
|
+
</tr>
|
|
251
|
+
</tbody></table>
|
|
252
|
+
<hr>
|
|
253
|
+
<h2 id="tailwind-in-new-components-">Tailwind in new components ?</h2>
|
|
254
|
+
<p>Set <code>tailwind.config.js</code> to match concorde style token in your custom component.</p>
|
|
255
|
+
<pre><code class="language-js">...
|
|
256
|
+
theme: {
|
|
257
|
+
borderRadius: {
|
|
258
|
+
DEFAULT: "var(--sc-rounded)",
|
|
259
|
+
none: "0",
|
|
260
|
+
sm: "var(--sc-rounded-sm)",
|
|
261
|
+
md: "var(--sc-rounded-md)",
|
|
262
|
+
lg: "var(--sc-rounded-lg)",
|
|
263
|
+
xl: "var(--sc-rounded-xl)",
|
|
264
|
+
full: "9999px",
|
|
265
|
+
},
|
|
266
|
+
boxShadow: {
|
|
267
|
+
DEFAULT: "var(--sc-shadow)",
|
|
268
|
+
none: "none",
|
|
269
|
+
sm: "var(--sc-shadow-sm)",
|
|
270
|
+
md: "var(--sc-shadow-md)",
|
|
271
|
+
lg: "var(--sc-shadow-lg)",
|
|
272
|
+
xl: "var(--sc-shadow-xl)",
|
|
273
|
+
},
|
|
274
|
+
colors: {
|
|
275
|
+
transparent: "transparent",
|
|
276
|
+
current: "currentColor",
|
|
277
|
+
content: "var(--sc-base-content)",
|
|
278
|
+
base: "var(--sc-base)",
|
|
279
|
+
neutral: {
|
|
280
|
+
0: "var(--sc-base)",
|
|
281
|
+
50: "var(--sc-base-50)",
|
|
282
|
+
100: "var(--sc-base-100)",
|
|
283
|
+
200: "var(--sc-base-200)",
|
|
284
|
+
300: "var(--sc-base-300)",
|
|
285
|
+
400: "var(--sc-base-400)",
|
|
286
|
+
500: "var(--sc-base-500)",
|
|
287
|
+
600: "var(--sc-base-600)",
|
|
288
|
+
700: "var(--sc-base-700)",
|
|
289
|
+
800: "var(--sc-base-800)",
|
|
290
|
+
900: "var(--sc-base-900)",
|
|
291
|
+
content: "var(--sc-base)",
|
|
292
|
+
},
|
|
293
|
+
primary: {
|
|
294
|
+
DEFAULT: "var(--sc-primary)",
|
|
295
|
+
content: "var(--sc-primary-content)",
|
|
296
|
+
},
|
|
297
|
+
success: {
|
|
298
|
+
DEFAULT: "var(--sc-success)",
|
|
299
|
+
content: "var(--sc-success-content)",
|
|
300
|
+
},
|
|
301
|
+
danger: {
|
|
302
|
+
DEFAULT: "var(--sc-danger)",
|
|
303
|
+
content: "var(--sc-danger-content)",
|
|
304
|
+
},
|
|
305
|
+
warning: {
|
|
306
|
+
DEFAULT: "var(--sc-warning)",
|
|
307
|
+
content: "var(--sc-warning-content)",
|
|
308
|
+
},
|
|
309
|
+
info: {
|
|
310
|
+
DEFAULT: "var(--sc-info)",
|
|
311
|
+
content: "var(--sc-info-content)",
|
|
312
|
+
},
|
|
313
|
+
contrast: {
|
|
314
|
+
DEFAULT: "var(--sc-contrast)",
|
|
315
|
+
content: "var(--sc-contrast-content)",
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
extend: {
|
|
319
|
+
borderWidth: {
|
|
320
|
+
DEFAULT: "var(--sc-border-width)",
|
|
321
|
+
},
|
|
322
|
+
fontFamily: {
|
|
323
|
+
headings: ["var(--sc-headings-font-family, var(--sc-font-family-base, sans-serif))"],
|
|
324
|
+
body: ["var(--sc-font-family-base)"],
|
|
325
|
+
monospace: ["var(--sc-font-family-monospace, monospace)"],
|
|
326
|
+
}
|
|
327
|
+
}
|
|
61
328
|
</code></pre>
|
|
62
|
-
<p>The colors from Concorde's theme are referenced in Tailwind's theme.</p>
|
|
63
|
-
<h2 id="operation-without-shadow-dom">Operation without Shadow DOM</h2>
|
|
64
|
-
<h3 id="usefulness">Usefulness</h3>
|
|
65
|
-
<p>This operation is particularly useful when it comes to <strong>adding behavior to a simple existing element</strong>.
|
|
66
|
-
It may also become necessary to establish <strong>compatibility with a traditional JS library</strong>.</p>
|
|
67
|
-
<p>For example, with a text input:</p>
|
|
68
|
-
<ul>
|
|
69
|
-
<li>Trigger automatic data or filter update when typing text.</li>
|
|
70
|
-
<li>Automatic formatting.</li>
|
|
71
|
-
<li>Constraints that cannot be handled by native methods.</li>
|
|
72
|
-
</ul>
|
|
73
|
-
<h3 id="consequences">Consequences</h3>
|
|
74
|
-
<p>If there is no shadow DOM (see the <strong>noShadowDom</strong> property of <strong>Subscriber</strong>):</p>
|
|
75
|
-
<ul>
|
|
76
|
-
<li>Styling using the static "styles" property of the lit component will not be applied.</li>
|
|
77
|
-
<li>The element and its content can be styled in a traditional manner.</li>
|
|
78
|
-
</ul>
|
|
79
|
-
<p>For example, the components <code>queue</code>, <code>list</code>, and <code>fetch</code> do not have a shadow DOM.</p>
|
|
80
|
-
<p>ℹ️ <strong>Note:</strong> Specifically in this case, it may be useful to set the <code>display</code> property to <code>contents</code>.</p>
|
|
81
329
|
|
|
82
330
|
</article>
|
|
83
331
|
</main>
|