@excom/valence 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/chunked-rush-logs/valence.apply-exports.chunks.jsonl +1 -0
- package/.rush/temp/chunked-rush-logs/valence.build_package-metas.chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/all.log +1 -0
- package/.rush/temp/operation/apply-exports/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/apply-exports/state.json +3 -0
- package/.rush/temp/operation/build_package-metas/all.log +1 -0
- package/.rush/temp/operation/build_package-metas/log-chunks.jsonl +1 -0
- package/.rush/temp/operation/build_package-metas/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +3 -0
- package/basic-vars.css +395 -0
- package/basic.css +3 -0
- package/package.json +35 -0
- package/rush-logs/valence.apply-exports.cache.log +1 -0
- package/rush-logs/valence.apply-exports.log +1 -0
- package/rush-logs/valence.build_package-metas.cache.log +1 -0
- package/rush-logs/valence.build_package-metas.log +1 -0
- package/src/aliases.css +125 -0
- package/src/apply.css +54 -0
- package/src/components/accordion.css +134 -0
- package/src/components/card.css +54 -0
- package/src/components/dropdown.css +235 -0
- package/src/components/group.css +119 -0
- package/src/components/loading.css +41 -0
- package/src/components/modal.css +172 -0
- package/src/components/nav.css +198 -0
- package/src/components/popover.css +83 -0
- package/src/components/progress.css +88 -0
- package/src/components/tooltip.css +209 -0
- package/src/content/button.css +184 -0
- package/src/content/code.css +68 -0
- package/src/content/embedded.css +49 -0
- package/src/content/figure.css +17 -0
- package/src/content/link.css +79 -0
- package/src/content/misc.css +29 -0
- package/src/content/table.css +144 -0
- package/src/content/typography.css +218 -0
- package/src/forms/basics.css +415 -0
- package/src/forms/checkbox-radio-switch.css +163 -0
- package/src/forms/input-color.css +27 -0
- package/src/forms/input-date.css +66 -0
- package/src/forms/input-file.css +37 -0
- package/src/forms/input-range.css +109 -0
- package/src/forms/input-search.css +52 -0
- package/src/layout/abstract.css +9 -0
- package/src/layout/container.css +43 -0
- package/src/layout/document.css +45 -0
- package/src/layout/grid.css +24 -0
- package/src/layout/landmarks.css +54 -0
- package/src/layout/overflow-auto.css +33 -0
- package/src/layout/section.css +10 -0
- package/src/mixins.basic.css +308 -0
- package/src/mixins.default.css +49 -0
- package/src/util.default.css +55 -0
- package/src/utilities/accessibility.css +69 -0
- package/src/utilities/opt-outs.css +32 -0
- package/support/demos/accordion.html +18 -0
- package/support/demos/aliases.html +6 -0
- package/support/demos/button.html +14 -0
- package/support/demos/card.html +8 -0
- package/support/demos/checkboxes.html +22 -0
- package/support/demos/code.html +6 -0
- package/support/demos/container.html +15 -0
- package/support/demos/css-variables.html +14 -0
- package/support/demos/dropdown.html +17 -0
- package/support/demos/embedded.html +7 -0
- package/support/demos/forms.html +18 -0
- package/support/demos/grid.html +13 -0
- package/support/demos/group.html +14 -0
- package/support/demos/input.html +11 -0
- package/support/demos/landmarks.html +20 -0
- package/support/demos/link.html +7 -0
- package/support/demos/loading.html +5 -0
- package/support/demos/modal.html +18 -0
- package/support/demos/nav.html +39 -0
- package/support/demos/opt-outs.html +8 -0
- package/support/demos/overflow-auto.html +12 -0
- package/support/demos/popover.html +6 -0
- package/support/demos/progress.html +4 -0
- package/support/demos/range.html +6 -0
- package/support/demos/schemes.html +12 -0
- package/support/demos/select.html +13 -0
- package/support/demos/table.html +18 -0
- package/support/demos/textarea.html +7 -0
- package/support/demos/tooltip.html +7 -0
- package/support/demos/typography.html +18 -0
- package/support/docs/ACCORDION.md +26 -0
- package/support/docs/ALIASES.md +35 -0
- package/support/docs/BUTTON.md +28 -0
- package/support/docs/CARD.md +23 -0
- package/support/docs/CHECKBOXES.md +21 -0
- package/support/docs/CODE.md +18 -0
- package/support/docs/CONTAINER.md +24 -0
- package/support/docs/CSS_VARIABLES.md +44 -0
- package/support/docs/DROPDOWN.md +22 -0
- package/support/docs/EMBEDDED.md +18 -0
- package/support/docs/FORMS.md +44 -0
- package/support/docs/GRID.md +19 -0
- package/support/docs/GROUP.md +24 -0
- package/support/docs/INPUT.md +26 -0
- package/support/docs/LANDMARKS.md +25 -0
- package/support/docs/LINK.md +23 -0
- package/support/docs/LOADING.md +15 -0
- package/support/docs/MODAL.md +36 -0
- package/support/docs/NAV.md +25 -0
- package/support/docs/OPT_OUTS.md +31 -0
- package/support/docs/OVERFLOW_AUTO.md +15 -0
- package/support/docs/POPOVER.md +19 -0
- package/support/docs/PROGRESS.md +14 -0
- package/support/docs/RANGE.md +16 -0
- package/support/docs/README.md +70 -0
- package/support/docs/SCHEMES.md +20 -0
- package/support/docs/SELECT.md +18 -0
- package/support/docs/TABLE.md +29 -0
- package/support/docs/TEXTAREA.md +16 -0
- package/support/docs/THEMES.md +39 -0
- package/support/docs/TOOLTIP.md +18 -0
- package/support/docs/TYPOGRAPHY.md +29 -0
- package/support/docs-sections.json +45 -0
- package/support/flat-vars.css +197 -0
- package/support/flat.css +4 -0
- package/support/package-meta.json +1820 -0
- package/support/paper-vars.css +203 -0
- package/support/paper.css +4 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<form>
|
|
2
|
+
<label>
|
|
3
|
+
Email
|
|
4
|
+
<input type="email" name="email" placeholder="you@example.com" autocomplete="email" />
|
|
5
|
+
</label>
|
|
6
|
+
<label>
|
|
7
|
+
Password
|
|
8
|
+
<input type="password" name="password" aria-invalid="true" />
|
|
9
|
+
<small>At least 8 characters.</small>
|
|
10
|
+
</label>
|
|
11
|
+
<fieldset>
|
|
12
|
+
<legend>Plan</legend>
|
|
13
|
+
<label><input type="radio" name="plan" value="free" checked /> Free</label>
|
|
14
|
+
<label><input type="radio" name="plan" value="pro" /> Pro</label>
|
|
15
|
+
</fieldset>
|
|
16
|
+
<label><input type="checkbox" name="terms" /> I agree to the terms</label>
|
|
17
|
+
<button type="submit">Sign up</button>
|
|
18
|
+
</form>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div class="grid">
|
|
2
|
+
<div>1</div>
|
|
3
|
+
<div>2</div>
|
|
4
|
+
<div>3</div>
|
|
5
|
+
<style>
|
|
6
|
+
#demo-valence-grid > :first-child > div {
|
|
7
|
+
padding: var(--v-spacing);
|
|
8
|
+
text-align: center;
|
|
9
|
+
border: 1px dashed var(--v-muted-color);
|
|
10
|
+
border-radius: var(--v-border-radius);
|
|
11
|
+
}
|
|
12
|
+
</style>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<form>
|
|
2
|
+
<fieldset role="group">
|
|
3
|
+
<input type="email" placeholder="Email" aria-label="Email" autocomplete="email" />
|
|
4
|
+
<button type="submit">Subscribe</button>
|
|
5
|
+
</fieldset>
|
|
6
|
+
<fieldset role="search">
|
|
7
|
+
<input type="search" placeholder="Search" aria-label="Search" />
|
|
8
|
+
<button type="submit">Go</button>
|
|
9
|
+
</fieldset>
|
|
10
|
+
<fieldset role="group">
|
|
11
|
+
<input type="text" placeholder="Domain" aria-label="Domain" />
|
|
12
|
+
<label><input type="checkbox" role="switch" checked /> HTTPS</label>
|
|
13
|
+
</fieldset>
|
|
14
|
+
</form>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<form>
|
|
2
|
+
<input type="text" placeholder="Text" aria-label="Text" />
|
|
3
|
+
<input type="search" placeholder="Search" aria-label="Search" />
|
|
4
|
+
<input type="date" aria-label="Date" />
|
|
5
|
+
<input type="text" value="Valid" aria-invalid="false" aria-label="Valid" />
|
|
6
|
+
<input type="text" value="Invalid" aria-invalid="true" aria-label="Invalid" />
|
|
7
|
+
<input type="text" value="Read-only" readonly aria-label="Read-only" />
|
|
8
|
+
<input type="text" value="Disabled" disabled aria-label="Disabled" />
|
|
9
|
+
<input type="file" aria-label="File" />
|
|
10
|
+
<input type="color" value="#0172ad" aria-label="Color" />
|
|
11
|
+
</form>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<section>
|
|
3
|
+
<hgroup>
|
|
4
|
+
<h4>First section</h4>
|
|
5
|
+
<p>Sections space themselves vertically</p>
|
|
6
|
+
</hgroup>
|
|
7
|
+
</section>
|
|
8
|
+
<section>
|
|
9
|
+
<hgroup>
|
|
10
|
+
<h4>Second section</h4>
|
|
11
|
+
<p><code>--v-block-spacing-vertical</code> grows with the viewport</p>
|
|
12
|
+
</hgroup>
|
|
13
|
+
</section>
|
|
14
|
+
<style>
|
|
15
|
+
#demo-valence-landmarks > :first-child section {
|
|
16
|
+
border: 1px dashed var(--v-muted-color);
|
|
17
|
+
padding: var(--v-spacing);
|
|
18
|
+
}
|
|
19
|
+
</style>
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<event-handler target-ref=":scope ~ dialog" command-name="show-modal" class="tag-button">Open modal</event-handler>
|
|
3
|
+
<dialog>
|
|
4
|
+
<article>
|
|
5
|
+
<header>
|
|
6
|
+
<event-handler target-ref=":scope ~ dialog, dialog:has(:scope)" command-name="close" class="tag-button" rel="prev" aria-label="Close"></event-handler>
|
|
7
|
+
<h5>Confirm</h5>
|
|
8
|
+
</header>
|
|
9
|
+
<p>A <code>dialog</code> centers its <code>article</code>; the header close control and the footer buttons are styled for you.</p>
|
|
10
|
+
<footer>
|
|
11
|
+
<form method="dialog">
|
|
12
|
+
<button class="secondary">Cancel</button>
|
|
13
|
+
<button>Confirm</button>
|
|
14
|
+
</form>
|
|
15
|
+
</footer>
|
|
16
|
+
</article>
|
|
17
|
+
</dialog>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<nav>
|
|
3
|
+
<ul>
|
|
4
|
+
<li><strong>Brand</strong></li>
|
|
5
|
+
</ul>
|
|
6
|
+
<ul>
|
|
7
|
+
<li><a href="#">Docs</a></li>
|
|
8
|
+
<li><a href="#" aria-current="page">Blog</a></li>
|
|
9
|
+
<li>
|
|
10
|
+
<details class="dropdown">
|
|
11
|
+
<summary>More</summary>
|
|
12
|
+
<ul dir="rtl">
|
|
13
|
+
<li><a href="#">About</a></li>
|
|
14
|
+
<li><a href="#">Contact</a></li>
|
|
15
|
+
</ul>
|
|
16
|
+
</details>
|
|
17
|
+
</li>
|
|
18
|
+
</ul>
|
|
19
|
+
</nav>
|
|
20
|
+
<nav aria-label="breadcrumb">
|
|
21
|
+
<ul>
|
|
22
|
+
<li><a href="#">Home</a></li>
|
|
23
|
+
<li><a href="#">Docs</a></li>
|
|
24
|
+
<li><a href="#" aria-current="page">Nav</a></li>
|
|
25
|
+
</ul>
|
|
26
|
+
</nav>
|
|
27
|
+
<aside>
|
|
28
|
+
<nav>
|
|
29
|
+
<ul role="tree">
|
|
30
|
+
<li><a href="#" aria-current="page">Getting started</a></li>
|
|
31
|
+
<li><a href="#">Layout</a>
|
|
32
|
+
<ul role="tree">
|
|
33
|
+
<li><a href="#">Grid</a></li>
|
|
34
|
+
</ul>
|
|
35
|
+
</li>
|
|
36
|
+
</ul>
|
|
37
|
+
</nav>
|
|
38
|
+
</aside>
|
|
39
|
+
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<div class="overflow-auto">
|
|
2
|
+
<table>
|
|
3
|
+
<thead>
|
|
4
|
+
<tr><th>Planet</th><th>Diameter (km)</th><th>Distance from Sun (10⁶ km)</th><th>Orbital period (days)</th><th>Moons</th></tr>
|
|
5
|
+
</thead>
|
|
6
|
+
<tbody>
|
|
7
|
+
<tr><td>Mercury</td><td>4,879</td><td>57.9</td><td>88</td><td>0</td></tr>
|
|
8
|
+
<tr><td>Venus</td><td>12,104</td><td>108.2</td><td>224.7</td><td>0</td></tr>
|
|
9
|
+
<tr><td>Earth</td><td>12,756</td><td>149.6</td><td>365.2</td><td>1</td></tr>
|
|
10
|
+
</tbody>
|
|
11
|
+
</table>
|
|
12
|
+
</div>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<p>
|
|
2
|
+
<button popovertarget="demo-valence-pop-top" popovertargetaction="toggle">Top</button>
|
|
3
|
+
<div id="demo-valence-pop-top" popover>Anchored above the button.</div>
|
|
4
|
+
<button popovertarget="demo-valence-pop-bottom" class="secondary">Bottom</button>
|
|
5
|
+
<div id="demo-valence-pop-bottom" popover data-placement="bottom">Anchored below the button.</div>
|
|
6
|
+
</p>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<article data-scheme="light">
|
|
3
|
+
<h4>Light</h4>
|
|
4
|
+
<p>Forced with <code>data-scheme="light"</code>.</p>
|
|
5
|
+
<button>Primary</button>
|
|
6
|
+
</article>
|
|
7
|
+
<article data-scheme="dark">
|
|
8
|
+
<h4>Dark</h4>
|
|
9
|
+
<p>Forced with <code>data-scheme="dark"</code>.</p>
|
|
10
|
+
<button>Primary</button>
|
|
11
|
+
</article>
|
|
12
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<form>
|
|
2
|
+
<select name="planet" aria-label="Planet" required>
|
|
3
|
+
<option selected disabled value="">Select a planet…</option>
|
|
4
|
+
<option>Mercury</option>
|
|
5
|
+
<option>Venus</option>
|
|
6
|
+
<option>Earth</option>
|
|
7
|
+
</select>
|
|
8
|
+
<select name="moons" aria-label="Moons" multiple size="3">
|
|
9
|
+
<option selected>Luna</option>
|
|
10
|
+
<option>Phobos</option>
|
|
11
|
+
<option>Deimos</option>
|
|
12
|
+
</select>
|
|
13
|
+
</form>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<table class="striped">
|
|
2
|
+
<thead>
|
|
3
|
+
<tr>
|
|
4
|
+
<th scope="col" aria-sort="ascending">Planet</th>
|
|
5
|
+
<th scope="col" aria-sort="none">Diameter</th>
|
|
6
|
+
<th scope="col">Moons</th>
|
|
7
|
+
</tr>
|
|
8
|
+
</thead>
|
|
9
|
+
<tbody>
|
|
10
|
+
<tr><th scope="row">Mercury</th><td>4,879 km</td><td>0</td></tr>
|
|
11
|
+
<tr><th scope="row">Venus</th><td>12,104 km</td><td>0</td></tr>
|
|
12
|
+
<tr><th scope="row">Earth</th><td>12,756 km</td><td>1</td></tr>
|
|
13
|
+
<tr><th scope="row">Mars</th><td>6,792 km</td><td>2</td></tr>
|
|
14
|
+
</tbody>
|
|
15
|
+
<tfoot>
|
|
16
|
+
<tr><th scope="row">Total</th><td></td><td>3</td></tr>
|
|
17
|
+
</tfoot>
|
|
18
|
+
</table>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<p>
|
|
2
|
+
<span role="tooltip" aria-description="Shown above by default">Hover me</span>
|
|
3
|
+
·
|
|
4
|
+
<button role="tooltip" aria-description="Placed below" data-placement="bottom">Bottom</button>
|
|
5
|
+
·
|
|
6
|
+
<a href="#" role="tooltip" aria-description="To the right" data-placement="right">Right</a>
|
|
7
|
+
</p>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<hgroup>
|
|
3
|
+
<h3>Heading group</h3>
|
|
4
|
+
<p>The last child of an <code>hgroup</code> is muted</p>
|
|
5
|
+
</hgroup>
|
|
6
|
+
<p>A paragraph with <strong>strong</strong>, <em>emphasis</em>, <mark>mark</mark>, <ins>ins</ins>, <del>del</del>, <abbr title="Accessible Rich Internet Applications">ARIA</abbr>, <kbd>Ctrl</kbd> and <code>code</code>.</p>
|
|
7
|
+
<ul>
|
|
8
|
+
<li>Square markers on <code>ul</code></li>
|
|
9
|
+
<li>Nested lists keep their spacing
|
|
10
|
+
<ul><li>like this one</li></ul>
|
|
11
|
+
</li>
|
|
12
|
+
</ul>
|
|
13
|
+
<blockquote>
|
|
14
|
+
Valence.css is a lightly modified fork of Pico.
|
|
15
|
+
<footer><cite>— the README</cite></footer>
|
|
16
|
+
</blockquote>
|
|
17
|
+
<small role="note">A <code>small[role="note"]</code> is a block-level muted note.</small>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Accordion
|
|
2
|
+
|
|
3
|
+
`details` / `summary` is the accordion: a chevron marker, animated content, and a `summary[role="button"]` variant.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="accordion"></include-content>
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<details>
|
|
11
|
+
<summary>Title</summary>
|
|
12
|
+
<p>Content</p>
|
|
13
|
+
</details>
|
|
14
|
+
<details>
|
|
15
|
+
<summary role="button" class="outline secondary">Button summary</summary>
|
|
16
|
+
<p>Content</p>
|
|
17
|
+
</details>
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- The content (`::details-content`) animates height and opacity on open / close (`interpolate-size`; instant under reduced motion).
|
|
21
|
+
- `summary[role="button"]` is a full-width button and takes every [button](./BUTTON.md) flavor.
|
|
22
|
+
- Open state is `:--details--open`: `[open]` or `aria-expanded="true"`, so a custom disclosure element reflecting ARIA gets the rotated marker and colors.
|
|
23
|
+
|
|
24
|
+
## Aliases
|
|
25
|
+
|
|
26
|
+
`.tag-details` / `.tag-summary` (`details` has no ARIA role; `summary`'s implicit role is `button`, deliberately not aliased to avoid colliding with `:--button`). A [dropdown](./DROPDOWN.md) is an accordion with `.dropdown`.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Aliases
|
|
2
|
+
|
|
3
|
+
Every Valence.css tag alias is a `@custom-selector` that matches the native tag, its ARIA role and an `.tag-*` class — so a custom element or a plain `div` can wear any semantic style.
|
|
4
|
+
|
|
5
|
+
## Three ways to match
|
|
6
|
+
|
|
7
|
+
`:--article` expands to `article, [role="article"], .tag-article`. Pico ties its styles to tag names, which custom elements cannot reuse; Valence.css adds the role and class forms to every tag alias:
|
|
8
|
+
|
|
9
|
+
<include-content data-demo="aliases"></include-content>
|
|
10
|
+
|
|
11
|
+
| Alias | Matches |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `:--article` | `article`, `[role="article"]`, `.tag-article` |
|
|
14
|
+
| `:--button` | `button`, `[role="button"]`, `[type="button"]`, `.tag-button` |
|
|
15
|
+
| `:--details` / `:--summary` | `details` / `summary`, `.tag-details` / `.tag-summary` |
|
|
16
|
+
| `:--dialog` | `dialog`, `[role="dialog"]`, `.tag-dialog` |
|
|
17
|
+
| `:--nav`, `:--list`, `:--li` | `nav` / `[role="navigation"]`, `ul` / `ol` / `[role="list"]`, `li` / `[role="listitem"]` |
|
|
18
|
+
| `:--table`, `:--tr`, `:--th`, `:--td` | tags, `[role="table"]` / `"row"` / `"columnheader"` / `"cell"`, `[scope]` |
|
|
19
|
+
| `:--heading`, `:--h1` … `:--h6` | `h1`…`h6`, `[role="heading"][aria-level]` |
|
|
20
|
+
|
|
21
|
+
The full list is in the *API Reference* on the [package page](./README.md#md-api-reference) (*CSS aliases*). Prefer the role form when the element genuinely has that role (screen readers benefit too); use `.tag-*` when it does not.
|
|
22
|
+
|
|
23
|
+
## State aliases
|
|
24
|
+
|
|
25
|
+
States are `:--{element}--{state}` and match ARIA as well as native state: `:--details--open` is `[open], [aria-expanded="true"]`; `:--button--disabled` is `[disabled], [aria-disabled="true"]`; `:--progress--value` is `[value], [aria-valuenow]`. A custom element that reflects `aria-expanded` gets the open styling for free.
|
|
26
|
+
|
|
27
|
+
## Custom elements
|
|
28
|
+
|
|
29
|
+
- Put the tag alias class on the host (`<content-drawer class="tag-article">`) — styles apply without the element knowing Valence.css exists.
|
|
30
|
+
- Elements with a shadow root inherit the tokens through `:host`; only the tokens cross the boundary, the rules do not.
|
|
31
|
+
- `.abstract` (`display: contents`) lets a wrapper element sit between a parent and the children a rule expects (`article > header`): see [Opt-outs](./OPT_OUTS.md).
|
|
32
|
+
|
|
33
|
+
## Not aliased
|
|
34
|
+
|
|
35
|
+
Inimitable natives — `input`, `textarea`, `select` — have no alias; style a wrapper or use the native control. Pseudo-elements cannot be aliased (`postcss-custom-selectors` wraps in `:is()`), which is why the modal backdrop is a sibling element for custom hosts (see [Modal](./MODAL.md)).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
Buttons come in primary, `.secondary` and `.contrast`, each with an `.outline` variant, and the same styles apply to any `[role="button"]` or `.tag-button` element.
|
|
4
|
+
|
|
5
|
+
## Flavors
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="button"></include-content>
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<button>Primary</button>
|
|
11
|
+
<button class="secondary">Secondary</button>
|
|
12
|
+
<button class="contrast">Contrast</button>
|
|
13
|
+
<button class="outline">Outline</button>
|
|
14
|
+
<button class="outline secondary">Outline secondary</button>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`[type="submit"]` is primary, `[type="reset"]` secondary and `[type="file"]`'s selector button secondary. Buttons are `inline-block`; a `[type="submit"]` inside a form is full-width (see [Forms](./FORMS.md)).
|
|
18
|
+
|
|
19
|
+
## States
|
|
20
|
+
|
|
21
|
+
- **Disabled** — `[disabled]` or `aria-disabled="true"` (`:--button--disabled`): half opacity, no pointer events; a `fieldset[disabled]` disables every button inside.
|
|
22
|
+
- **Busy** — `aria-busy="true"` shows the [loading](./LOADING.md) spinner and blocks pointer events.
|
|
23
|
+
- **Current** — `[aria-current]` (not `"false"`) renders the hover state.
|
|
24
|
+
- **Focus** — a `--v-primary-focus` ring (`-secondary-` / `-contrast-` per flavor).
|
|
25
|
+
|
|
26
|
+
## Tokens
|
|
27
|
+
|
|
28
|
+
A button reads `--v-background-color`, `--v-border-color`, `--v-color` and `--v-box-shadow` from its flavor (`--v-primary-background`, `--v-primary-border`, `--v-primary-inverse`, …); override those on the element or restyle a flavor globally through the [CSS variables](./CSS_VARIABLES.md).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Card
|
|
2
|
+
|
|
3
|
+
An `article` is a card: padding, radius, shadow, and sectioned `header` / `footer` bands.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="card"></include-content>
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<article>
|
|
11
|
+
<header>Header</header>
|
|
12
|
+
Body
|
|
13
|
+
<footer>Footer</footer>
|
|
14
|
+
</article>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`header` / `footer` (direct children, or through an `.abstract` wrapper) bleed to the card edges with `--v-card-sectioning-background-color` and a `--v-card-border-color` rule. `.nested` quiets a card inside another card (`--v-multiply-color-*` surfaces).
|
|
18
|
+
|
|
19
|
+
Tokens: `--v-card-background-color`, `--v-card-border-color`, `--v-card-box-shadow`, `--v-card-sectioning-background-color`; the padding is `--v-block-spacing-vertical` / `-horizontal`, so cards grow with the viewport like [sections](./LANDMARKS.md).
|
|
20
|
+
|
|
21
|
+
## Aliases
|
|
22
|
+
|
|
23
|
+
`[role="article"]` / `.tag-article` — the usual way to make a custom element a card (`<content-drawer class="tag-article">`).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Checkboxes, radios & switches
|
|
2
|
+
|
|
3
|
+
Native `checkbox` and `radio` inputs are restyled with the primary color; `role="switch"` turns a checkbox into a toggle.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="checkboxes"></include-content>
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<label><input type="checkbox" checked /> Checked</label>
|
|
11
|
+
<label><input type="radio" name="r" /> Radio</label>
|
|
12
|
+
<label><input type="checkbox" role="switch" /> Switch</label>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
- A checkbox in the `indeterminate` state (set from JS) shows a minus.
|
|
16
|
+
- A `label` that wraps a checkbox / radio shrinks to its content and gets a pointer cursor; labels after the input (`input ~ label`) stay inline.
|
|
17
|
+
- `aria-invalid="true"` / `"false"` recolor the checked control.
|
|
18
|
+
|
|
19
|
+
## Switch
|
|
20
|
+
|
|
21
|
+
`[type="checkbox"][role="switch"]` is a `2.25em × 1.25em` track (`--v-switch-background-color`, checked `--v-switch-checked-background-color`) with an animated thumb; inside a [group](./GROUP.md) a switch label becomes an attached segment.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Code
|
|
2
|
+
|
|
3
|
+
`code`, `kbd`, `samp` and `pre` share the monospace tokens; `pre > code` becomes a scrollable block.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="code"></include-content>
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<p>Press <kbd>⌘</kbd> <kbd>K</kbd> to run <code>build</code>.</p>
|
|
11
|
+
<pre><code>npm install @excom/valence</code></pre>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
- Inline `code` / `samp`: `--v-code-background-color` / `--v-code-color`, small padding, `0.75em`.
|
|
15
|
+
- `kbd`: inverted (`--v-code-kbd-background-color` / `-color`).
|
|
16
|
+
- `pre`: block, `overflow-x: auto`, `--v-spacing` padding on the inner `code` / `samp`.
|
|
17
|
+
|
|
18
|
+
Aliases: `[role="code"]` / `.tag-code`, `.tag-pre`, `.tag-kbd`, `.tag-samp`.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Container
|
|
2
|
+
|
|
3
|
+
`.container` centers content in a responsive column; `.container-fluid` spans the full width with padding only.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="container"></include-content>
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<main class="container">…</main>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Breakpoints
|
|
14
|
+
|
|
15
|
+
| Viewport | `.container` max-width |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| < 576px | 100% (with `--v-spacing` padding) |
|
|
18
|
+
| ≥ 576px | 510px |
|
|
19
|
+
| ≥ 768px | 700px |
|
|
20
|
+
| ≥ 1024px | 950px |
|
|
21
|
+
| ≥ 1280px | 1200px |
|
|
22
|
+
| ≥ 1536px | 1450px |
|
|
23
|
+
|
|
24
|
+
Landmark children of `body` (`header`, `main`, `footer`) get the same column without any class — see [Landmarks & section](./LANDMARKS.md).
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# CSS variables
|
|
2
|
+
|
|
3
|
+
Every color, size and spacing is a `--v-*` custom property; override them on `:root` or on any subtree.
|
|
4
|
+
|
|
5
|
+
## Overriding tokens
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="css-variables"></include-content>
|
|
8
|
+
|
|
9
|
+
```css
|
|
10
|
+
:root {
|
|
11
|
+
--v-primary: #7c3aed;
|
|
12
|
+
--v-primary-background: #7c3aed;
|
|
13
|
+
--v-border-radius: 2rem;
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Scheme-dependent tokens (colors) are declared per scheme, so override them under both `[data-scheme="light"]` / `:root:not([data-scheme="dark"])` and `[data-scheme="dark"]` (plus the `prefers-color-scheme: dark` auto case) when the value should differ — see [Color schemes](./SCHEMES.md).
|
|
18
|
+
|
|
19
|
+
## Token families
|
|
20
|
+
|
|
21
|
+
| Family | Examples |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| Typography | `--v-font-family`, `--v-font-size`, `--v-line-height`, `--v-font-weight`, `--v-h1-color` … `--v-h6-color` |
|
|
24
|
+
| Spacing | `--v-spacing`, `--v-typography-spacing-vertical`, `--v-block-spacing-vertical` / `-horizontal`, `--v-grid-column-gap` / `-row-gap` |
|
|
25
|
+
| Borders & outline | `--v-border-radius`, `--v-border-width`, `--v-outline-width`, `--v-box-shadow` |
|
|
26
|
+
| Colors | `--v-background-color`, `--v-color`, `--v-muted-color`, `--v-muted-border-color`, `--v-primary*`, `--v-secondary*`, `--v-contrast*` (each with `-background`, `-border`, `-hover`, `-focus`, `-inverse`, `-underline`) |
|
|
27
|
+
| Forms | `--v-form-element-*` (background, border, color, placeholder, active, focus, valid / invalid, disabled opacity), `--v-switch-*`, `--v-range-*`, `--v-icon-*` |
|
|
28
|
+
| Components | `--v-card-*`, `--v-accordion-*`, `--v-dropdown-*`, `--v-modal-overlay-*`, `--v-popover-*`, `--v-progress-*`, `--v-tooltip-*`, `--v-nav-*`, `--v-table-*`, `--v-code-*` |
|
|
29
|
+
| Motion | `--v-transition`, `--v-transition-duration-fast` / `-standard` / `-slow`, `--v-transition-ease-out` / `-in` / `-in-out` |
|
|
30
|
+
|
|
31
|
+
The complete list with defaults is the *CSS properties* table of the [API Reference](./README.md#md-api-reference).
|
|
32
|
+
|
|
33
|
+
## Element-level tokens
|
|
34
|
+
|
|
35
|
+
Elements redefine tokens locally rather than setting properties: a button sets `--v-background-color` and `--v-color`, headings set `--v-font-size`, `--v-line-height` and `--v-typography-spacing-top`. Override those on the element to restyle one kind of element without touching the rule:
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
h1 { --v-font-size: 2.5rem; }
|
|
39
|
+
button.cta { --v-background-color: var(--v-contrast-background); }
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Writing tokens from Quark
|
|
43
|
+
|
|
44
|
+
`--name:` declarations write custom properties on matched elements, so State can drive theming (`:scope { --v-primary: $brand; }`) — see the quark docs *CSS variables*.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Dropdown
|
|
2
|
+
|
|
3
|
+
A `details.dropdown` opens a menu below its `summary`: select-styled by default, button-styled with `role="button"`, and inline inside a [nav](./NAV.md).
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="dropdown"></include-content>
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<details class="dropdown">
|
|
11
|
+
<summary>Choose…</summary>
|
|
12
|
+
<ul>
|
|
13
|
+
<li><a href="#">Option</a></li>
|
|
14
|
+
<li><label><input type="checkbox" /> Toggle</label></li>
|
|
15
|
+
</ul>
|
|
16
|
+
</details>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- The default `summary` looks like a `select` (chevron, `--v-form-element-*` tokens, `aria-invalid` colors); `summary[role="button"]` looks like a [button](./BUTTON.md).
|
|
20
|
+
- The menu is the `ul` right after the summary: absolutely positioned, `--v-dropdown-*` tokens, links and labels fill each row; `dir="rtl"` on the list right-aligns it.
|
|
21
|
+
- While open, an invisible full-page `::before` on the summary closes the menu on an outside click — no JS.
|
|
22
|
+
- Inside a `nav`, the dropdown sits inline with the links; inside a `label`, it aligns like a control.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Embedded content
|
|
2
|
+
|
|
3
|
+
Images, media and figures are responsive by default; `figcaption` is muted.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="embedded"></include-content>
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<figure>
|
|
11
|
+
<img src="…" alt="…" />
|
|
12
|
+
<figcaption>Caption</figcaption>
|
|
13
|
+
</figure>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
- `img` (and `[role="img"]` / `.tag-img`): `max-width: 100%`, `height: auto`, no border.
|
|
17
|
+
- `audio`, `canvas`, `iframe`, `img`, `svg`, `video`: middle-aligned; `iframe` has no border; `svg` without `fill` inherits `currentColor`.
|
|
18
|
+
- `figure` has no margin; `figcaption` (`[role="caption"]` inside a figure) is padded and `--v-muted-color`.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Forms
|
|
2
|
+
|
|
3
|
+
Form controls are full-width, labels stack above them, and validity, helper text and disabled states come from attributes alone.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="forms"></include-content>
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<form>
|
|
11
|
+
<label>
|
|
12
|
+
Email
|
|
13
|
+
<input type="email" name="email" />
|
|
14
|
+
<small>We never share it.</small>
|
|
15
|
+
</label>
|
|
16
|
+
<fieldset>
|
|
17
|
+
<legend>Plan</legend>
|
|
18
|
+
<label><input type="radio" name="plan" checked /> Free</label>
|
|
19
|
+
</fieldset>
|
|
20
|
+
<button type="submit">Sign up</button>
|
|
21
|
+
</form>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Layout
|
|
25
|
+
|
|
26
|
+
- `input` (except checkbox / radio), `select`, `textarea` and `button[type="submit"]` are `width: 100%` with `--v-spacing` below.
|
|
27
|
+
- A `label` is a block with the control inside it or before it; `fieldset` / `legend` group controls without borders.
|
|
28
|
+
- Put controls in a [`.grid`](./GRID.md) for columns, or in a [group](./GROUP.md) for an input + button pair.
|
|
29
|
+
|
|
30
|
+
## Helper text
|
|
31
|
+
|
|
32
|
+
A `small` right after an `input`, `select`, `textarea`, `fieldset` or `.grid` becomes a muted note; it turns green / red after a control with `aria-invalid="false"` / `"true"`.
|
|
33
|
+
|
|
34
|
+
## Validation
|
|
35
|
+
|
|
36
|
+
`aria-invalid="true"` / `"false"` colors the border and focus ring and draws an icon inside text-like inputs (`--v-icon-invalid` / `--v-icon-valid`). No class is needed and the state stays in the document, where CSS, Quark and assistive technology all read it.
|
|
37
|
+
|
|
38
|
+
## Disabled
|
|
39
|
+
|
|
40
|
+
`[disabled]` controls (and every control inside a `fieldset[disabled]`) drop to `--v-form-element-disabled-opacity` and ignore the pointer; a `label[aria-disabled="true"]` mutes its text too.
|
|
41
|
+
|
|
42
|
+
## Controls
|
|
43
|
+
|
|
44
|
+
[Input](./INPUT.md) · [Textarea](./TEXTAREA.md) · [Select](./SELECT.md) · [Checkboxes, radios & switches](./CHECKBOXES.md) · [Range](./RANGE.md)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Grid
|
|
2
|
+
|
|
3
|
+
`.grid` lays its children out in equal auto-fit columns from 768px up, and stacks them below.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
<include-content data-demo="grid"></include-content>
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<div class="grid">
|
|
11
|
+
<div>1</div>
|
|
12
|
+
<div>2</div>
|
|
13
|
+
<div>3</div>
|
|
14
|
+
</div>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Gaps are `--v-grid-column-gap` / `--v-grid-row-gap` (both `--v-spacing`). Children get `min-width: 0` so overflowing content scrolls instead of stretching the column.
|
|
18
|
+
|
|
19
|
+
Inside a form, `.grid` also carries the helper-text rule: a `small` right after a `.grid` of inputs is a muted note (see [Forms](./FORMS.md)).
|