Compare commits

...

151 Commits

Author SHA1 Message Date
Cory LaViska
ac376afbaa prevent card example from overflowing 2025-03-12 14:44:05 -04:00
Cory LaViska
1283a696a5 fix switch + tooltip behavior (#793) 2025-03-12 18:22:23 +00:00
Cory LaViska
d12b97b0b0 fix wa-pill and wa-input[pill] styles (#791) 2025-03-12 16:19:50 +00:00
Lea Verou
e5c2884880 [Tooltip] Specify inherited CSS properties on host, fixes #773 (#774)
* [Tooltip] Specify inherited CSS properties on host, fixes #773

* Remove unused `--show-delay` and `--hide-delay`
2025-03-10 15:08:27 -04:00
Lea Verou
1d600a77c4 Fix #566 2025-03-10 14:15:06 -04:00
lindsaym-fa
db3c568ba2 Add generated orange to Anodized palette 2025-03-05 22:27:11 -05:00
lindsaym-fa
4bb9805ba6 Add generated orange to Bright palette 2025-03-05 22:27:11 -05:00
lindsaym-fa
bd935fa8d5 Add generated orange to Classic palette 2025-03-05 22:27:11 -05:00
lindsaym-fa
c3e582b47b Add generated orange to Natural palette 2025-03-05 22:27:11 -05:00
lindsaym-fa
4d094a4e19 Add generated orange to Rudimentary palette 2025-03-05 22:27:11 -05:00
lindsaym-fa
782c404bdf Add generated orange to Default palette 2025-03-05 22:27:11 -05:00
lindsaym-fa
f1438981b2 Add generated orange to Elegant palette 2025-03-05 22:27:11 -05:00
lindsaym-fa
18b88c2f5c Add generated orange to Mild palette 2025-03-05 22:27:11 -05:00
lindsaym-fa
a2d85f49a3 Add generated orange to Vogue palette 2025-03-05 22:27:11 -05:00
Lea Verou
be00026cd3 Update postprocess.js 2025-03-05 22:27:11 -05:00
Lea Verou
58ed88bc5a Add orange to list of hues 2025-03-05 22:27:11 -05:00
Lea Verou
1d14e186f3 Generate missing hues from neighboring hues 2025-03-05 22:27:11 -05:00
Lea Verou
5f672aabc2 Refactor: variable rename for consistency 2025-03-05 22:27:11 -05:00
Lea Verou
db08e12a32 Pave the way for being able to have core colors that are not mapped to any tint 2025-03-05 22:27:11 -05:00
Lea Verou
e0fc639226 Only use hex when color is within sRGB 2025-03-05 22:27:11 -05:00
Lea Verou
e6c662b543 tintless.js -> postprocess.js 2025-03-05 22:27:11 -05:00
lindsaym-fa
d1de9a9a73 Fix incorrect sizing tokens in size utilities 2025-02-26 01:01:39 -05:00
lindsaym-fa
4931de8eb4 Fix text color for filled appearance 2025-02-26 01:01:39 -05:00
Lea Verou
71e7227763 Theme remixing fix: Order of params should not matter (#772)
Also renamed the `theme` export to `getThemeCode` since it was being renamed everywhere it was imported.
2025-02-21 14:03:55 -05:00
Lea Verou
dd671e15aa Changelog (#770) 2025-02-21 13:14:19 -05:00
Cory LaViska
2daeea0349 3.0.0-alpha.11 2025-02-21 12:53:05 -05:00
Cory LaViska
3cb6625c1d update changelog 2025-02-21 12:52:51 -05:00
Lea Verou
c4b5446d01 Fix boundingClientRect issue for elements whose host is display: contents 2025-02-21 12:02:20 -05:00
Lindsay M
41affca083 Allow color tweak tags to wrap (#769) 2025-02-21 11:50:13 -05:00
Lea Verou
132dbfabcc Gray tweaks prototype (#761)
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2025-02-20 12:10:43 -05:00
lindsaym-fa
4fc6224464 Fix missing listbox border 2025-02-19 14:54:11 -05:00
Lea Verou
4921d1c32e Save palette MVP, fixes #746 (#755) 2025-02-18 16:11:40 -05:00
Lindsay M
54d71d2319 Use tintless and clamped brand colors in themes (#754)
* Use tintless `brand` colors, cutoffs in themes

* Re-add `40-min`, add `70-max`

* Fix mistakes in Mellow theme

* Revert accidental Premium brand color change

* Add changelog
2025-02-18 10:22:32 -05:00
Cory LaViska
c1ecca0169 fix select hint (#760) 2025-02-18 15:09:52 +00:00
Lea Verou
d6a91919e0 Code block improvements
- Add ids, use ids to link copy button. No need for client-side script or updating the copy button manually for dynamic code snippets.
- Add button to link to code block
- Slight refactor on copy plugin to use the 11ty API properly
2025-02-14 15:09:02 -05:00
Lea Verou
4621094ea1 [Tab] Avoid sprouting attributes in the constructor 2025-02-14 13:04:39 -05:00
Lea Verou
726dc73e2a Hue tweaking & chroma scaling, closes #669 #670 (#747)
- General infrastructure to support palette tweaking
- Hue shifts per color scale (UI, permalinks, dynamic code snippets)
- Scale overall chroma up/down (UI, permalinks, dynamic code snippets)
- Update contrast ratio tables (styling for contrast up/down/fail could use improvement, but it's a starting point)
- Make sure it works with Turbo (i.e. things don't break when we navigate to another page)
2025-02-13 19:28:20 -05:00
Lea Verou
4bfebf3249 Improve color ranges script (#752) 2025-02-13 18:15:47 -05:00
Lea Verou
99ad0abdd3 Palette icons, take 4 2025-02-13 10:52:40 -05:00
Cory LaViska
902e2b6367 Fix invalid CSS property in <wa-select> (#751)
* remove empty selectors

* fix invalid property

* update changelog
2025-02-13 15:45:57 +00:00
Lea Verou
7f3210b12d Update changelog 2025-02-13 09:44:27 -05:00
Lea Verou
eee63bdecd Clamped brand color tokens (#741) 2025-02-12 15:13:03 -05:00
Lindsay M
a91fd07ed7 Add pink, closes #658 (#742) 2025-02-11 10:52:51 -05:00
Lindsay M
34aa8917a6 Revisit default palette, closes #706 (#731)
* Adjust  everything  (but not grays)

* Update keys

* Tweak green

* Update lighter `green` tints
2025-02-10 22:37:14 -05:00
Lindsay M
715c2c0def Revisit bright palette, closes #697 (#705)
* Adjust red and yellow

* Update remaining colors

* Correct Awesome theme success colors

* Adjust `red`

* Redefine `indigo` and `purple`

* Tweak `indigo`
2025-02-10 17:11:34 -05:00
Lea Verou
13b5385633 Radio improvements
- Drop `base` part (rel #207)
- Add `hint` slot and attribute (it was the only form control that did not support that)
- Refactor `@watch` calls to `updated()` per @claviska's plan for them
2025-02-10 14:19:53 -05:00
Lea Verou
d25f3748c4 Analyze color components (#732)
Also refactored existing color scripts (moved to separate directory, extracted utils to separate file)
2025-02-10 13:54:54 -05:00
Lindsay M
b6620ddf7e Revisit vogue palette, closes #723 (#738) 2025-02-10 13:23:57 -05:00
Lindsay M
d70d4a91b1 Revisit mild palette, closes #720 (#737)
* Adjust `cyan`, `indigo`, and `purple`

* Skew `indigo` more towards blue

* Better matching to Material tonal palettes
2025-02-10 13:20:44 -05:00
Lindsay M
bb1f7b2b7a Adjust everything (#734) 2025-02-10 11:42:31 -05:00
Lindsay M
9921c17d63 Revisit natural palette, closes #721 (#735)
* Adjust `cyan`

* Adjust `blue` and `purple`

* Adjust `red` and `yellow`
2025-02-10 11:42:11 -05:00
Lindsay M
7f964f9b56 Adjust everything (#736) 2025-02-10 11:41:36 -05:00
Lindsay M
31eeea1630 Revisit anodized palette, closes #718 (#733)
* Adjust  everything 

* Shift `red` towards orange in darker tints

* Tweak `green` balance
2025-02-10 11:41:17 -05:00
Lea Verou
ffda52a7cf Theme remixing: Dynamic code snippets (#729) 2025-02-07 23:03:34 -05:00
Lea Verou
9be7919c60 Implement brand stylesheets for missing hues 2025-02-07 17:59:18 -05:00
Lea Verou
c30f3c4b09 Improve theme remixing UI (#724)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2025-02-07 11:35:12 -05:00
Lea Verou
7e8f13b5cb Add accent color tint as separate variable (#725)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-02-06 18:30:43 -05:00
Lindsay M
97ab986425 Revise classic palette, closes #707 (#716)
* Change  everything 

* No changes to `gray`
2025-02-06 17:58:33 -05:00
Lea Verou
f1fa7f713e Add label attribute to option & menu-item (#704)
* Add `label` attribute and `defaultLabel` getter to option and menu-item, drop `getTextLabel()`

- Add `label` attribute to option and menu-item, closes #698
- [Option] Add `defaultLabel` cached property to both
- [Option] Remove `getTextLabel()` method from both (people can just set `el.label`)
- Refactor: Merge utils to get text content into one more powerful utility function
- Fixed typo in `slot.ts`

.

Add `label` attribute to menu, remove `getTextLabel`

* Update filename
2025-02-06 10:58:09 -05:00
lindsaym-fa
3394a95057 Remove visual test failure markers 2025-02-06 10:57:33 -05:00
Lea Verou
eed9ddb9b3 Fix #622 2025-02-06 10:57:33 -05:00
Lea Verou
daf5e7734d Support opting out of anchor headings with data-no-anchor 2025-02-06 10:56:56 -05:00
Lea Verou
63133d0e33 Card fixes 2025-02-06 10:25:02 -05:00
Lea Verou
b2d74145b8 Remove stray console.log() 2025-02-05 11:35:55 -05:00
Lea Verou
17eeccbc5d Better infrastructure for core colors, show core colors in docs, closes #668 2025-02-05 11:24:13 -05:00
Lea Verou
68f645e776 [Option] Drop base part, rel #207 2025-02-05 09:29:50 -05:00
Cory LaViska
b3e4c59197 add secure context notice (#683) 2025-02-04 16:27:35 +00:00
Lindsay M
6080a85035 Replace teal with cyan, fixes #659 (#671)
Co-authored-by: Lea Verou <lea@verou.me>
2025-02-03 19:01:23 -05:00
lindsaym-fa
f7e088c8df Rename violet to purple, fixes #656 2025-02-03 18:47:03 -05:00
Lea Verou
80e1c05b37 Add --wa-color-brand-* tokens, fixes #655 (#662) 2025-02-03 15:39:59 -05:00
Cory LaViska
99f0273783 fix placeholder token (#652) 2025-02-03 17:03:34 +00:00
Cory LaViska
8e13683a30 Select tag fix (#651)
* add tag-counter part to wa-select

* on second thought
2025-02-03 16:48:46 +00:00
Cory LaViska
fd73542d2c restore slot detection for non-SSR environments (#649) 2025-02-03 16:21:53 +00:00
Cory LaViska
bde0ed7403 add orientation example and use utils for spacing (#648) 2025-02-03 15:46:51 +00:00
Cory LaViska
8dc49f7119 fix event listeners (#647) 2025-02-03 10:07:21 -05:00
Cory LaViska
25cb96aa30 3.0.0-alpha.10 2025-01-31 11:23:56 -05:00
Cory LaViska
360273ac27 update version 2025-01-31 11:23:50 -05:00
Lea Verou
404d59d9d6 Improve FOUCE reduction utility, docs fixes, :state(wa-defined) (#643)
* Utility layout

* Split out, improve & document FOUCE utility
2025-01-31 11:19:30 -05:00
Lea Verou
ce1ce6caca Fix regression (#642) 2025-01-31 10:01:01 -05:00
Lea Verou
74ecc52a15 Inheritable size (#593)
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-30 15:56:32 -08:00
Lindsay M
a64cc60ad5 Revise docs to clarify installation guidance (#638)
* Revise docs to clarify installation guidance

* Fix broken link

* Clarify `:where(:root)`, add CSS part example
2025-01-30 14:40:08 -05:00
Lindsay M
c5f91ec2f7 Add missing changelog entries (#639)
* Add logs for visual tests, `variant` inheritance, and missing bug fixes

* Update logs on docs changes
2025-01-30 11:51:57 -05:00
Lea Verou
4f9af1e871 Add JS snppet for setting wa-dark based on OS default 2025-01-30 08:32:01 -08:00
Lea Verou
aeb25f3a7d Infrastructure for inheritable props, make variant inherit (#582)
Fixes #454, fixes #592 

Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-29 16:22:50 -08:00
Cory LaViska
b89ee673e6 Fix <wa-textarea> form submit behavior (#637)
* fix textarea form submit behavior

* add test
2025-01-29 17:57:16 -05:00
Lindsay M
3c70c44b8a Use flex columns for form controls, fixes #629 (#636)
* Use flex columns for form controls

* Touch up spacing in color picker example

* Use consistent `display` for related form controls
2025-01-29 09:56:09 -05:00
Lindsay M
d8881c0b1e Add Visual Test Suite (#617)
* Initial progress on visual test suite

* Additional tests and descriptions

* Add native callout, add dividers between tables

* Indicate test failures, improve alignment tests

* Split tests into separate files

* Add table scrolling

* Remove irrelevant icon test cases

* Add test failures

* Shorten "Inline Code" > "Code" to prevent wrapping

* Add horizontal orientation to radio button tests
2025-01-28 18:45:19 -05:00
Lea Verou
88b6fe2fbe Docs on cherry-picking native styles (#619)
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2025-01-28 16:58:53 -05:00
Lea Verou
6a0725cf00 Fix button appearance docs (#603) 2025-01-28 15:46:30 -05:00
Cory LaViska
3ff8745910 Add orientation to radio group (#635)
* add orientation to radio group; fixes #613

* fix timing issue that prevents value from being set sometimes

* gimme a break

* make radio button examples horizontal

---------

Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-28 14:23:39 -05:00
Lindsay M
0cb72adb28 Use 100% width for text field and select labels (#599) 2025-01-27 09:49:35 -05:00
Cory LaViska
3d35f5d4e0 Ensure change events bubble (#601) 2025-01-26 14:10:57 -05:00
Lindsay M
815cc4220b Add breaks between radios in examples (#598) 2025-01-24 17:19:26 -05:00
Lea Verou
a7caf19b34 Tintless variables + OKLCH coords as comments (#596)
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2025-01-24 16:55:21 -05:00
Lindsay M
71c054d6e4 Use background-image for native select caret (#594) 2025-01-24 11:52:06 -05:00
Cory LaViska
e1bf5471bf Use native events when possible (#590)
* fix filename

* <wa-input> input + change (change not working)

* compose that horribly misleading change event

* use native blur/focus events

* update checkbox

* update color picker events

* update color picker events

* update radio group events

* update button events

* remove event options

* update select events

* update image comparer events

* update icon button events

* update slider events

* update rating events

* update radio events

* update switch event

* update textarea events

* update radio button events

* remove unused events

* cleanup

* fix react wrappers

* fix react events for real this time

* update changelog

* add note

* Update src/components/input/input.ts

Co-authored-by: Lea Verou <lea@verou.me>

* delete unused close event

* use same event type

* fix tests

* remove wa- from events in docs and examples

* fix comment

* Update docs/docs/resources/changelog.md

Co-authored-by: Lea Verou <lea@verou.me>

---------

Co-authored-by: Lea Verou <lea@verou.me>
2025-01-23 17:52:41 -05:00
Lea Verou
099edc5186 Implement wide page-level data 2025-01-22 13:25:29 -05:00
Lea Verou
e3560dcf98 Do not reflect default values
- Add `default` descriptor
- Do not reflect attributes when equal to their default value
- Patch getter return value to return default value when empty
- Use it in button `appearance`
2025-01-21 15:16:11 -05:00
Cory LaViska
f2bb2c84a0 fix nested tab groups (#576) 2025-01-21 12:54:38 -05:00
Cory LaViska
13b3342017 fix slot names (#577) 2025-01-21 12:52:41 -05:00
Cory LaViska
d1c1d689ce ensure fix works on backers website (#579) 2025-01-21 12:36:54 -05:00
Cory LaViska
44e5e37a2b 3.0.0-alpha.9 2025-01-17 10:40:54 -05:00
Cory LaViska
566aae927d fix typo 2025-01-17 10:39:18 -05:00
Lea Verou
7258c001a7 Demo for mixing and matching (#565) 2025-01-17 10:38:03 -05:00
Lea Verou
7a70940c6a Update changelog, remove .wa-callout from alpha 2025-01-16 18:27:47 -05:00
Lea Verou
45f4edc426 Fix #561 2025-01-16 16:50:28 -05:00
Lea Verou
da32015f27 Basic mixing and matching docs (#560) 2025-01-16 16:31:24 -05:00
Lea Verou
03d8238edb Add missing :state(blank) docs 2025-01-16 16:17:50 -05:00
Lindsay M
34f8744493 Fix missing mild palette doc and links (#557) 2025-01-16 16:09:52 -05:00
Lindsay M
fa3fe5f753 Theme files housekeeping, closes #519 (#552)
* Reorg Glossy theme

* Reorg Playful theme

* Remove redundant dark mode tokens
2025-01-16 16:09:28 -05:00
Lindsay M
fc6c7de1fd Fix contrast issues with Bright teal (#556) 2025-01-16 16:09:03 -05:00
Lea Verou
0037712549 Matter Ripple MVP (#558)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-16 16:05:50 -05:00
Lea Verou
5301945bfa Filled inputs 2025-01-16 14:48:56 -05:00
Lea Verou
1298651dd8 Floating labels on select 2025-01-16 14:48:56 -05:00
Lea Verou
5f9695fde1 Floating labels on textarea 2025-01-16 14:48:56 -05:00
Lea Verou
2eb2597efe Floating labels for input 2025-01-16 14:48:56 -05:00
lindsaym-fa
431e82261b Initial floating label attempt 2025-01-16 14:48:56 -05:00
Lea Verou
df51149d0a Show contrast ratios in contrast pair tables 2025-01-16 13:18:26 -05:00
Lindsay M
fba0b11343 Add Matter theme (#547)
* Add Matter theme

* Add Matter to alpha build

* Add changelog

* Fix incorrect palette name

* Make loud fills darker in light mode
2025-01-16 12:08:51 -05:00
Lea Verou
3618e93490 Reintroduce --border-width and --border-radius, fixes #531 2025-01-16 10:36:03 -05:00
Lea Verou
cfa95307d1 Quick proof of concept contrast tests 2025-01-16 10:22:01 -05:00
Lea Verou
15344c2a2a Appease Turbo for the color scheme picker too, fixes #520 2025-01-16 10:15:52 -05:00
lindsaym-fa
3974aa5130 Decrease line height on swatches 2025-01-16 10:15:16 -05:00
lindsaym-fa
a6702ad6d2 Revise Color tokens doc and link to palettes 2025-01-16 10:15:16 -05:00
lindsaym-fa
ecf21adddc Fix punctuation 2025-01-16 10:15:16 -05:00
Lea Verou
52c24fc3b7 Add color palette to theme pages 2025-01-16 10:15:16 -05:00
Lea Verou
d464714d7b Rudimentary palette icons 2025-01-16 10:15:16 -05:00
Lea Verou
7d089bbe2f Palette Docs 2025-01-16 10:15:16 -05:00
Lea Verou
71914afc91 defaultPalette -> palette 2025-01-16 10:15:16 -05:00
Lindsay M
9d139e3fa0 Minor style update for checkboxes in wa-tree-item (#542)
* Use theme value line height for tree item checkbox

* Apply theme checkbox styles to selected tree items
2025-01-16 09:30:35 -05:00
Lindsay M
db3039e9fe Fix green-40 in classic color palette (#548) 2025-01-16 09:26:06 -05:00
Lindsay M
9494b9bb67 Improve default tooltip styles (#543)
* Use inverted colors for tooltips

* Remove redundant tooltip overrides from themes
2025-01-16 04:35:08 -05:00
Lea Verou
7e1f4f0351 Separate meaningful theme parts out (#526)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-15 17:32:36 -05:00
Lindsay M
5ebe4f4d3e Finalize playful theme, closes #490 (#527)
* Finalize Playful theme

* Add changelog, add to alpha

* Add playful theme to alpha build

* Touchup and tweaks

* Tweak hover mix color in `wa-dark`

* Avoid transforming buttons in button groups

* Final touchup

---------

Co-authored-by: Lea Verou <lea@verou.me>
2025-01-15 17:13:48 -05:00
Lea Verou
dfb9d53a25 Checkbox improvements
- Added `part="control", fixes #529
- Removed wrapper div which is no longer needed
- Removed `form-control--has-hint` class which is no longer used anywhere
2025-01-15 15:03:58 -05:00
Lindsay M
c2c1a2ff5b Add missing Glossy and Premium themes to alpha build (#528) 2025-01-15 10:45:43 -05:00
Lindsay M
ac86c037a1 Finalize Glossy theme, closes #491 (#525)
* Initial glassy theme progress

* Add fallback to slider thumb box shadow

* Remove redundant `wa-dark` styles and refactor shadows

* Rename to 'Glossy' since it fits the vibe better
2025-01-14 18:44:31 -05:00
Lea Verou
6b07c9a040 Native callout (#513)
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
2025-01-14 14:56:03 -05:00
Lea Verou
24a76f6a7c Color palette housekeeping (#523) 2025-01-14 14:54:34 -05:00
Lea Verou
89c0667e9c Improve maintainability of color docs 2025-01-14 14:44:30 -05:00
Lea Verou
434084ea4e Playful: refer to rudimentary palette 2025-01-14 14:32:39 -05:00
Lea Verou
1738c6345b Fix #514 for reals this time 2025-01-14 13:02:37 -05:00
Lea Verou
0ac7916a1b Attempt to fix #514 2025-01-14 13:02:37 -05:00
Lea Verou
e7979991e3 Update docs to lean into the "tokens" terminology in lieu of "properties"
Co-Authored-By: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
2025-01-14 12:31:24 -05:00
Lea Verou
07f70098f8 Theming -> Design Tokens 2025-01-14 12:31:24 -05:00
Lindsay M
17146698db Finalize Premium theme, closes #489 (#510)
* Finalize Premium theme

* Improve theme compatibility of dark mode shadows

* Improve theme compatibility of code examples

* Add comments

* Revert dark mode shadow color changes (to be addressed separately)

* Revert dark mode shadow color change

* Clean up redundant `wa-dark` properties
2025-01-14 11:56:30 -05:00
Lea Verou
bf852b1296 Fix #515 2025-01-14 11:29:36 -05:00
Lea Verou
e367c0ef29 Open sidebar group on overview pages, fixes #507 2025-01-14 10:20:04 -05:00
Lea Verou
01210ef364 Implement .wa-invert, closes #497 (#508) 2025-01-14 10:04:27 -05:00
Lea Verou
40648e15fb Refactor: library.system.ts to export supported icons (#505) 2025-01-13 16:37:54 -05:00
Cory LaViska
ab67ecfad3 add native icon to search (#498) 2025-01-13 14:48:51 -05:00
329 changed files with 14168 additions and 5818 deletions

View File

@@ -13,3 +13,4 @@ package-lock.json
tsconfig.json
cdn
_site
docs/assets/scripts/prism-downloaded.js

View File

@@ -94,7 +94,7 @@ export default function (eleventyConfig) {
eleventyConfig.addPlugin(highlightCodePlugin());
// Add copy code buttons to code blocks
eleventyConfig.addPlugin(copyCodePlugin());
eleventyConfig.addPlugin(copyCodePlugin);
// Various text replacements
eleventyConfig.addPlugin(

1
docs/_data/hueRanges.js Normal file
View File

@@ -0,0 +1 @@
export { hueRanges as default } from '../assets/scripts/tweak/data.js';

1
docs/_data/hues.json Normal file
View File

@@ -0,0 +1 @@
["red", "orange", "yellow", "green", "cyan", "blue", "indigo", "purple", "pink", "gray"]

1
docs/_data/palettes.js Normal file
View File

@@ -0,0 +1 @@
export { default as default } from '../../src/styles/color/scripts/palettes-analyzed.js';

View File

@@ -5,18 +5,20 @@
<meta name="theme-color" content="#f36944">
<script type="module" src="/assets/scripts/code-examples.js"></script>
<script type="module" src="/assets/scripts/copy-code.js"></script>
<script type="module" src="/assets/scripts/scroll.js"></script>
<script type="module" src="/assets/scripts/turbo.js"></script>
<script type="module" src="/assets/scripts/search.js"></script>
<script type="module" src="/assets/scripts/outline.js"></script>
{% if hasSidebar %}<script type="module" src="/assets/scripts/sidebar-tweaks.js"></script>{% endif %}
<script defer data-domain="backers.webawesome.com" src="https://plausible.io/js/script.js"></script>
{# Docs styles #}
<link rel="stylesheet" href="/assets/styles/docs.css" />
{% block head %}{% endblock %}
</head>
<body class="layout-{{ layout | stripExtension }}">
<body class="layout-{{ layout | stripExtension }}{{ ' page-wide' if wide }}">
<!-- use view="desktop" as default to reduce layout jank on desktop site. -->
<wa-page view="desktop" disable-navigation-toggle="">
<header slot="header" class="wa-split">
@@ -83,8 +85,6 @@
</details>
</nav>
{% block header %}
{% include 'breadcrumbs.njk' %}
<h1 class="title">{{ title }}</h1>

View File

@@ -0,0 +1,52 @@
<table class="colors wa-palette-{{ paletteId }} contrast-table" data-min-contrast="{{ minContrast }}">
<thead>
<tr>
<th></th>
{% for tint_bg in tints -%}
{% for tint_fg in tints | reverse -%}
{% if (tint_fg - tint_bg) | abs == difference %}
<th>{{ tint_fg }} on {{ tint_bg }}</th>
{% endif %}
{%- endfor -%}
{%- endfor %}
</tr>
</thead>
{% for hue in hues -%}
<tr data-hue="{{ hue }}">
<th>{{ hue | capitalize }}</th>
{% for tint_bg in tints -%}
{% set color_bg = palettes[paletteId][hue][tint_bg] %}
{% for tint_fg in tints | reverse -%}
{% set color_fg = palettes[paletteId][hue][tint_fg] %}
{% if (tint_fg - tint_bg) | abs == difference %}
{% set contrast_wcag = '' %}
{% if color_fg and color_bg -%}
{% set contrast_wcag = color_bg.contrast(color_fg, 'WCAG21') %}
{%- endif %}
<td v-for="contrast of [contrasts.{{ hue }}['{{ tint_bg }}']['{{ tint_fg }}']]"
data-tint-bg="{{ tint_bg }}" data-tint-fg="{{ tint_fg }}" data-original-contrast="{{ contrast_wcag }}">
<div v-content:number="contrast.value"
class="color swatch" :class="{
'value-up': contrast.value - contrast.original > 0.0001,
'value-down': contrast.original - contrast.value > 0.0001,
'contrast-fail': contrast.value < {{ minContrast }}
}"
style="--color: var(--wa-color-{{ hue }}-{{ tint_bg }}); color: var(--wa-color-{{ hue }}-{{ tint_fg }})"
:style="{
'--color': contrast.bgColor,
color: contrast.fgColor,
}"
>
{% if contrast_wcag %}
{{ contrast_wcag | number({maximumSignificantDigits: 2}) }}
{% else %}
{{ tint_fg }} on {{ tint_bg }}
{% endif %}
</div>
</td>
{% endif %}
{%- endfor -%}
{%- endfor -%}
</tr>
{%- endfor %}
</table>

View File

@@ -30,19 +30,15 @@
<script type="module" src="/assets/scripts/theme-picker.js"></script>
{# Preset Theme #}
<link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/{{ forceTheme or 'default' }}.css" render="blocking" fetchpriority="high" />
{% if not forceTheme %}
{% if forceTheme %}
<link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/{{ forceTheme }}.css" render="blocking" fetchpriority="high" />
{% else %}
<noscript><link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/default.css" render="blocking" fetchpriority="high" /></noscript>
<script>
if (localStorage.presetTheme) {
let preset = localStorage.presetTheme;
{
let preset = localStorage.presetTheme ?? 'default';
let script = document.currentScript;
let link = script.previousElementSibling;
let newLink = link.cloneNode();
newLink.href = link.href.replace("/default.css", `/${preset}.css`);
newLink.addEventListener('load', () => {
link.remove();
});
link.after(newLink);
script.insertAdjacentHTML('beforebegin', `<link id="theme-stylesheet" rel="stylesheet" id="theme-stylesheet" href="/dist/styles/themes/${ preset }.css" render="blocking" fetchpriority="high" />`);
}
</script>
<script type="module" src="/assets/scripts/preset-theme-picker.js"></script>

View File

@@ -0,0 +1,18 @@
<wa-tab-group class="import-stylesheet-code">
<wa-tab panel="html">In HTML</wa-tab>
<wa-tab panel="css">In CSS</wa-tab>
<wa-tab-panel name="html">
Add the following code to the `<head>` of your page:
```html
<link rel="stylesheet" href="{% cdnUrl stylesheet %}" />
```
</wa-tab-panel>
<wa-tab-panel name="css">
Add the following code at the top of your CSS file:
```css
@import url('{% cdnUrl stylesheet %}');
```
</wa-tab-panel>
</wa-tab-group>

View File

@@ -5,6 +5,9 @@
{% include "svgs/" + (page.data.icon or "thumbnail-placeholder") + ".njk" %}
</div>
<span class="page-name">{{ page.data.title }}</span>
{% if pageSubtitle -%}
<div class="wa-caption-s">{{ pageSubtitle }}</div>
{%- endif %}
</wa-card>
</a>
{% endif %}

View File

@@ -1,8 +1,8 @@
{# Some collections (like "patterns") will not have any items in the alpha build for example. So this checks to make sure the collection exists. #}
{% if collections[tag] -%}
<wa-details {{ (tag in (tags or [])) | attr('open') }}>
{% set groupUrl %}/docs/{{ tag }}/{% endset %}
<wa-details {{ ((tag in (tags or [])) or (groupUrl in page.url)) | attr('open') }}>
<h2 slot="summary">
{% set groupUrl %}/docs/{{ tag }}/{% endset %}
{% if groupUrl | getCollectionItemFromUrl %}
<a href="{{ groupUrl }}" title="Overview">{{ title or (tag | capitalize) }}
<wa-icon name="grid-2"></wa-icon>

View File

@@ -16,6 +16,7 @@
<li><a href="/docs/resources/accessibility">Accessibility</a></li>
<li><a href="/docs/resources/contributing">Contributing</a></li>
<li><a href="/docs/resources/changelog">Changelog</a></li>
<li><a href="/docs/resources/visual-tests">Visual Tests</a></li>
</ul>
{% for tag, title in {
@@ -25,7 +26,8 @@
'utilities': 'Style Utilities',
'layout': 'Layout',
'patterns': 'Patterns',
'theming': 'Theming'
'palettes': 'Color Palettes',
'tokens': 'Design Tokens'
} %}
{% include 'sidebar-group.njk' %}
{% endfor %}

View File

@@ -0,0 +1,31 @@
{% set paletteId = palette.fileSlug or page.fileSlug %}
{% set suffixes = ['-80', '', '-20'] %}
{% set width = 20 %}
{% set height = 12 %}
{% set height_core = 20 %}
{% set gap_x = 4 %}
{% set gap_y = 4 %}
{% set total_width = (width + gap_x) * hues|length %}
{% set total_height = (height + gap_y) * suffixes|length + (height_core - height) %}
<svg viewBox="0 0 {{ total_width }} {{ total_height }}" fill="none" xmlns="http://www.w3.org/2000/svg" class="wa-palette-{{ paletteId }} palette-icon">
<style>
@import url('/dist/styles/color/{{ paletteId }}.css') layer(palette.{{ paletteId }});
.palette-icon {
height: 8ch;
}
</style>
{% for hue in hues -%}
{% set hueIndex = loop.index0 %}
{% set y = 0 %}
{% for suffix in suffixes -%}
{% set swatch_height = height if suffix else height_core %}
<rect x="{{ hueIndex * (width + gap_x) }}" y="{{ y }}"
width="{{ width }}" height="{{ swatch_height }}"
fill="var(--wa-color-{{ hue }}{{ suffix }})" rx="2" />
{% set y = y + swatch_height + gap_y %}
{%- endfor %}
{% endfor %}
</svg>

View File

@@ -0,0 +1,24 @@
{% set themeId = theme.fileSlug %}
<div>
<template shadowrootmode="open">
<link rel="stylesheet" href="/dist/styles/utilities.css">
<link rel="stylesheet" href="/dist/styles/themes/{{ page.fileSlug or 'default' }}.css">
<link rel="stylesheet" href="/dist/styles/themes/{{ themeId }}/color.css">
<link rel="stylesheet" href="/assets/styles/theme-icons.css">
<div class="theme-color-icon wa-theme-{{ themeId }}">
<div class="wa-brand wa-accent">A</div>
<div class="wa-brand wa-outlined">A</div>
<div class="wa-brand wa-filled">A</div>
<div class="wa-brand wa-plain">A</div>
{# <div class="wa-danger wa-outlined wa-filled"><wa-icon slot="icon" name="circle-exclamation" variant="regular"></wa-icon></div> #}
<div class="wa-neutral wa-accent">A</div>
<div class="wa-neutral wa-outlined">A</div>
<div class="wa-neutral wa-filled">A</div>
<div class="wa-neutral wa-plain">A</div>
{# <div class="wa-warning wa-outlined wa-filled"><wa-icon slot="icon" name="triangle-exclamation" variant="regular"></wa-icon></div> #}
</div>
</template>
</div>

View File

@@ -0,0 +1,16 @@
{% set themeId = theme.fileSlug %}
<div>
<template shadowrootmode="open">
<link rel="stylesheet" href="/dist/styles/native/content.css">
<link rel="stylesheet" href="/dist/styles/native/blockquote.css">
<link rel="stylesheet" href="/dist/styles/themes/{{ page.fileSlug or 'default' }}.css">
<link rel="stylesheet" href="/dist/styles/themes/{{ themeId }}/typography.css">
<link rel="stylesheet" href="/assets/styles/theme-icons.css">
<div class="theme-typography-icon wa-theme-{{ themeId }}" data-no-outline data-no-anchor role="presentation">
<h3>Title</h3>
<p>Body text</p>
</div>
</template>
</div>

View File

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 596 B

View File

@@ -2,7 +2,7 @@
<path fill-rule="evenodd" clip-rule="evenodd" d="M48.8665 59.1993L33.7329 33H64C63.8352 38.2705 62.3694 43.4244 59.7264 48C57.0833 52.5756 53.3507 56.4213 48.8665 59.1993Z" fill="var(--wa-color-green-70)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M32 64C26.714 64 21.5155 62.6919 16.8665 60.1993L32 34L47.1336 60.1993C42.4845 62.6919 37.286 64 32 64Z" fill="var(--wa-color-blue-60)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.27365 48C1.63063 43.4244 0.164839 38.2706 0 33L30.2671 33L15.1336 59.1993C10.6493 56.4213 6.91666 52.5756 4.27365 48Z" fill="var(--wa-color-indigo-60)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.27365 16C6.91667 11.4244 10.6493 7.57868 15.1336 4.80072L30.2671 31L0 31C0.16484 25.7295 1.63063 20.5756 4.27365 16Z" fill="var(--wa-color-violet-60)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.27365 16C6.91667 11.4244 10.6493 7.57868 15.1336 4.80072L30.2671 31L0 31C0.16484 25.7295 1.63063 20.5756 4.27365 16Z" fill="var(--wa-color-purple-60)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M32 30L16.8665 3.80072C21.5155 1.30813 26.714 0 32 0C37.286 0 42.4845 1.30813 47.1336 3.80072L32 30Z" fill="var(--wa-color-red-60)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M33.7329 31L48.8665 4.80072C53.3507 7.57868 57.0833 11.4244 59.7264 16C62.3694 20.5756 63.8352 25.7294 64 31L33.7329 31Z" fill="var(--wa-color-yellow-80)"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 502 B

View File

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 790 B

View File

Before

Width:  |  Height:  |  Size: 697 B

After

Width:  |  Height:  |  Size: 697 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -23,7 +23,7 @@
</div>
<wa-divider></wa-divider>
<div class="wa-flank">
<wa-avatar shape="rounded" style="--size: 3em; --background-color: var(--wa-color-teal-60); --text-color: var(--wa-color-teal-95);">
<wa-avatar shape="rounded" style="--size: 3em; --background-color: var(--wa-color-cyan-60); --text-color: var(--wa-color-cyan-95);">
<wa-icon slot="icon" name="robot-astromech" family="duotone" style="font-size: 1.5em;"></wa-icon>
</wa-avatar>
<div class="wa-stack wa-gap-2xs">

View File

@@ -0,0 +1,77 @@
```html {.example}
<style>
div.alignment {
background: linear-gradient(to bottom, lightblue, lightblue 1px, transparent 1px, transparent), linear-gradient(to top, lightblue, lightblue 1px, transparent 1px, transparent);
position: relative;
display: flex;
gap: 1rem;
align-items: center;
}
div.alignment::after {
content: '';
position: absolute;
top: calc(50% - 0.5px);
width: 100%;
height: 1px;
background-color: red;
}
</style>
<div class="wa-stack wa-gap-xl">
<div class="alignment">
<wa-switch size="small">Switch</wa-switch>
<wa-checkbox size="small">Checkbox</wa-checkbox>
<wa-radio value="1" size="small">Radio</wa-radio>
</div>
<div class="alignment">
<wa-switch>Switch</wa-switch>
<wa-checkbox>Checkbox</wa-checkbox>
<wa-radio value="1">Radio</wa-radio>
</div>
<div class="alignment">
<wa-switch size="large">Switch</wa-switch>
<wa-checkbox size="large">Checkbox</wa-checkbox>
<wa-radio value="1" size="large">Radio</wa-radio>
</div>
<div class="alignment">
<wa-textarea placeholder="textarea" size="small" rows="1"></wa-textarea>
<wa-input placeholder="input" size="small"></wa-input>
<wa-select size="small" value="1" multiple>
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-color-picker size="small"></wa-color-picker>
<wa-button size="small">Button</wa-button>
</div>
<div class="alignment">
<wa-textarea placeholder="textarea" size="medium" rows="1"></wa-textarea>
<wa-input placeholder="input" size="medium"></wa-input>
<wa-select size="medium" value="1" multiple>
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-color-picker size="medium"></wa-color-picker>
<wa-button size="medium">Button</wa-button>
</div>
<div class="alignment">
<wa-textarea placeholder="textarea" size="large" rows="1"></wa-textarea>
<wa-input placeholder="input" size="large"></wa-input>
<wa-select size="large" value="1" multiple>
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-color-picker size="large"></wa-color-picker>
<wa-button size="large">Button</wa-button>
</div>
<div class="alignment">
<wa-badge>Badge</wa-badge>
<code>Code</code>
<kbd>Keyboard</kbd>
<ins>Inserted</ins>
<del>Deleted</del>
<mark>Highlighted</mark>
</div>
<div class="alignment">
<wa-avatar></wa-avatar>
<wa-rating></wa-rating>
<wa-icon-button name="gear" label="Settings"></wa-icon-button>
<wa-spinner></wa-spinner>
</div>
</div>
```

View File

@@ -0,0 +1,799 @@
<h3>Badge</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>appearance=""</code></th>
<th><code>.wa-[appearance]</code></th>
</thead>
<tbody>
<tr>
<th><code>accent</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="accent outlined">Brand</wa-badge>
<wa-badge variant="neutral" appearance="accent outlined">Neutral</wa-badge>
<wa-badge variant="success" appearance="accent outlined">Success</wa-badge>
<wa-badge variant="warning" appearance="accent outlined">Warning</wa-badge>
<wa-badge variant="danger" appearance="accent outlined">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-accent wa-outlined">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-accent wa-outlined">Neutral</wa-badge>
<wa-badge variant="success" class="wa-accent wa-outlined">Success</wa-badge>
<wa-badge variant="warning" class="wa-accent wa-outlined">Warning</wa-badge>
<wa-badge variant="danger" class="wa-accent wa-outlined">Danger</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>accent</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="accent">Brand</wa-badge>
<wa-badge variant="neutral" appearance="accent">Neutral</wa-badge>
<wa-badge variant="success" appearance="accent">Success</wa-badge>
<wa-badge variant="warning" appearance="accent">Warning</wa-badge>
<wa-badge variant="danger" appearance="accent">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-accent">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-accent">Neutral</wa-badge>
<wa-badge variant="success" class="wa-accent">Success</wa-badge>
<wa-badge variant="warning" class="wa-accent">Warning</wa-badge>
<wa-badge variant="danger" class="wa-accent">Danger</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>filled</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="filled outlined">Brand</wa-badge>
<wa-badge variant="neutral" appearance="filled outlined">Neutral</wa-badge>
<wa-badge variant="success" appearance="filled outlined">Success</wa-badge>
<wa-badge variant="warning" appearance="filled outlined">Warning</wa-badge>
<wa-badge variant="danger" appearance="filled outlined">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-filled wa-outlined">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-filled wa-outlined">Neutral</wa-badge>
<wa-badge variant="success" class="wa-filled wa-outlined">Success</wa-badge>
<wa-badge variant="warning" class="wa-filled wa-outlined">Warning</wa-badge>
<wa-badge variant="danger" class="wa-filled wa-outlined">Danger</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>filled</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="filled">Brand</wa-badge>
<wa-badge variant="neutral" appearance="filled">Neutral</wa-badge>
<wa-badge variant="success" appearance="filled">Success</wa-badge>
<wa-badge variant="warning" appearance="filled">Warning</wa-badge>
<wa-badge variant="danger" appearance="filled">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-filled">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-filled">Neutral</wa-badge>
<wa-badge variant="success" class="wa-filled">Success</wa-badge>
<wa-badge variant="warning" class="wa-filled">Warning</wa-badge>
<wa-badge variant="danger" class="wa-filled">Danger</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="outlined">Brand</wa-badge>
<wa-badge variant="neutral" appearance="outlined">Neutral</wa-badge>
<wa-badge variant="success" appearance="outlined">Success</wa-badge>
<wa-badge variant="warning" appearance="outlined">Warning</wa-badge>
<wa-badge variant="danger" appearance="outlined">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-outlined">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-outlined">Neutral</wa-badge>
<wa-badge variant="success" class="wa-outlined">Success</wa-badge>
<wa-badge variant="warning" class="wa-outlined">Warning</wa-badge>
<wa-badge variant="danger" class="wa-outlined">Danger</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>plain</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="plain">Brand</wa-badge>
<wa-badge variant="neutral" appearance="plain">Neutral</wa-badge>
<wa-badge variant="success" appearance="plain">Success</wa-badge>
<wa-badge variant="warning" appearance="plain">Warning</wa-badge>
<wa-badge variant="danger" appearance="plain">Danger</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" class="wa-plain">Brand</wa-badge>
<wa-badge variant="neutral" class="wa-plain">Neutral</wa-badge>
<wa-badge variant="success" class="wa-plain">Success</wa-badge>
<wa-badge variant="warning" class="wa-plain">Warning</wa-badge>
<wa-badge variant="danger" class="wa-plain">Danger</wa-badge>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Button</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>appearance=""</code></th>
<th><code>.wa-[appearance]</code></th>
</thead>
<tbody>
<tr>
<th><code>accent</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="accent outlined">Brand</wa-button>
<wa-button variant="neutral" appearance="accent outlined">Neutral</wa-button>
<wa-button variant="success" appearance="accent outlined">Success</wa-button>
<wa-button variant="warning" appearance="accent outlined">Warning</wa-button>
<wa-button variant="danger" appearance="accent outlined">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-accent wa-outlined">Brand</wa-button>
<wa-button variant="neutral" class="wa-accent wa-outlined">Neutral</wa-button>
<wa-button variant="success" class="wa-accent wa-outlined">Success</wa-button>
<wa-button variant="warning" class="wa-accent wa-outlined">Warning</wa-button>
<wa-button variant="danger" class="wa-accent wa-outlined">Danger</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>accent</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="accent">Brand</wa-button>
<wa-button variant="neutral" appearance="accent">Neutral</wa-button>
<wa-button variant="success" appearance="accent">Success</wa-button>
<wa-button variant="warning" appearance="accent">Warning</wa-button>
<wa-button variant="danger" appearance="accent">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-accent">Brand</wa-button>
<wa-button variant="neutral" class="wa-accent">Neutral</wa-button>
<wa-button variant="success" class="wa-accent">Success</wa-button>
<wa-button variant="warning" class="wa-accent">Warning</wa-button>
<wa-button variant="danger" class="wa-accent">Danger</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>filled</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="filled outlined">Brand</wa-button>
<wa-button variant="neutral" appearance="filled outlined">Neutral</wa-button>
<wa-button variant="success" appearance="filled outlined">Success</wa-button>
<wa-button variant="warning" appearance="filled outlined">Warning</wa-button>
<wa-button variant="danger" appearance="filled outlined">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-filled wa-outlined">Brand</wa-button>
<wa-button variant="neutral" class="wa-filled wa-outlined">Neutral</wa-button>
<wa-button variant="success" class="wa-filled wa-outlined">Success</wa-button>
<wa-button variant="warning" class="wa-filled wa-outlined">Warning</wa-button>
<wa-button variant="danger" class="wa-filled wa-outlined">Danger</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>filled</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="filled">Brand</wa-button>
<wa-button variant="neutral" appearance="filled">Neutral</wa-button>
<wa-button variant="success" appearance="filled">Success</wa-button>
<wa-button variant="warning" appearance="filled">Warning</wa-button>
<wa-button variant="danger" appearance="filled">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-filled">Brand</wa-button>
<wa-button variant="neutral" class="wa-filled">Neutral</wa-button>
<wa-button variant="success" class="wa-filled">Success</wa-button>
<wa-button variant="warning" class="wa-filled">Warning</wa-button>
<wa-button variant="danger" class="wa-filled">Danger</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="outlined">Brand</wa-button>
<wa-button variant="neutral" appearance="outlined">Neutral</wa-button>
<wa-button variant="success" appearance="outlined">Success</wa-button>
<wa-button variant="warning" appearance="outlined">Warning</wa-button>
<wa-button variant="danger" appearance="outlined">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-outlined">Brand</wa-button>
<wa-button variant="neutral" class="wa-outlined">Neutral</wa-button>
<wa-button variant="success" class="wa-outlined">Success</wa-button>
<wa-button variant="warning" class="wa-outlined">Warning</wa-button>
<wa-button variant="danger" class="wa-outlined">Danger</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>plain</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="plain">Brand</wa-button>
<wa-button variant="neutral" appearance="plain">Neutral</wa-button>
<wa-button variant="success" appearance="plain">Success</wa-button>
<wa-button variant="warning" appearance="plain">Warning</wa-button>
<wa-button variant="danger" appearance="plain">Danger</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" class="wa-plain">Brand</wa-button>
<wa-button variant="neutral" class="wa-plain">Neutral</wa-button>
<wa-button variant="success" class="wa-plain">Success</wa-button>
<wa-button variant="warning" class="wa-plain">Warning</wa-button>
<wa-button variant="danger" class="wa-plain">Danger</wa-button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Callout</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>appearance=""</code></th>
<th><code>.wa-[appearance]</code></th>
</thead>
<tbody>
<tr>
<th><code>accent</code> + <code>outlined</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="accent outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="accent outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="accent outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="accent outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="accent outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-accent wa-outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-accent wa-outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-accent wa-outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-accent wa-outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-accent wa-outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>accent</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="accent">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="accent">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="accent">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="accent">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="accent">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-accent">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-accent">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-accent">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-accent">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-accent">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>filled</code> + <code>outlined</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="filled outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="filled outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="filled outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="filled outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="filled outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-filled wa-outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-filled wa-outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-filled wa-outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-filled wa-outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-filled wa-outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>filled</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="filled">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="filled">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="filled">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="filled">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="filled">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-filled">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-filled">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-filled">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-filled">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-filled">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>outlined</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>plain</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="plain">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" appearance="plain">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" appearance="plain">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" appearance="plain">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" appearance="plain">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" class="wa-plain">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Brand
</wa-callout>
<wa-callout variant="neutral" class="wa-plain">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Neutral
</wa-callout>
<wa-callout variant="success" class="wa-plain">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Success
</wa-callout>
<wa-callout variant="warning" class="wa-plain">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Warning
</wa-callout>
<wa-callout variant="danger" class="wa-plain">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Danger
</wa-callout>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Tag</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>appearance=""</code></th>
<th><code>.wa-[appearance]</code></th>
</thead>
<tbody>
<tr>
<th><code>accent</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="accent outlined">Brand</wa-tag>
<wa-tag variant="neutral" appearance="accent outlined">Neutral</wa-tag>
<wa-tag variant="success" appearance="accent outlined">Success</wa-tag>
<wa-tag variant="warning" appearance="accent outlined">Warning</wa-tag>
<wa-tag variant="danger" appearance="accent outlined">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-accent wa-outlined">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-accent wa-outlined">Neutral</wa-tag>
<wa-tag variant="success" class="wa-accent wa-outlined">Success</wa-tag>
<wa-tag variant="warning" class="wa-accent wa-outlined">Warning</wa-tag>
<wa-tag variant="danger" class="wa-accent wa-outlined">Danger</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>accent</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="accent">Brand</wa-tag>
<wa-tag variant="neutral" appearance="accent">Neutral</wa-tag>
<wa-tag variant="success" appearance="accent">Success</wa-tag>
<wa-tag variant="warning" appearance="accent">Warning</wa-tag>
<wa-tag variant="danger" appearance="accent">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-accent">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-accent">Neutral</wa-tag>
<wa-tag variant="success" class="wa-accent">Success</wa-tag>
<wa-tag variant="warning" class="wa-accent">Warning</wa-tag>
<wa-tag variant="danger" class="wa-accent">Danger</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>filled</code> + <code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="filled outlined">Brand</wa-tag>
<wa-tag variant="neutral" appearance="filled outlined">Neutral</wa-tag>
<wa-tag variant="success" appearance="filled outlined">Success</wa-tag>
<wa-tag variant="warning" appearance="filled outlined">Warning</wa-tag>
<wa-tag variant="danger" appearance="filled outlined">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-filled wa-outlined">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-filled wa-outlined">Neutral</wa-tag>
<wa-tag variant="success" class="wa-filled wa-outlined">Success</wa-tag>
<wa-tag variant="warning" class="wa-filled wa-outlined">Warning</wa-tag>
<wa-tag variant="danger" class="wa-filled wa-outlined">Danger</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>filled</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="filled">Brand</wa-tag>
<wa-tag variant="neutral" appearance="filled">Neutral</wa-tag>
<wa-tag variant="success" appearance="filled">Success</wa-tag>
<wa-tag variant="warning" appearance="filled">Warning</wa-tag>
<wa-tag variant="danger" appearance="filled">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-filled">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-filled">Neutral</wa-tag>
<wa-tag variant="success" class="wa-filled">Success</wa-tag>
<wa-tag variant="warning" class="wa-filled">Warning</wa-tag>
<wa-tag variant="danger" class="wa-filled">Danger</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>outlined</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="outlined">Brand</wa-tag>
<wa-tag variant="neutral" appearance="outlined">Neutral</wa-tag>
<wa-tag variant="success" appearance="outlined">Success</wa-tag>
<wa-tag variant="warning" appearance="outlined">Warning</wa-tag>
<wa-tag variant="danger" appearance="outlined">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-outlined">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-outlined">Neutral</wa-tag>
<wa-tag variant="success" class="wa-outlined">Success</wa-tag>
<wa-tag variant="warning" class="wa-outlined">Warning</wa-tag>
<wa-tag variant="danger" class="wa-outlined">Danger</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>plain</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="plain">Brand</wa-tag>
<wa-tag variant="neutral" appearance="plain">Neutral</wa-tag>
<wa-tag variant="success" appearance="plain">Success</wa-tag>
<wa-tag variant="warning" appearance="plain">Warning</wa-tag>
<wa-tag variant="danger" appearance="plain">Danger</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" class="wa-plain">Brand</wa-tag>
<wa-tag variant="neutral" class="wa-plain">Neutral</wa-tag>
<wa-tag variant="success" class="wa-plain">Success</wa-tag>
<wa-tag variant="warning" class="wa-plain">Warning</wa-tag>
<wa-tag variant="danger" class="wa-plain">Danger</wa-tag>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Form Controls</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>appearance=""</code></th>
<th><code>.wa-[appearance]</code></th>
</thead>
<tbody>
<tr>
<th><code>outlined</code></th>
<td>
<div class="wa-stack">
<wa-input appearance="outlined" placeholder="Input"></wa-input>
<wa-select appearance="outlined" placeholder="Select">
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-textarea appearance="outlined" placeholder="Textarea"></wa-textarea>
</div>
</td>
<td>
<div class="wa-stack">
<wa-input class="wa-outlined" placeholder="Input"></wa-input>
<wa-select class="wa-outlined" placeholder="Select">
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-textarea class="wa-outlined" placeholder="Textarea"></wa-textarea>
</div>
</td>
</tr>
<tr>
<th><code>filled</code></th>
<td>
<div class="wa-stack">
<wa-input appearance="filled" placeholder="Input"></wa-input>
<wa-select appearance="filled" placeholder="Select">
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-textarea appearance="filled" placeholder="Textarea"></wa-textarea>
</div>
</td>
<td>
<div class="wa-stack">
<wa-input class="wa-filled" placeholder="Input"></wa-input>
<wa-select class="wa-filled" placeholder="Select">
<wa-option value="1">Option</wa-option>
</wa-select>
<wa-textarea class="wa-filled" placeholder="Textarea"></wa-textarea>
</div>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,698 @@
<h3>Badge</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>variant=""</code></th>
<th><code>.wa-[variant]</code></th>
</thead>
<tbody>
<tr>
<th><code>brand</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="brand" appearance="accent outlined">A+O</wa-badge>
<wa-badge variant="brand" appearance="accent">Accent</wa-badge>
<wa-badge variant="brand" appearance="filled outlined">F+O</wa-badge>
<wa-badge variant="brand" appearance="filled">Filled</wa-badge>
<wa-badge variant="brand" appearance="outlined">Outlined</wa-badge>
<wa-badge variant="brand" appearance="plain">Plain</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge class="wa-brand" appearance="accent outlined">A+O</wa-badge>
<wa-badge class="wa-brand" appearance="accent">Accent</wa-badge>
<wa-badge class="wa-brand" appearance="filled outlined">F+O</wa-badge>
<wa-badge class="wa-brand" appearance="filled">Filled</wa-badge>
<wa-badge class="wa-brand" appearance="outlined">Outlined</wa-badge>
<wa-badge class="wa-brand" appearance="plain">Plain</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>neutral</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="neutral" appearance="accent outlined">A+O</wa-badge>
<wa-badge variant="neutral" appearance="accent">Accent</wa-badge>
<wa-badge variant="neutral" appearance="filled outlined">F+O</wa-badge>
<wa-badge variant="neutral" appearance="filled">Filled</wa-badge>
<wa-badge variant="neutral" appearance="outlined">Outlined</wa-badge>
<wa-badge variant="neutral" appearance="plain">Plain</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge class="wa-neutral" appearance="accent outlined">A+O</wa-badge>
<wa-badge class="wa-neutral" appearance="accent">Accent</wa-badge>
<wa-badge class="wa-neutral" appearance="filled outlined">F+O</wa-badge>
<wa-badge class="wa-neutral" appearance="filled">Filled</wa-badge>
<wa-badge class="wa-neutral" appearance="outlined">Outlined</wa-badge>
<wa-badge class="wa-neutral" appearance="plain">Plain</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>success</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="success" appearance="accent outlined">A+O</wa-badge>
<wa-badge variant="success" appearance="accent">Accent</wa-badge>
<wa-badge variant="success" appearance="filled outlined">F+O</wa-badge>
<wa-badge variant="success" appearance="filled">Filled</wa-badge>
<wa-badge variant="success" appearance="outlined">Outlined</wa-badge>
<wa-badge variant="success" appearance="plain">Plain</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge class="wa-success" appearance="accent outlined">A+O</wa-badge>
<wa-badge class="wa-success" appearance="accent">Accent</wa-badge>
<wa-badge class="wa-success" appearance="filled outlined">F+O</wa-badge>
<wa-badge class="wa-success" appearance="filled">Filled</wa-badge>
<wa-badge class="wa-success" appearance="outlined">Outlined</wa-badge>
<wa-badge class="wa-success" appearance="plain">Plain</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>warning</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="warning" appearance="accent outlined">A+O</wa-badge>
<wa-badge variant="warning" appearance="accent">Accent</wa-badge>
<wa-badge variant="warning" appearance="filled outlined">F+O</wa-badge>
<wa-badge variant="warning" appearance="filled">Filled</wa-badge>
<wa-badge variant="warning" appearance="outlined">Outlined</wa-badge>
<wa-badge variant="warning" appearance="plain">Plain</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge class="wa-warning" appearance="accent outlined">A+O</wa-badge>
<wa-badge class="wa-warning" appearance="accent">Accent</wa-badge>
<wa-badge class="wa-warning" appearance="filled outlined">F+O</wa-badge>
<wa-badge class="wa-warning" appearance="filled">Filled</wa-badge>
<wa-badge class="wa-warning" appearance="outlined">Outlined</wa-badge>
<wa-badge class="wa-warning" appearance="plain">Plain</wa-badge>
</div>
</td>
</tr>
<tr>
<th><code>danger</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge variant="danger" appearance="accent outlined">A+O</wa-badge>
<wa-badge variant="danger" appearance="accent">Accent</wa-badge>
<wa-badge variant="danger" appearance="filled outlined">F+O</wa-badge>
<wa-badge variant="danger" appearance="filled">Filled</wa-badge>
<wa-badge variant="danger" appearance="outlined">Outlined</wa-badge>
<wa-badge variant="danger" appearance="plain">Plain</wa-badge>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-badge class="wa-danger" appearance="accent outlined">A+O</wa-badge>
<wa-badge class="wa-danger" appearance="accent">Accent</wa-badge>
<wa-badge class="wa-danger" appearance="filled outlined">F+O</wa-badge>
<wa-badge class="wa-danger" appearance="filled">Filled</wa-badge>
<wa-badge class="wa-danger" appearance="outlined">Outlined</wa-badge>
<wa-badge class="wa-danger" appearance="plain">Plain</wa-badge>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Button</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>variant=""</code></th>
<th><code>.wa-[variant]</code></th>
</thead>
<tbody>
<tr>
<th><code>brand</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="brand" appearance="accent outlined">A+O</wa-button>
<wa-button variant="brand" appearance="accent">Accent</wa-button>
<wa-button variant="brand" appearance="filled outlined">F+O</wa-button>
<wa-button variant="brand" appearance="filled">Filled</wa-button>
<wa-button variant="brand" appearance="outlined">Outlined</wa-button>
<wa-button variant="brand" appearance="plain">Plain</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button class="wa-brand" appearance="accent outlined">A+O</wa-button>
<wa-button class="wa-brand" appearance="accent">Accent</wa-button>
<wa-button class="wa-brand" appearance="filled outlined">F+O</wa-button>
<wa-button class="wa-brand" appearance="filled">Filled</wa-button>
<wa-button class="wa-brand" appearance="outlined">Outlined</wa-button>
<wa-button class="wa-brand" appearance="plain">Plain</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>neutral</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="neutral" appearance="accent outlined">A+O</wa-button>
<wa-button variant="neutral" appearance="accent">Accent</wa-button>
<wa-button variant="neutral" appearance="filled outlined">F+O</wa-button>
<wa-button variant="neutral" appearance="filled">Filled</wa-button>
<wa-button variant="neutral" appearance="outlined">Outlined</wa-button>
<wa-button variant="neutral" appearance="plain">Plain</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button class="wa-neutral" appearance="accent outlined">A+O</wa-button>
<wa-button class="wa-neutral" appearance="accent">Accent</wa-button>
<wa-button class="wa-neutral" appearance="filled outlined">F+O</wa-button>
<wa-button class="wa-neutral" appearance="filled">Filled</wa-button>
<wa-button class="wa-neutral" appearance="outlined">Outlined</wa-button>
<wa-button class="wa-neutral" appearance="plain">Plain</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>success</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="success" appearance="accent outlined">A+O</wa-button>
<wa-button variant="success" appearance="accent">Accent</wa-button>
<wa-button variant="success" appearance="filled outlined">F+O</wa-button>
<wa-button variant="success" appearance="filled">Filled</wa-button>
<wa-button variant="success" appearance="outlined">Outlined</wa-button>
<wa-button variant="success" appearance="plain">Plain</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button class="wa-success" appearance="accent outlined">A+O</wa-button>
<wa-button class="wa-success" appearance="accent">Accent</wa-button>
<wa-button class="wa-success" appearance="filled outlined">F+O</wa-button>
<wa-button class="wa-success" appearance="filled">Filled</wa-button>
<wa-button class="wa-success" appearance="outlined">Outlined</wa-button>
<wa-button class="wa-success" appearance="plain">Plain</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>warning</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="warning" appearance="accent outlined">A+O</wa-button>
<wa-button variant="warning" appearance="accent">Accent</wa-button>
<wa-button variant="warning" appearance="filled outlined">F+O</wa-button>
<wa-button variant="warning" appearance="filled">Filled</wa-button>
<wa-button variant="warning" appearance="outlined">Outlined</wa-button>
<wa-button variant="warning" appearance="plain">Plain</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button class="wa-warning" appearance="accent outlined">A+O</wa-button>
<wa-button class="wa-warning" appearance="accent">Accent</wa-button>
<wa-button class="wa-warning" appearance="filled outlined">F+O</wa-button>
<wa-button class="wa-warning" appearance="filled">Filled</wa-button>
<wa-button class="wa-warning" appearance="outlined">Outlined</wa-button>
<wa-button class="wa-warning" appearance="plain">Plain</wa-button>
</div>
</td>
</tr>
<tr>
<th><code>danger</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button variant="danger" appearance="accent outlined">A+O</wa-button>
<wa-button variant="danger" appearance="accent">Accent</wa-button>
<wa-button variant="danger" appearance="filled outlined">F+O</wa-button>
<wa-button variant="danger" appearance="filled">Filled</wa-button>
<wa-button variant="danger" appearance="outlined">Outlined</wa-button>
<wa-button variant="danger" appearance="plain">Plain</wa-button>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-button class="wa-danger" appearance="accent outlined">A+O</wa-button>
<wa-button class="wa-danger" appearance="accent">Accent</wa-button>
<wa-button class="wa-danger" appearance="filled outlined">F+O</wa-button>
<wa-button class="wa-danger" appearance="filled">Filled</wa-button>
<wa-button class="wa-danger" appearance="outlined">Outlined</wa-button>
<wa-button class="wa-danger" appearance="plain">Plain</wa-button>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Callout</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>variant=""</code></th>
<th><code>.wa-[variant]</code></th>
</thead>
<tbody>
<tr>
<th><code>brand</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="brand" appearance="accent outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
A+O
</wa-callout>
<wa-callout variant="brand" appearance="accent">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Accent
</wa-callout>
<wa-callout variant="brand" appearance="filled outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
F+O
</wa-callout>
<wa-callout variant="brand" appearance="filled">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Filled
</wa-callout>
<wa-callout variant="brand" appearance="outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Outlined
</wa-callout>
<wa-callout variant="brand" appearance="plain">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Plain
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout class="wa-brand" appearance="accent outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
A+O
</wa-callout>
<wa-callout class="wa-brand" appearance="accent">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Accent
</wa-callout>
<wa-callout class="wa-brand" appearance="filled outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
F+O
</wa-callout>
<wa-callout class="wa-brand" appearance="filled">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Filled
</wa-callout>
<wa-callout class="wa-brand" appearance="outlined">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Outlined
</wa-callout>
<wa-callout class="wa-brand" appearance="plain">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Plain
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>neutral</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="neutral" appearance="accent outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
A+O
</wa-callout>
<wa-callout variant="neutral" appearance="accent">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Accent
</wa-callout>
<wa-callout variant="neutral" appearance="filled outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
F+O
</wa-callout>
<wa-callout variant="neutral" appearance="filled">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Filled
</wa-callout>
<wa-callout variant="neutral" appearance="outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Outlined
</wa-callout>
<wa-callout variant="neutral" appearance="plain">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Plain
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout class="wa-neutral" appearance="accent outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
A+O
</wa-callout>
<wa-callout class="wa-neutral" appearance="accent">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Accent
</wa-callout>
<wa-callout class="wa-neutral" appearance="filled outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
F+O
</wa-callout>
<wa-callout class="wa-neutral" appearance="filled">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Filled
</wa-callout>
<wa-callout class="wa-neutral" appearance="outlined">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Outlined
</wa-callout>
<wa-callout class="wa-neutral" appearance="plain">
<wa-icon slot="icon" name="circle-info"></wa-icon>
Plain
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>success</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="success" appearance="accent outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
A+O
</wa-callout>
<wa-callout variant="success" appearance="accent">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Accent
</wa-callout>
<wa-callout variant="success" appearance="filled outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
F+O
</wa-callout>
<wa-callout variant="success" appearance="filled">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Filled
</wa-callout>
<wa-callout variant="success" appearance="outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Outlined
</wa-callout>
<wa-callout variant="success" appearance="plain">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Plain
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout class="wa-success" appearance="accent outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
A+O
</wa-callout>
<wa-callout class="wa-success" appearance="accent">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Accent
</wa-callout>
<wa-callout class="wa-success" appearance="filled outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
F+O
</wa-callout>
<wa-callout class="wa-success" appearance="filled">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Filled
</wa-callout>
<wa-callout class="wa-success" appearance="outlined">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Outlined
</wa-callout>
<wa-callout class="wa-success" appearance="plain">
<wa-icon slot="icon" name="circle-check"></wa-icon>
Plain
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>warning</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="warning" appearance="accent outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
A+O
</wa-callout>
<wa-callout variant="warning" appearance="accent">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Accent
</wa-callout>
<wa-callout variant="warning" appearance="filled outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
F+O
</wa-callout>
<wa-callout variant="warning" appearance="filled">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Filled
</wa-callout>
<wa-callout variant="warning" appearance="outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Outlined
</wa-callout>
<wa-callout variant="warning" appearance="plain">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Plain
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout class="wa-warning" appearance="accent outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
A+O
</wa-callout>
<wa-callout class="wa-warning" appearance="accent">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Accent
</wa-callout>
<wa-callout class="wa-warning" appearance="filled outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
F+O
</wa-callout>
<wa-callout class="wa-warning" appearance="filled">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Filled
</wa-callout>
<wa-callout class="wa-warning" appearance="outlined">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Outlined
</wa-callout>
<wa-callout class="wa-warning" appearance="plain">
<wa-icon slot="icon" name="circle-exclamation"></wa-icon>
Plain
</wa-callout>
</div>
</td>
</tr>
<tr>
<th><code>danger</code></th>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout variant="danger" appearance="accent outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
A+O
</wa-callout>
<wa-callout variant="danger" appearance="accent">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Accent
</wa-callout>
<wa-callout variant="danger" appearance="filled outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
F+O
</wa-callout>
<wa-callout variant="danger" appearance="filled">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Filled
</wa-callout>
<wa-callout variant="danger" appearance="outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Outlined
</wa-callout>
<wa-callout variant="danger" appearance="plain">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Plain
</wa-callout>
</div>
</td>
<td>
<div class="wa-grid wa-gap-2xs">
<wa-callout class="wa-danger" appearance="accent outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
A+O
</wa-callout>
<wa-callout class="wa-danger" appearance="accent">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Accent
</wa-callout>
<wa-callout class="wa-danger" appearance="filled outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
F+O
</wa-callout>
<wa-callout class="wa-danger" appearance="filled">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Filled
</wa-callout>
<wa-callout class="wa-danger" appearance="outlined">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Outlined
</wa-callout>
<wa-callout class="wa-danger" appearance="plain">
<wa-icon slot="icon" name="circle-xmark"></wa-icon>
Plain
</wa-callout>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Tag</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>variant=""</code></th>
<th><code>.wa-[variant]</code></th>
</thead>
<tbody>
<tr>
<th><code>brand</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="brand" appearance="accent outlined">A+O</wa-tag>
<wa-tag variant="brand" appearance="accent">Accent</wa-tag>
<wa-tag variant="brand" appearance="filled outlined">F+O</wa-tag>
<wa-tag variant="brand" appearance="filled">Filled</wa-tag>
<wa-tag variant="brand" appearance="outlined">Outlined</wa-tag>
<wa-tag variant="brand" appearance="plain">Plain</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag class="wa-brand" appearance="accent outlined">A+O</wa-tag>
<wa-tag class="wa-brand" appearance="accent">Accent</wa-tag>
<wa-tag class="wa-brand" appearance="filled outlined">F+O</wa-tag>
<wa-tag class="wa-brand" appearance="filled">Filled</wa-tag>
<wa-tag class="wa-brand" appearance="outlined">Outlined</wa-tag>
<wa-tag class="wa-brand" appearance="plain">Plain</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>neutral</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="neutral" appearance="accent outlined">A+O</wa-tag>
<wa-tag variant="neutral" appearance="accent">Accent</wa-tag>
<wa-tag variant="neutral" appearance="filled outlined">F+O</wa-tag>
<wa-tag variant="neutral" appearance="filled">Filled</wa-tag>
<wa-tag variant="neutral" appearance="outlined">Outlined</wa-tag>
<wa-tag variant="neutral" appearance="plain">Plain</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag class="wa-neutral" appearance="accent outlined">A+O</wa-tag>
<wa-tag class="wa-neutral" appearance="accent">Accent</wa-tag>
<wa-tag class="wa-neutral" appearance="filled outlined">F+O</wa-tag>
<wa-tag class="wa-neutral" appearance="filled">Filled</wa-tag>
<wa-tag class="wa-neutral" appearance="outlined">Outlined</wa-tag>
<wa-tag class="wa-neutral" appearance="plain">Plain</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>success</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="success" appearance="accent outlined">A+O</wa-tag>
<wa-tag variant="success" appearance="accent">Accent</wa-tag>
<wa-tag variant="success" appearance="filled outlined">F+O</wa-tag>
<wa-tag variant="success" appearance="filled">Filled</wa-tag>
<wa-tag variant="success" appearance="outlined">Outlined</wa-tag>
<wa-tag variant="success" appearance="plain">Plain</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag class="wa-success" appearance="accent outlined">A+O</wa-tag>
<wa-tag class="wa-success" appearance="accent">Accent</wa-tag>
<wa-tag class="wa-success" appearance="filled outlined">F+O</wa-tag>
<wa-tag class="wa-success" appearance="filled">Filled</wa-tag>
<wa-tag class="wa-success" appearance="outlined">Outlined</wa-tag>
<wa-tag class="wa-success" appearance="plain">Plain</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>warning</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="warning" appearance="accent outlined">A+O</wa-tag>
<wa-tag variant="warning" appearance="accent">Accent</wa-tag>
<wa-tag variant="warning" appearance="filled outlined">F+O</wa-tag>
<wa-tag variant="warning" appearance="filled">Filled</wa-tag>
<wa-tag variant="warning" appearance="outlined">Outlined</wa-tag>
<wa-tag variant="warning" appearance="plain">Plain</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag class="wa-warning" appearance="accent outlined">A+O</wa-tag>
<wa-tag class="wa-warning" appearance="accent">Accent</wa-tag>
<wa-tag class="wa-warning" appearance="filled outlined">F+O</wa-tag>
<wa-tag class="wa-warning" appearance="filled">Filled</wa-tag>
<wa-tag class="wa-warning" appearance="outlined">Outlined</wa-tag>
<wa-tag class="wa-warning" appearance="plain">Plain</wa-tag>
</div>
</td>
</tr>
<tr>
<th><code>danger</code></th>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag variant="danger" appearance="accent outlined">A+O</wa-tag>
<wa-tag variant="danger" appearance="accent">Accent</wa-tag>
<wa-tag variant="danger" appearance="filled outlined">F+O</wa-tag>
<wa-tag variant="danger" appearance="filled">Filled</wa-tag>
<wa-tag variant="danger" appearance="outlined">Outlined</wa-tag>
<wa-tag variant="danger" appearance="plain">Plain</wa-tag>
</div>
</td>
<td>
<div class="wa-cluster wa-gap-2xs">
<wa-tag class="wa-danger" appearance="accent outlined">A+O</wa-tag>
<wa-tag class="wa-danger" appearance="accent">Accent</wa-tag>
<wa-tag class="wa-danger" appearance="filled outlined">F+O</wa-tag>
<wa-tag class="wa-danger" appearance="filled">Filled</wa-tag>
<wa-tag class="wa-danger" appearance="outlined">Outlined</wa-tag>
<wa-tag class="wa-danger" appearance="plain">Plain</wa-tag>
</div>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,32 @@
<h3>Form Controls</h3>
```html {.example}
<form class="wa-stack">
<wa-input label="Input" placeholder="Placeholder"></wa-input>
<wa-select label="Select" value="option-1">
<wa-option value="option-1">Option 1</wa-option>
<wa-option value="option-2">Option 2</wa-option>
<wa-option value="option-3">Option 3</wa-option>
</wa-select>
<wa-textarea label="Textarea" placeholder="Placeholder"></wa-textarea>
<wa-radio-group label="Radio group" name="a" value="1">
<wa-radio value="1">Option 1</wa-radio>
<wa-radio value="2">Option 2</wa-radio>
<wa-radio value="3">Option 3</wa-radio>
</wa-radio-group>
<wa-checkbox>Checkbox</wa-checkbox>
<wa-switch>Switch</wa-switch>
<wa-slider label="Range"></wa-slider>
<wa-button>Button</wa-button>
</form>
```
<h3>Progress</h3>
```html {.example}
<div class="wa-stack">
<wa-progress-bar value="50" max="100"></wa-progress-bar>
<wa-progress-ring value="50" max="100"></wa-progress-ring>
<wa-spinner></wa-spinner>
</div>
```

View File

@@ -0,0 +1,745 @@
<h3>Button</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-button&gt;</code></th>
<th><code>&lt;button&gt;</code></th>
<th><code>.wa-button</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-button>Button</wa-button>
</td>
<td>
<button>Button</button>
</td>
<td>
<div class="wa-button">Button</div>
</td>
</tr>
<tr>
<th><code>.wa-brand</code></th>
<td>
<wa-button class="wa-brand">Brand</wa-button>
</td>
<td>
<button class="wa-brand">Brand</button>
</td>
<td>
<div class="wa-button wa-brand">Brand</div>
</td>
</tr>
<tr>
<th><code>.wa-neutral</code></th>
<td>
<wa-button class="wa-neutral">Neutral</wa-button>
</td>
<td>
<button class="wa-neutral">Neutral</button>
</td>
<td>
<div class="wa-button wa-neutral">Neutral</div>
</td>
</tr>
<tr>
<th><code>.wa-success</code></th>
<td>
<wa-button class="wa-success">Success</wa-button>
</td>
<td>
<button class="wa-success">Success</button>
</td>
<td>
<div class="wa-button wa-success">Success</div>
</td>
</tr>
<tr>
<th><code>.wa-warning</code></th>
<td>
<wa-button class="wa-warning">Warning</wa-button>
</td>
<td>
<button class="wa-warning">Warning</button>
</td>
<td>
<div class="wa-button wa-warning">Warning</div>
</td>
</tr>
<tr>
<th><code>.wa-danger</code></th>
<td>
<wa-button class="wa-danger">Danger</wa-button>
</td>
<td>
<button class="wa-danger">Danger</button>
</td>
<td>
<div class="wa-button wa-danger">Danger</div>
</td>
</tr>
<tr>
<th><code>.wa-accent</code></th>
<td>
<wa-button class="wa-accent">Accent</wa-button>
</td>
<td>
<button class="wa-accent">Accent</button>
</td>
<td>
<div class="wa-button wa-accent">Accent</div>
</td>
</tr>
<tr>
<th><code>.wa-filled</code></th>
<td>
<wa-button class="wa-filled">Filled</wa-button>
</td>
<td>
<button class="wa-filled">Filled</button>
</td>
<td>
<div class="wa-button wa-filled">Filled</div>
</td>
</tr>
<tr>
<th><code>.wa-outlined</code></th>
<td>
<wa-button class="wa-outlined">Outlined</wa-button>
</td>
<td>
<button class="wa-outlined">Outlined</button>
</td>
<td>
<div class="wa-button wa-outlined">Outlined</div>
</td>
</tr>
<tr>
<th><code>.wa-plain</code></th>
<td>
<wa-button class="wa-plain">Plain</wa-button>
</td>
<td>
<button class="wa-plain">Plain</button>
</td>
<td>
<div class="wa-button wa-plain">Plain</div>
</td>
</tr>
<tr>
<th><code>.wa-size-s</code></th>
<td>
<wa-button class="wa-size-s">Small</wa-button>
</td>
<td>
<button class="wa-size-s">Small</button>
</td>
<td>
<div class="wa-button wa-size-s">Small</div>
</td>
</tr>
<tr>
<th><code>.wa-size-m</code></th>
<td>
<wa-button class="wa-size-m">Medium</wa-button>
</td>
<td>
<button class="wa-size-m">Medium</button>
</td>
<td>
<div class="wa-button wa-size-m">Medium</div>
</td>
</tr>
<tr>
<th><code>.wa-size-l</code></th>
<td>
<wa-button class="wa-size-l">Large</wa-button>
</td>
<td>
<button class="wa-size-l">Large</button>
</td>
<td>
<div class="wa-button wa-size-l">Large</div>
</td>
</tr>
<tr>
<th><code>.wa-pill</code></th>
<td>
<wa-button class="wa-pill">Pill</wa-button>
</td>
<td>
<button class="wa-pill">Pill</button>
</td>
<td>
<div class="wa-button wa-pill">Pill</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Callout</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-callout&gt;</code></th>
<th><code>.wa-callout</code></th>
</thead>
<tbody>
<tr>
<th class="test-failure"><em>default</em></th>
<td>
<wa-callout>Callout</wa-callout>
</td>
<td>
<div class="wa-callout">Callout</div>
</td>
</tr>
<tr>
<th><code>.wa-brand</code></th>
<td>
<wa-callout class="wa-brand">Brand</wa-callout>
</td>
<td>
<div class="wa-callout wa-brand">Brand</div>
</td>
</tr>
<tr>
<th><code>.wa-neutral</code></th>
<td>
<wa-callout class="wa-neutral">Neutral</wa-callout>
</td>
<td>
<div class="wa-callout wa-neutral">Neutral</div>
</td>
</tr>
<tr>
<th><code>.wa-success</code></th>
<td>
<wa-callout class="wa-success">Success</wa-callout>
</td>
<td>
<div class="wa-callout wa-success">Success</div>
</td>
</tr>
<tr>
<th><code>.wa-warning</code></th>
<td>
<wa-callout class="wa-warning">Warning</wa-callout>
</td>
<td>
<div class="wa-callout wa-warning">Warning</div>
</td>
</tr>
<tr>
<th><code>.wa-danger</code></th>
<td>
<wa-callout class="wa-danger">Danger</wa-callout>
</td>
<td>
<div class="wa-callout wa-danger">Danger</div>
</td>
</tr>
<tr>
<th><code>.wa-accent</code></th>
<td>
<wa-callout class="wa-accent">Accent</wa-callout>
</td>
<td>
<div class="wa-callout wa-accent">Accent</div>
</td>
</tr>
<tr>
<th><code>.wa-filled</code></th>
<td>
<wa-callout class="wa-filled">Filled</wa-callout>
</td>
<td>
<div class="wa-callout wa-filled">Filled</div>
</td>
</tr>
<tr>
<th><code>.wa-outlined</code></th>
<td>
<wa-callout class="wa-outlined">Outlined</wa-callout>
</td>
<td>
<div class="wa-callout wa-outlined">Outlined</div>
</td>
</tr>
<tr>
<th><code>.wa-plain</code></th>
<td>
<wa-callout class="wa-plain">Plain</wa-callout>
</td>
<td>
<div class="wa-callout wa-plain">Plain</div>
</td>
</tr>
<tr>
<th><code>.wa-size-s</code></th>
<td>
<wa-callout class="wa-size-s">Small</wa-callout>
</td>
<td>
<div class="wa-callout wa-size-s">Small</div>
</td>
</tr>
<tr>
<th><code>.wa-size-m</code></th>
<td>
<wa-callout class="wa-size-m">Medium</wa-callout>
</td>
<td>
<div class="wa-callout wa-size-m">Medium</div>
</td>
</tr>
<tr>
<th><code>.wa-size-l</code></th>
<td>
<wa-callout class="wa-size-l">Large</wa-callout>
</td>
<td>
<div class="wa-callout wa-size-l">Large</div>
</td>
</tr>
<tr>
<th><code>.wa-pill</code></th>
<td>
<wa-callout class="wa-pill">Pill</wa-callout>
</td>
<td>
<div class="wa-callout wa-pill">Pill</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Checkbox</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-checkbox&gt;</code></th>
<th><code>&lt;input type="checkbox"&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-checkbox>Checkbox</wa-checkbox>
</td>
<td>
<label><input type="checkbox"></input> Checkbox</label>
</td>
</tr>
<tr>
<th><code>checked</code></th>
<td>
<wa-checkbox checked>Checkbox</wa-checkbox>
</td>
<td>
<label><input type="checkbox" checked></input> Checkbox</label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Color Picker</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-color-picker&gt;</code></th>
<th><code>&lt;input type="color"&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-color-picker label="Color Picker" value="#ffa07a"></wa-color-picker>
</td>
<td>
<label>Color Picker <input type="color" value="#ffa07a"></input></label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Details</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-details&gt;</code></th>
<th><code>&lt;details&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-details summary="Summary">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</wa-details>
</td>
<td>
<details>
<summary>Summary</summary>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</details>
</td>
</tr>
<tr>
<th><code>dir="rtl"</code></th>
<td>
<wa-details summary="تبديلني" lang="ar" dir="rtl">
استخدام طريقة لوريم إيبسوم لأنها تعطي توزيعاَ طبيعياَ -إلى حد ما- للأحرف عوضاً عن
</wa-details>
</td>
<td>
<details lang="ar" dir="rtl">
<summary>تبديلني</summary>
<p>استخدام طريقة لوريم إيبسوم لأنها تعطي توزيعاَ طبيعياَ -إلى حد ما- للأحرف عوضاً عن</p>
</details>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3 class="test-failure">Input</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-input&gt;</code></th>
<th><code>&lt;input&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-input label="Input" placeholder="Placeholder"></wa-input>
</td>
<td>
<label>Input <input type="text" placeholder="Placeholder"></input></label>
</td>
</tr>
<tr>
<th><code>type="password"</code></th>
<td>
<wa-input label="Input (password)" type="password"></wa-input>
</td>
<td>
<label>Input (password) <input type="password"></input></label>
</td>
</tr>
<tr>
<th><code>type="date"</code></th>
<td>
<wa-input label="Input (date)" type="date"></wa-input>
</td>
<td>
<label>Input (date) <input type="date"></input></label>
</td>
</tr>
<tr>
<th><code>type="time"</code></th>
<td>
<wa-input label="Input (time)" type="time"></wa-input>
</td>
<td>
<label>Input (time) <input type="time"></input></label>
</td>
</tr>
<tr>
<th><code>.wa-filled</code></th>
<td>
<wa-input label="Input (filled)" placeholder="Placeholder" class="wa-filled"></wa-input>
</td>
<td>
<label>Input (filled) <input type="text" placeholder="Placeholder" class="wa-filled"></input></label>
</td>
</tr>
<tr>
<th><code>.wa-size-s</code></th>
<td>
<wa-input label="Input (small)" placeholder="Placeholder" class="wa-size-s"></wa-input>
</td>
<td>
<label class="wa-size-s">Input (small) <input type="text" placeholder="Placeholder"></input></label>
</td>
</tr>
<tr>
<th><code>.wa-size-m</code></th>
<td>
<wa-input label="Input (medium)" placeholder="Placeholder" class="wa-size-m"></wa-input>
</td>
<td>
<label class="wa-size-m">Input (medium) <input type="text" placeholder="Placeholder"></input></label>
</td>
</tr>
<tr>
<th><code>.wa-size-l</code></th>
<td>
<wa-input label="Input (large)" placeholder="Placeholder" class="wa-size-l"></wa-input>
</td>
<td>
<label class="wa-size-l">Input (large) <input type="text" placeholder="Placeholder"></input></label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Progress Bar</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-progress-bar&gt;</code></th>
<th><code>&lt;progress&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-progress-bar value="50" max="100"></wa-progress-bar>
</td>
<td>
<progress value="50" max="100"></progress>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Radio</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-radio&gt;</code></th>
<th><code>&lt;input type="radio"&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-radio>Radio</wa-radio>
</td>
<td>
<label><input type="radio"></input> Radio</label>
</td>
</tr>
<tr>
<th><code>checked</code></th>
<td>
<wa-radio-group value="1">
<wa-radio value="1">Radio</wa-radio>
</wa-radio-group>
</td>
<td>
<label><input type="radio" checked></input> Radio</label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Select</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-select&gt;</code></th>
<th><code>&lt;select&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-select label="Select" value="1">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<label>Select
<select value="1">
<option value="1">Option</option>
</select>
</label>
</td>
</tr>
<tr>
<th><code>.wa-filled</code></th>
<td>
<wa-select label="Select (filled)" value="1" class="wa-filled">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<label class="wa-filled">Select (filled)
<select value="1">
<option value="1">Option</option>
</select>
</label>
</td>
</tr>
<tr>
<th><code>.wa-size-s</code></th>
<td>
<wa-select label="Select (small)" value="1" class="wa-size-s">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<label class="wa-size-s">Select (small)
<select value="1">
<option value="1">Option</option>
</select>
</label>
</td>
</tr>
<tr>
<th><code>.wa-size-m</code></th>
<td>
<wa-select label="Select (medium)" value="1" class="wa-size-m">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<label class="wa-size-m">Select (medium)
<select value="1">
<option value="1">Option</option>
</select>
</label>
</td>
</tr>
<tr>
<th><code>.wa-size-l</code></th>
<td>
<wa-select label="Select (large)" value="1" class="wa-size-l">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<label class="wa-size-l">Select (large)
<select value="1">
<option value="1">Option</option>
</select>
</label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3 class="test-failure">Slider</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-slider&gt;</code></th>
<th><code>&lt;input type="range"&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-slider label="Slider"></wa-slider>
</td>
<td>
<label>Slider <input type="range"></input></label>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3 class="test-failure">Textarea</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>&lt;wa-textarea&gt;</code></th>
<th><code>&lt;textarea&gt;</code></th>
</thead>
<tbody>
<tr>
<th><em>default</em></th>
<td>
<wa-textarea label="Textarea" placeholder="Placeholder" rows="2"></wa-textarea>
</td>
<td>
<label>Textarea <textarea placeholder="Placeholder" rows="2"></textarea></label>
</td>
</tr>
<tr>
<th><code>.wa-filled</code></th>
<td>
<wa-textarea label="Textarea (filled)" placeholder="Placeholder" class="wa-filled" rows="2"></wa-textarea>
</td>
<td>
<label>Textarea (filled) <textarea placeholder="Placeholder" class="wa-filled" rows="2"></textarea></label>
</td>
</tr>
<tr>
<th><code>.wa-size-s</code></th>
<td>
<wa-textarea label="Textarea (small)" placeholder="Placeholder" class="wa-size-s" rows="2"></wa-textarea>
</td>
<td>
<label class="wa-size-s">Textarea (small) <textarea placeholder="Placeholder" rows="2"></textarea></label>
</td>
</tr>
<tr>
<th><code>.wa-size-m</code></th>
<td>
<wa-textarea label="Textarea (medium)" placeholder="Placeholder" class="wa-size-m" rows="2"></wa-textarea>
</td>
<td>
<label class="wa-size-m">Textarea (medium) <textarea placeholder="Placeholder" rows="2"></textarea></label>
</td>
</tr>
<tr>
<th><code>.wa-size-l</code></th>
<td>
<wa-textarea label="Textarea (large)" placeholder="Placeholder" class="wa-size-l" rows="2"></wa-textarea>
</td>
<td>
<label class="wa-size-l">Textarea (large) <textarea placeholder="Placeholder" rows="2"></textarea></label>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -0,0 +1,856 @@
<h3>Button</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-button size="small">Button</wa-button>
</td>
<td>
<wa-button class="wa-size-s">Button</wa-button>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-button size="medium">Button</wa-button>
</td>
<td>
<wa-button class="wa-size-m">Button</wa-button>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-button size="large">Button</wa-button>
</td>
<td>
<wa-button class="wa-size-l">Button</wa-button>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Button Group</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-button-group orientation="horizontal" size="small">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
<td>
<wa-button-group orientation="horizontal" class="wa-size-s">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-button-group orientation="horizontal" size="medium">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
<td>
<wa-button-group orientation="horizontal" class="wa-size-m">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-button-group orientation="horizontal" size="large">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
<td>
<wa-button-group orientation="horizontal" class="wa-size-l">
<wa-button value="1">Button L</wa-button>
<wa-button value="2">Button R</wa-button>
</wa-button-group>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Callout</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-callout size="small">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
<td>
<wa-callout class="wa-size-s">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-callout size="medium">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
<td>
<wa-callout class="wa-size-m">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-callout size="large">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
<td>
<wa-callout class="wa-size-l">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Callout
</wa-callout>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Card</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-card size="small">
Card
</wa-card>
</td>
<td>
<wa-card class="wa-size-s">
Card
</wa-card>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-card size="medium">
Card
</wa-card>
</td>
<td>
<wa-card class="wa-size-m">
Card
</wa-card>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-card size="large">
Card
</wa-card>
</td>
<td>
<wa-card class="wa-size-l">
Card
</wa-card>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Checkbox</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-checkbox hint="Hint" size="small">Checkbox</wa-checkbox>
</td>
<td>
<wa-checkbox hint="Hint" class="wa-size-s">Checkbox</wa-checkbox>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-checkbox hint="Hint" size="medium">Checkbox</wa-checkbox>
</td>
<td>
<wa-checkbox hint="Hint" class="wa-size-m">Checkbox</wa-checkbox>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-checkbox hint="Hint" size="large">Checkbox</wa-checkbox>
</td>
<td>
<wa-checkbox hint="Hint" class="wa-size-l">Checkbox</wa-checkbox>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Color Picker</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-color-picker size="small" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
<td>
<wa-color-picker class="wa-size-s" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-color-picker size="medium" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
<td>
<wa-color-picker class="wa-size-m" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-color-picker size="large" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
<td>
<wa-color-picker class="wa-size-l" label="Color Picker" hint="Hint"></wa-color-picker>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Dropdown</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-dropdown size="small">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
<td>
<wa-dropdown class="wa-size-s">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-dropdown size="medium">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
<td>
<wa-dropdown class="wa-size-m">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-dropdown size="large">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
<td>
<wa-dropdown class="wa-size-l">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</wa-dropdown>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Menu</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-menu size="small">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
<td>
<wa-menu class="wa-size-s">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-menu size="medium">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
<td>
<wa-menu class="wa-size-m">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-menu size="large">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
<td>
<wa-menu class="wa-size-l">
<wa-menu-item>Menu Item 1</wa-menu-item>
<wa-menu-item>Menu Item 2</wa-menu-item>
</wa-menu>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Input</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-input size="small" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
<td>
<wa-input class="wa-size-s" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-input size="medium" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
<td>
<wa-input class="wa-size-m" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-input size="large" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
<td>
<wa-input class="wa-size-l" label="Input" placeholder="Placeholder" hint="Hint"></wa-input>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Radio</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-radio size="small">Radio</wa-radio>
</td>
<td>
<wa-radio class="wa-size-s">Radio</wa-radio>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-radio size="medium">Radio</wa-radio>
</td>
<td>
<wa-radio class="wa-size-m">Radio</wa-radio>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-radio size="large">Radio</wa-radio>
</td>
<td>
<wa-radio class="wa-size-l">Radio</wa-radio>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Radio Button</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button size="small" value="1">Radio</wa-radio-button>
<wa-radio-button size="small" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button class="wa-size-s" value="1">Radio</wa-radio-button>
<wa-radio-button class="wa-size-s" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button size="medium" value="1">Radio</wa-radio-button>
<wa-radio-button size="medium" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button class="wa-size-m" value="1">Radio</wa-radio-button>
<wa-radio-button class="wa-size-m" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button size="large" value="1">Radio</wa-radio-button>
<wa-radio-button size="large" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
<td>
<wa-radio-group orientation="horizontal">
<wa-radio-button class="wa-size-l" value="1">Radio</wa-radio-button>
<wa-radio-button class="wa-size-l" value="2">Button</wa-radio-button>
</wa-radio-group>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Radio Group</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" size="small">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" size="small">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" class="wa-size-s">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" class="wa-size-s">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" size="medium">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" size="medium">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" class="wa-size-m">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" class="wa-size-m">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" size="large">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" size="large">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
<td>
<div class="wa-stack">
<wa-radio-group label="Radio Group" hint="Hint" class="wa-size-l">
<wa-radio value="1">Radio 1</wa-radio>
<wa-radio value="2">Radio 2</wa-radio>
</wa-radio-group>
<wa-radio-group orientation="horizontal" label="Radio Button Group" hint="Hint" class="wa-size-l">
<wa-radio-button value="1">Radio 1</wa-radio-button>
<wa-radio-button value="2">Radio 2</wa-radio-button>
</wa-radio-group>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Rating</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-rating size="small"></wa-rating>
</td>
<td>
<wa-rating class="wa-size-s"></wa-rating>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-rating size="medium"></wa-rating>
</td>
<td>
<wa-rating class="wa-size-m"></wa-rating>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-rating size="large"></wa-rating>
</td>
<td>
<wa-rating class="wa-size-l"></wa-rating>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Select</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-select size="small" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<wa-select class="wa-size-s" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-select size="medium" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<wa-select class="wa-size-m" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-select size="large" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
<td>
<wa-select class="wa-size-l" label="Select" placeholder="Placeholder" hint="Hint">
<wa-option value="1">Option</wa-option>
</wa-select>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Switch</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-switch hint="Hint" size="small">Switch</wa-switch>
</td>
<td>
<wa-switch hint="Hint" class="wa-size-s">Switch</wa-switch>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-switch hint="Hint" size="medium">Switch</wa-switch>
</td>
<td>
<wa-switch hint="Hint" class="wa-size-m">Switch</wa-switch>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-switch hint="Hint" size="large">Switch</wa-switch>
</td>
<td>
<wa-switch hint="Hint" class="wa-size-l">Switch</wa-switch>
</td>
</tr>
</tbody>
</table>
</div>
<wa-divider></wa-divider>
<h3>Textarea</h3>
<div class="table-scroll">
<table>
<thead>
<th></th>
<th><code>size=""</code></th>
<th><code>.wa-size-[s|m|l]</code></th>
</thead>
<tbody>
<tr>
<th><code>small</code>/<code>s</code></th>
<td>
<wa-textarea size="small" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
<td>
<wa-textarea class="wa-size-s" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
</tr>
<tr>
<th><code>medium</code>/<code>m</code></th>
<td>
<wa-textarea size="medium" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
<td>
<wa-textarea class="wa-size-m" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
</tr>
<tr>
<th><code>large</code>/<code>l</code></th>
<td>
<wa-textarea size="large" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
<td>
<wa-textarea class="wa-size-l" label="Textarea" placeholder="Placeholder" hint="Hint"></wa-textarea>
</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -255,7 +255,7 @@
{# Importing #}
<h2>Importing</h2>
<p>
The <a href="/docs/#autoloading">autoloader</a> is the recommended way to import components. If you prefer to do it manually, use one of the following code snippets.
The <a href="/docs/installation/#quick-start-autoloading-via-cdn">autoloader</a> is the recommended way to import components. If you prefer to do it manually, use one of the following code snippets.
</p>
<wa-tab-group label="How would you like to import this component?">

View File

@@ -14,11 +14,19 @@
{% endblock %}
{% block afterContent %}
{# Slots #}
{% if css_file %}
<h2>Using these styles</h2>
<p>If you want to use these styles without using the entirety of Web Awesome Native Styles, you can include the following CSS files:</p>
{% if file %}
{% markdown %}
## Opting In to Native {{ title }} Styles
If you want to use the Native {{ title }} styles **without including the entirety of Web Awesome Native Styles**,
you can include the following CSS files from the Web Awesome CDN.
{% set stylesheet = file %}
{% include 'import-stylesheet-code.md.njk' %}
To use all of Web Awesome Native styles, follow the [instructions on the Native Styles overview page](../).
{% endmarkdown %}
{% endif %}
{% endif %}
{% endblock %}

View File

@@ -20,6 +20,6 @@ tags: ["overview"]
<script type="module" src="/assets/scripts/filter.js"></script>
{% if content | trim %}
<br> {# Temp fix for spacing issue #}
<wa-divider style="--spacing: var(--wa-space-3xl)"></wa-divider> {# Temp fix for spacing issue #}
{{ content | safe }}
{% endif %}

318
docs/_layouts/palette.njk Normal file
View File

@@ -0,0 +1,318 @@
{% set hasSidebar = true %}
{% set hasOutline = true %}
{% set paletteId = page.fileSlug %}
{% set tints = ["95", "90", "80", "70", "60", "50", "40", "30", "20", "10", "05"] %}
{% extends '../_includes/base.njk' %}
{% block head %}
<style>@import url('/dist/styles/color/{{ paletteId }}.css') layer(palette.{{ paletteId }});</style>
<link href="{{ page.url }}../tweak.css" rel="stylesheet">
<script type="module" src="{{ page.url }}../tweak.js"></script>
{% endblock %}
{% block header %}
<div id="palette-app" data-palette-id="{{ paletteId }}">
<div
:class="{
tweaking: tweaking.chroma,
'tweaking-chroma': tweaking.chroma,
'tweaking-hue': tweaking.chroma,
'tweaking-gray-chroma': tweaking.grayChroma,
'tweaked-chroma': tweaked?.chroma,
'tweaked-hue': tweaked?.hue,
'tweaked-any': tweaked
}"
:style="{
'--chroma-scale': chromaScale,
'--gray-chroma': tweaked?.grayChroma ? grayChroma : '',
}">
{% include 'breadcrumbs.njk' %}
<h1 v-if="saved" class="title">
{% raw %}{{ saved.title }}{% endraw %}
<wa-icon-button name="pencil" label="Rename palette" @click="rename"></wa-icon-button>
<wa-icon-button class="delete" name="trash" label="Delete palette" @click="deleteSaved"></wa-icon-button>
</h1>
<h1 v-if="!saved" class="title">{{ title }}</h1>
<div class="block-info">
<code class="class">.wa-palette-{{ paletteId }}</code>
{% include '../_includes/status.njk' %}
{% if not isPro %}
<wa-badge class="pro" v-if="tweaked">PRO</wa-badge>
{% endif %}
</div>
{% if description %}
<p class="summary">
{{ description | inlineMarkdown | safe }}
</p>
{% endif %}
{% endblock %}
{% block afterContent %}
{% set maxChroma = 0 %}
<wa-callout size="small" class="tweaked-callout" variant="warning">
<wa-icon name="sliders-simple" slot="icon" variant="regular"></wa-icon>
This palette has been tweaked.
<div class="wa-cluster wa-gap-xs">
<wa-tag v-for="tweakHumanReadable, param in tweaksHumanReadable" removable @wa-remove="reset(param)">{% raw %}{{ tweakHumanReadable }}{% endraw %}</wa-tag>
</div>
<wa-button @click="reset()" appearance="outlined" variant="danger">
<span slot="prefix" class="icon-modifier">
<wa-icon name="circle-xmark" variant="regular"></wa-icon>
</span>
Reset
</wa-button>
<wa-button v-if="!saved" @click="save" variant="success">
<span slot="prefix" class="icon-modifier">
<wa-icon name="sidebar" variant="regular"></wa-icon>
<wa-icon name="circle-plus" class="modifier" style="color: light-dark(var(--wa-color-green-70), var(--wa-color-green-60));"></wa-icon>
</span>
Save
</wa-button>
</wa-callout>
<table class="colors main wa-palette-{{ paletteId }}">
<thead>
<tr>
<th></th>
<th class="core-column">Core tint</th>
{% for tint in tints -%}
<th>{{ tint }}</th>
{%- endfor %}
</tr>
</thead>
{# Initialize to last hue before gray #}
{%- set hueBefore = hues[hues|length - 2] -%}
{% for hue in hues -%}
{% set coreTint = palettes[paletteId][hue].maxChromaTint %}
{%- set coreColor = palettes[paletteId][hue][coreTint] -%}
{%- set maxChroma = coreColor.c if coreColor.c > maxChroma else maxChroma -%}
{% if hue === 'gray' %}
<tr data-hue="{{ hue }}" class="color-scale"
:class="{tweaking: tweaking.grayChroma, tweaked: tweaked.grayChroma || tweaked.grayColor }">
{% else %}
<tr data-hue="{{ hue }}" class="color-scale"
:class="{tweaking: tweaking.{{ hue }}, tweaked: hueShifts.{{ hue }} }"
:style="{ '--hue-shift': hueShifts.{{ hue }} || '' }">
{% endif %}
<th>
{{ hue | capitalize }}
</th>
<td class="core-column"
style="--color: var(--wa-color-{{ hue }})"
:style="{
'--color-tweaked': colors.{{ hue }}[{{ coreTint }}],
'--color-gray-undertone': colors[grayColor][{{coreTint}}],
'--color-tweaked-no-gray-chroma': colorsMinusGrayChroma.{{ hue }}[{{ coreTint }}],
}">
<wa-dropdown>
<div slot="trigger" id="core-{{ hue }}-swatch" data-tint="core" class="color swatch"
style="background-color: var(--wa-color-{{ hue }}); color: var(--wa-color-{{ hue }}-{{ '05' if palettes[paletteId][hue].maxChromaTint > 60 else '95' }});"
>
{{ palettes[paletteId][hue].maxChromaTint }}
<wa-icon name="sliders-simple" class="tweak-icon"></wa-icon>
</div>
<div class="popup">
{% if hue === 'gray' %}
<wa-radio-group class="core-color" orientation="horizontal" v-model="grayColor">
{% for h in hues -%}
{%- if h !== 'gray' -%}
<wa-radio-button id="gray-undertone-{{ h }}" value="{{ h }}" label="{{ h | capitalize }}" style="--color: var(--wa-color-{{ h }})"></wa-radio-button>
<wa-tooltip for="gray-undertone-{{ h }}" hoist>
{{ h | capitalize }}
</wa-tooltip>
{%- endif -%}
{%- endfor -%}
<div slot="label">
Gray undertone
</div>
</wa-radio-group>
<div class="decorated-slider gray-chroma-slider" :style="{'--max': maxGrayChroma}">
<wa-slider name="gray-chroma" v-model="grayChroma" ref="grayChromaSlider"
value="0" min="0" :max="maxGrayChroma" step="0.01"
@input="tweaking.grayChroma = true" @change="tweaking.grayChroma = false">
<div slot="label">
Gray colorfulness
<wa-icon-button @click="grayChroma = originalGrayChroma" class="clear-button" name="circle-xmark" library="system" variant="regular" label="Reset"></wa-icon-button>
</div>
</wa-slider>
<div class="label-min">Neutral</div>
<div class="label-max" v-content="moreHue[grayColor]">Warmer/Cooler</div>
</div>
{% else %}
{%- set hueAfter = hues[loop.index0 + 1] -%}
{%- set hueAfter = hues[0] if hueAfter == 'gray' else hueAfter -%}
{%- set minShift = hueRanges[hue].min - coreColor.h | round -%}
{%- set maxShift = hueRanges[hue].max - coreColor.h | round -%}
<div class="decorated-slider hue-shift-slider" style="--min: {{ minShift }}; --max: {{ maxShift }};">
<wa-slider name="{{ hue }}-shift" v-model="hueShifts.{{ hue }}" value="0"
min="{{ minShift }}" max="{{ maxShift }}" step="1"
@input="tweaking.hue = tweaking.{{hue}} = true"
@change="tweaking.hue = tweaking.{{ hue }} = false">
<div slot="label">
Tweak {{ hue }} hue
<wa-icon-button @click="hueShifts.{{ hue }} = 0" class="clear-button" name="circle-xmark" library="system" variant="regular" label="Reset"></wa-icon-button>
</div>
</wa-slider>
<div class="label-min">More {{hueBefore}}</div>
<div class="label-max">More {{hueAfter}}</div>
</div>
{%- set hueBefore = hue -%}
{% endif %}
<div class="wa-gap-s">
<code>--wa-color-{{ hue }}</code>
<wa-copy-button value="--wa-color-{{ hue }}" copy-label="--wa-color-{{ hue }}"></wa-copy-button>
</div>
</div>`
</wa-dropdown>
</td>
{% for tint in tints -%}
{%- set color = palettes[paletteId][hue][tint] -%}
<td data-tint="{{ tint }}" style="--color: var(--wa-color-{{ hue }}-{{ tint }})"
:style="{
'--color-tweaked': colors.{{ hue }}[{{ tint }}],
'--color-tweaked-no-gray-chroma': colorsMinusGrayChroma.{{ hue }}[{{ tint }}],
}">
<div class="color swatch" style="--color: var(--wa-color-{{ hue }}-{{ tint }})">
<wa-copy-button value="--wa-color-{{ hue }}-{{ tint }}" copy-label="--wa-color-{{ hue }}-{{ tint }}"></wa-copy-button>
</div>
</td>
{%- endfor -%}
</tr>
{%- endfor %}
</table>
{% set chromaScaleBounds = [
(0.08 / maxChroma) | number({maximumFractionDigits: 2}),
(0.3 / maxChroma]) | number({maximumFractionDigits: 2}) -%}
<div class="decorated-slider chroma-scale-slider wa-palette-{{ paletteId }}"
:class="{ tweaked: chromaScale !== 1 }"
style="--min: {{ chromaScaleBounds[0] }}; --max: {{ chromaScaleBounds[1] }};">
<wa-slider name="chroma-scale" ref="chromaScaleSlider"
v-model="chromaScale" value="1" step="0.01"
min="{{ chromaScaleBounds[0] }}" max="{{ chromaScaleBounds[1] }}"
@input="tweaking.chroma = true"
@change="tweaking.chroma = false">
<div slot="label">
Overall colorfulness
<wa-icon-button @click="chromaScale = 1" class="clear-button" name="circle-xmark" library="system" variant="regular" label="Reset"></wa-icon-button>
</div>
</wa-slider>
<div class="label-min">More muted</div>
<div class="label-max">More vibrant</div>
</div>
<h2>Used By</h2>
<section class="index-grid">
{% for page in collections.theme %}
{%- if page.data.palette == paletteId -%}
{% include "page-card.njk" %}
{%- endif -%}
{% endfor %}
</section>
{% markdown %}
## Color Contrast
Web Awesome color scales are designed to guarantee certain contrast ratios,
both per [WCAG 2.1 success criteria](https://www.w3.org/TR/WCAG21/#contrast-minimum)
as well as the emergent APCA specification _(planned)_,
so you can ensure that text is both legible to all users, and legally conformant.
### Level 1
A difference of `40` ensures a minimum **3:1** contrast ratio, suitable for large text and icons (AA).
{% endmarkdown %}
{% set difference = 40 %}
{% set minContrast = 3 %}
{% include "contrast-table.njk" %}
{% markdown %}
This also goes for a difference of `45`:
{% endmarkdown %}
{% set difference = 45 %}
{% include "contrast-table.njk" %}
{% markdown %}
### Level 2
A difference of `50` ensures a minimum **4.5:1** contrast ratio, suitable for normal text (AA) and large text (AAA)
{% endmarkdown %}
{% set difference = 50 %}
{% set minContrast = 4.5 %}
{% include "contrast-table.njk" %}
{% markdown %}
This also goes for a difference of `55`:
{% endmarkdown %}
{% set difference = 55 %}
{% include "contrast-table.njk" %}
{% markdown %}
### Level 3
A difference of `60` ensures a minimum **7:1** contrast ratio, suitable for all text (AAA)
{% endmarkdown %}
{% set difference = 60 %}
{% set minContrast = 7 %}
{% include "contrast-table.njk" %}
{% markdown %}
This also goes for a difference of `65`:
{% endmarkdown %}
{% set difference = 65 %}
{% include "contrast-table.njk" %}
{% markdown %}
## How to use this palette { #usage }
If you are using a Web Awesome theme that uses this palette, it will already be included.
To use a different palette than a theme default, or to use it in a custom theme, you can import this palette directly from the Web Awesome CDN.
{% set stylesheet = 'styles/color/' + page.fileSlug + '.css' %}
<wa-tab-group class="import-stylesheet-code">
<wa-tab panel="html">In HTML</wa-tab>
<wa-tab panel="css">In CSS</wa-tab>
<wa-tab-panel name="html">
Add the following code to the `<head>` of your page:
```html { v-content:html="code.html.highlighted" }
<link rel="stylesheet" href="{% cdnUrl stylesheet %}" />
```
</wa-tab-panel>
<wa-tab-panel name="css">
Add the following code at the top of your CSS file:
```css { v-content:html="code.css.highlighted" }
@import url('{% cdnUrl stylesheet %}');
```
</wa-tab-panel>
</wa-tab-group>
{% endmarkdown %}
</div></div> {# end palette app #}
{% endblock %}

View File

@@ -4,34 +4,142 @@
{% extends '../_includes/base.njk' %}
{% block head %}
<script>
globalThis.wa_data ??= {};
wa_data.baseTheme = "{{ page.fileSlug }}";
wa_data.themes = {
{% for theme in collections.theme -%}
"{{ theme.fileSlug }}": {
"title": "{{ theme.data.title }}",
"palette": "{{ theme.data.palette }}",
"brand": "{{ theme.data.brand }}"
},
{% endfor %}
};
wa_data.palettes = {
{% for palette in collections.palette -%}
"{{ palette.fileSlug }}": {
"title": "{{ palette.data.title }}",
},
{% endfor %}
};
</script>
<link href="{{ page.url }}../remix.css" rel="stylesheet">
<script src="{{ page.url }}../remix.js" type="module"></script>
{% endblock %}
{% block header %}
<iframe src='{{ page.url }}demo.html'></iframe>
<iframe src='{{ page.url }}demo.html' id="demo"></iframe>
<wa-details id="mix_and_match" class="wa-gap-m" >
<h4 slot="summary" data-no-anchor data-no-outline id="remix">
<wa-icon name="arrows-rotate"></wa-icon>
Remix this theme
<wa-icon id="what-is-remixing" href="#remixing" name="circle-question" slot="suffix" variant="regular"></wa-icon>
<wa-tooltip for="what-is-remixing">Customize this theme by changing its colors and/or remixing it with design elements from other themes!</wa-tooltip>
</h4>
<wa-select name="colors" label="Colors from…" value="" clearable>
<wa-icon name="palette" slot="prefix" variant="regular"></wa-icon>
{% for theme in collections.theme | sort %}
{% set currentTheme = theme.fileSlug == page.fileSlug %}
<wa-option label="{{ theme.data.title }}" value="{{ theme.fileSlug if not currentTheme }}" {{ (theme.fileSlug if currentTheme) | attr('data-id') }}>
<wa-card with-header>
<div slot="header">
{% include "svgs/theme-color.njk" %}
</div>
<span class="page-name">
{{ theme.data.title }}
{% if theme.data.isPro %}<wa-badge class="pro">PRO</wa-badge>{% endif %}
{% if currentTheme %}<wa-badge variant="neutral" appearance="outlined">This theme</wa-badge>{% endif %}
</span>
</wa-card>
</wa-option>
{% endfor %}
</wa-select>
<wa-select name="palette" label="Palette" clearable>
<wa-icon name="swatchbook" slot="prefix" variant="regular"></wa-icon>
{% set defaultPalette = palette %}
{% for palette in collections.palette | sort %}
{% set currentPalette = palette.fileSlug == defaultPalette %}
<wa-option label="{{ palette.data.title }}" value="{{ palette.fileSlug if not currentPalette }}" {{ (palette.fileSlug if currentPalette) | attr('data-id') }}>
<wa-card with-header>
<div slot="header">
{% include "svgs/" + (palette.data.icon or "thumbnail-placeholder") + ".njk" %}
</div>
<span class="page-name">
{{ palette.data.title }}
{% if palette.data.isPro %}<wa-badge class="pro">PRO</wa-badge>{% endif %}
{% if currentPalette %}<wa-badge variant="neutral" appearance="outlined">Theme default</wa-badge>{% endif %}
</span>
</wa-card>
</wa-option>
{% endfor %}
{% set palette = defaultPalette %}
</wa-select>
<wa-select name="brand" label="Brand color" value="" clearable>
<div class="selected-swatch" slot="prefix"></div>
{% for hue in hues %}
{% set currentBrand = hue == brand %}
<wa-option label="{{ hue | capitalize }}" value="{{ hue if not currentBrand }}" {{ (hue if currentBrand) | attr('data-id') }} style="--color: var(--wa-color-{{ hue }})">
{{ hue | capitalize }}
{% if currentBrand %}<wa-badge variant="neutral" appearance="outlined">Theme default</wa-badge>{% endif %}
</wa-option>
{% endfor %}
</wa-select>
<wa-select name="typography" label="Typography from…" clearable>
<wa-icon name="font-case" slot="prefix"></wa-icon>
{% for theme in collections.theme | sort %}
{% set currentTheme = theme.fileSlug == page.fileSlug %}
<wa-option label="{{ theme.data.title }}" value="{{ theme.fileSlug if not currentTheme }}" {{ (theme.fileSlug if currentTheme) | attr('data-id') }}>
<wa-card with-header>
<div slot="header">
{% include "svgs/theme-typography.njk" %}
</div>
<span class="page-name">
{{ theme.data.title }}
{% if theme.data.isPro %}<wa-badge class="pro">PRO</wa-badge>{% endif %}
{% if currentTheme %}<wa-badge variant="neutral" appearance="outlined">This theme</wa-badge>{% endif %}
</span>
</wa-card>
</wa-option>
{% endfor %}
</wa-select>
</wa-details>
<h2>Color</h2>
{% set paletteURL = '/docs/palettes/' + palette + '/' %}
<div class="index-grid">
{% set themePage = page %}
{% set page = paletteURL | getCollectionItemFromUrl %}
{% set pageSubtitle = "Default color palette" %}
{% include 'page-card.njk' %}
{% set page = themePage %}
<wa-card style="--header-background: var(--wa-color-{{ brand }})" class="wa-palette-{{ palette }}">
<div slot="header"></div>
<div class="page-name">{{ brand | capitalize }}</div>
<div class="wa-caption-s">Default brand color</div>
</wa-card>
</div>
{% endblock %}
{% block afterContent %}
{% markdown %}
## How to use this theme
<h2 id="usage">How to use this theme</h2>
{% markdown %}
You can import this theme from the Web Awesome CDN.
<wa-tab-group>
<wa-tab panel="html">In HTML</wa-tab>
<wa-tab panel="css">In CSS</wa-tab>
<wa-tab-panel name="html">
Simply add the following code to the `<head>` of your page:
```html
<link rel="stylesheet" href="{% cdnUrl 'styles/themes/' + page.fileSlug + '.css' %}" />
```
</wa-tab-panel>
<wa-tab-panel name="css">
Simply add the following code at the top of your CSS file:
```css
@import url('{% cdnUrl 'styles/themes/' + page.fileSlug + '.css' %}');
```
</wa-tab-panel>
</wa-tab-group>
{% set stylesheet = 'styles/themes/' + page.fileSlug + '.css' %}
{% include 'import-stylesheet-code.md.njk' %}
## Dark mode
@@ -73,6 +181,7 @@ You can apply the class to the `<html>` element on your page to activate the dar
Web Awesome's themes have both light and dark styles built in.
However, Web Awesome doesn't try to auto-detect the user's light/dark mode preference.
This should be done at the application level.
As a best practice, to provide a dark theme in your app, you should:
- Check for [`prefers-color-scheme`](https://stackoverflow.com/a/57795495/567486) and use its value by default
@@ -81,5 +190,18 @@ As a best practice, to provide a dark theme in your app, you should:
Web Awesome avoids using the `prefers-color-scheme` media query because not all apps support dark mode, and it would break things for the ones that don't.
Assuming the user's preference is in a variable called `colorScheme` (values: `auto`, `light`, `dark`),
you can use the following JS snippet to apply the `wa-dark` class to the `<html>` element accordingly:
```js
const systemDark = window.matchMedia('(prefers-color-scheme: dark)');
const applyDark = function (event = systemDark) {
const isDark = colorScheme === 'auto' ? event.matches : colorScheme === 'dark';
document.documentElement.classList.toggle('wa-dark', isDark);
};
systemDark.addEventListener('change', applyDark);
applyDark();
```
{% endmarkdown %}
{% endblock %}

19
docs/_layouts/utility.njk Normal file
View File

@@ -0,0 +1,19 @@
{% extends '../_layouts/block.njk' %}
{% block afterContent %}
{% if file %}
{% markdown %}
## Opting In
If you want to use this utility **only** without [all others](../), you can include the following CSS file from the Web Awesome CDN.
{% set stylesheet = file %}
{% include 'import-stylesheet-code.md.njk' %}
Want them all?
Follow the [instructions on the Utilities overview page](../) to get all Web Awesome utilities.
{% endmarkdown %}
{% endif %}
{% endblock %}

View File

@@ -37,7 +37,8 @@ export function anchorHeadingsPlugin(options = {}) {
}
// Look for headings
container.querySelectorAll(options.headingSelector).forEach(heading => {
let selector = `:is(${options.headingSelector}):not([data-no-anchor], [data-no-anchor] *)`;
container.querySelectorAll(selector).forEach(heading => {
const hasAnchor = heading.querySelector('a');
const existingId = heading.getAttribute('id');
const clone = parse(heading.outerHTML);

View File

@@ -3,30 +3,39 @@ import { parse } from 'node-html-parser';
/**
* Eleventy plugin to add copy buttons to code blocks.
*/
export function copyCodePlugin(options = {}) {
export function copyCodePlugin(eleventyConfig, options = {}) {
options = {
container: 'body',
...options,
};
return function (eleventyConfig) {
eleventyConfig.addTransform('copy-code', content => {
const doc = parse(content, { blockTextElements: { code: true } });
const container = doc.querySelector(options.container);
let codeCount = 0;
eleventyConfig.addTransform('copy-code', content => {
const doc = parse(content, { blockTextElements: { code: true } });
const container = doc.querySelector(options.container);
if (!container) {
return content;
if (!container) {
return content;
}
// Look for code blocks
container.querySelectorAll('pre > code').forEach(code => {
const pre = code.closest('pre');
let preId = pre.getAttribute('id') || `code-block-${++codeCount}`;
let codeId = code.getAttribute('id') || `${preId}-inner`;
if (!code.getAttribute('id')) {
code.setAttribute('id', codeId);
}
if (!pre.getAttribute('id')) {
pre.setAttribute('id', preId);
}
// Look for code blocks
container.querySelectorAll('pre > code').forEach(code => {
const pre = code.closest('pre');
// Add a copy button (we set the copy data at runtime to reduce page bloat)
pre.innerHTML = `<wa-copy-button class="copy-button" hoist></wa-copy-button>` + pre.innerHTML;
});
return doc.toString();
// Add a copy button
pre.innerHTML += `<wa-icon-button href="#${preId}" class="block-link-icon" name="link"></wa-icon-button>
<wa-copy-button from="${codeId}" class="copy-button" hoist></wa-copy-button>`;
});
};
return doc.toString();
});
}

View File

@@ -105,6 +105,23 @@ export function deepValue(obj, key) {
return key.reduce((subObj, property) => subObj?.[property], obj);
}
export function number(value, options) {
if (typeof value !== 'number' && isNaN(value)) {
return value;
}
let lang = options?.lang ?? 'en';
if (options?.lang) {
delete options.lang;
}
if (!options || Object.keys(options).length === 0) {
options = { maximumSignificantDigits: 3 };
}
return Number(value).toLocaleString(lang, options);
}
export function isNumeric(value) {
return typeof value === 'number' || (typeof value === 'string' && !isNaN(value));
}

View File

@@ -1,15 +0,0 @@
function setCopyValue() {
document.querySelectorAll('.copy-button').forEach(copyButton => {
const pre = copyButton.closest('pre');
const code = pre?.querySelector('code');
if (code) {
copyButton.value = code.textContent;
}
});
}
// Set data for all copy buttons when the page loads
setCopyValue();
document.addEventListener('turbo:load', setCopyValue);

View File

@@ -18,7 +18,7 @@ function updateResults(input) {
}
}
document.documentElement.addEventListener('wa-input', e => {
document.documentElement.addEventListener('input', e => {
if (e.target?.matches('#block-filter wa-input')) {
updateResults(e.target);
}

View File

@@ -5,7 +5,7 @@ const presetTheme = new ThemeAspect({
key: 'presetTheme',
picker: 'wa-select.preset-theme-selector',
applyChange() {
applyChange(options = {}) {
const oldStylesheets = [...document.querySelectorAll('#theme-stylesheet')];
const oldStylesheet = oldStylesheets.pop();
@@ -38,7 +38,7 @@ const presetTheme = new ThemeAspect({
oldStylesheet.remove();
},
{ behavior: 'smooth' },
{ behavior: 'smooth', ...options },
);
},
{ once: true },
@@ -47,18 +47,6 @@ const presetTheme = new ThemeAspect({
},
});
/**
* Without this, there's a flash of the incorrect preset theme.
*/
function updateSelectionBeforeTurboLoad(e) {
const newElement = e.detail.newBody || e.detail.newFrame || e.detail.newStream;
if (newElement) {
presetTheme.syncUI(newElement);
}
}
['turbo:before-render', 'turbo:before-stream-render', 'turbo:before-frame-render'].forEach(eventName => {
document.addEventListener(eventName, updateSelectionBeforeTurboLoad);
window.addEventListener('turbo:render', e => {
presetTheme.applyChange({ behavior: 'instant' });
});
window.presetTheme = presetTheme;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
globalThis.Prism = globalThis.Prism || {};
globalThis.Prism.manual = true;
await import('./prism-downloaded.js');
Prism.plugins.customClass.prefix('code-');
export default Prism;

View File

@@ -9,6 +9,7 @@ const icons = {
component: 'puzzle-piece',
document: 'file',
home: 'house',
native: 'code',
theme: 'palette',
};
let searchTimeout;
@@ -166,6 +167,7 @@ async function updateResults(query = '') {
li.setAttribute('data-selected', index === 0 ? 'true' : 'false');
if (page.url === '/') icon = icons.home;
if (page.url.startsWith('/docs/native')) icon = icons.native;
if (page.url.startsWith('/docs/components')) icon = icons.component;
if (page.url.startsWith('/docs/theme') || page.url.startsWith('/docs/restyle')) icon = icons.theme;

View File

@@ -0,0 +1,254 @@
const sidebar = (globalThis.sidebar = {});
sidebar.palettes = {
render() {
if (this.saved.length === 0) {
return;
}
for (let palette of this.saved) {
sidebar.palette.render(palette);
}
sidebar.updateCurrent();
},
updateSaved() {
this.saved = localStorage.savedPalettes ? JSON.parse(localStorage.savedPalettes) : [];
},
save(saved = this.saved) {
this.saved = saved ?? [];
if (saved.length > 0) {
localStorage.savedPalettes = JSON.stringify(saved);
} else {
delete localStorage.savedPalettes;
}
},
};
sidebar.palettes.updateSaved();
addEventListener('storage', event => sidebar.palettes.updateSaved());
sidebar.palette = {
getUid() {
let savedPalettes = sidebar.palettes.saved;
let uids = new Set(savedPalettes.map(p => p.uid));
if (savedPalettes.length === 0) {
return 1;
}
// Find first available number
for (let i = 1; i <= savedPalettes.length + 1; i++) {
if (!uids.has(i)) {
return i;
}
}
},
equals(p1, p2) {
if (!p1 || !p2) {
return false;
}
return p1.id === p2.id && p1.uid === p2.uid;
},
delete(palette) {
let savedPalettes = sidebar.palettes.saved;
let count = savedPalettes.length;
if (count === 0) {
return;
}
// TODO improve UX of this
if (!confirm(`Are you sure you want to delete palette “${palette.title}”?`)) {
return;
}
savedPalettes = savedPalettes.filter(p => !sidebar.palette.equals(palette, p));
if (savedPalettes.length === count) {
// Nothing was removed
return;
}
// Update UI
let pathname = `/docs/palettes/${palette.id}/`;
let url = pathname + palette.search;
let uls = new Set();
for (let a of document.querySelectorAll(`#sidebar a[href="${url}"]`)) {
let li = a.closest('li');
let ul = li.closest('ul');
uls.add(ul);
li.remove();
}
// Remove empty lists
for (let ul of uls) {
if (!ul.children.length) {
ul.remove();
}
}
sidebar.updateCurrent();
sidebar.palettes.save(savedPalettes);
if (sidebar.palette.equals(globalThis.paletteApp?.saved, palette)) {
paletteApp.postDelete();
}
},
getSaved(palette, savedPalettes = sidebar.palettes.saved) {
return savedPalettes.find(p => sidebar.palette.equals(p, palette));
},
render(palette) {
// Find existing <a>
let { title, id, search, uid } = palette;
for (let a of document.querySelectorAll(`#sidebar a[href^="/docs/palettes/${id}/"][data-uid="${uid}"]`)) {
// Palette already in sidebar, just update it
a.textContent = palette.title;
a.href = `/docs/palettes/${id}/${search}`;
return;
}
let pathname = `/docs/palettes/${id}/`;
let url = pathname + search;
let parentA = document.querySelector(`a[href="${pathname}"]`);
let parentLi = parentA?.closest('li');
let a;
if (parentLi) {
a = Object.assign(document.createElement('a'), { href: url, textContent: title });
a.dataset.uid = uid;
let badges = [...parentLi.querySelectorAll('wa-badge')].map(badge => badge.cloneNode(true));
let ul = parentLi.querySelector('ul') ?? parentLi.appendChild(document.createElement('ul'));
let li = document.createElement('li');
let deleteButton = Object.assign(document.createElement('wa-icon-button'), {
name: 'trash',
label: 'Delete',
className: 'delete',
});
deleteButton.addEventListener('click', () => {
let palette = { id, uid, title: a.textContent, search: a.search };
sidebar.palette.delete(palette);
});
li.append(a, ' ', ...badges, deleteButton);
ul.appendChild(li);
}
},
save(palette, saved) {
let savedPalettes = sidebar.palettes.saved;
let existing = this.getSaved(saved ?? palette, savedPalettes);
let oldValues;
if (existing) {
// Rename
oldValues = { ...existing };
Object.assign(existing, palette);
} else {
savedPalettes.push(palette);
}
this.render(palette, oldValues);
sidebar.updateCurrent();
sidebar.palettes.save(savedPalettes);
},
};
sidebar.updateCurrent = function () {
// Find the sidebar link with the longest shared prefix with the current URL
let pathParts = location.pathname.split('/').filter(Boolean);
let prefixes = [];
if (pathParts.length === 1) {
// If at /docs/ we just use that, otherwise we want at least two parts (/docs/xxx/)
prefixes.push('/' + pathParts[0] + '/');
} else {
for (let i = 2; i <= pathParts.length; i++) {
prefixes.push('/' + pathParts.slice(0, i).join('/') + '/');
}
}
// Last prefix includes the search too (if any)
if (location.search) {
let params = new URLSearchParams(location.search);
params.sort();
prefixes.push(prefixes.at(-1) + location.search);
}
// We want to start from the longest prefix
prefixes.reverse();
let candidates;
let matchingPrefix;
for (let prefix of prefixes) {
candidates = document.querySelectorAll(`#sidebar a[href^="${prefix}"]`);
if (candidates.length > 0) {
matchingPrefix = prefix;
break;
}
}
if (!matchingPrefix) {
// Abort mission
return;
}
if (matchingPrefix === pathParts.at(-1)) {
// Full path matches, check search
if (location.search) {
candidates = [...candidates];
let searchParams = new URLSearchParams(location.search);
if (searchParams.has('uid')) {
// Only consider candidates with the same uid
candidates = candidates.filter(a => {
let params = new URLSearchParams(a.search);
return params.get('uid') === searchParams.get('uid');
});
} else {
// Sort candidates based on how many params they have in common, in descending order
candidates = candidates.sort((a, b) => {
return countSharedSearchParams(searchParams, b.search) - countSharedSearchParams(searchParams, a.search);
});
}
}
}
if (candidates.length > 0) {
for (let current of document.querySelectorAll('#sidebar a.current')) {
current.classList.remove('current');
}
candidates[0].classList.add('current');
}
};
sidebar.render = function () {
this.palettes.render();
};
sidebar.render();
window.addEventListener('turbo:render', () => sidebar.render());
function countSharedSearchParams(searchParams, search) {
if (!search || search === '?') {
return 0;
}
let params = new URLSearchParams(search);
return [...searchParams.keys()].filter(k => params.get(k) === searchParams.get(k)).length;
}

View File

@@ -28,12 +28,21 @@ export class ThemeAspect {
});
// Listen for selections
document.addEventListener('wa-change', event => {
document.addEventListener('change', event => {
const picker = event.target.closest(this.picker);
if (picker) {
this.set(picker.value);
}
});
['turbo:before-render', 'turbo:before-stream-render', 'turbo:before-frame-render'].forEach(eventName => {
document.addEventListener(eventName, e => {
const newElement = e.detail.newBody || e.detail.newFrame || e.detail.newStream;
if (newElement) {
this.syncUI(newElement);
}
});
});
}
get() {
@@ -91,11 +100,6 @@ const colorScheme = new ThemeAspect({
domChange(() => {
let dark = this.computedValue === 'dark';
document.documentElement.classList.toggle(`wa-dark`, dark);
for (let el of document.querySelectorAll('.wa-invert')) {
el.classList.toggle('wa-dark', !dark);
el.classList.toggle('wa-light', dark);
}
});
},
});

View File

@@ -0,0 +1,6 @@
/**
* Get import code for remixed themes and tweaked palettes.
*/
export { getThemeCode } from './tweak/code.js';
export { cdnUrl, hueRanges, hues, selectors, tints, urls } from './tweak/data.js';
export { default as Permalink } from './tweak/permalink.js';

View File

@@ -0,0 +1,54 @@
/**
* Get import code for remixed themes and tweaked palettes.
*/
import { urls } from './data.js';
export function cssImport(url, options = {}) {
let { language = 'html', cdnUrl = '/dist/', attributes } = options;
url = cdnUrl + url;
if (language === 'css') {
return `@import url('${url}');`;
} else {
attributes = attributes ? ` ${attributes}` : '';
return `<link rel="stylesheet" href="${url}"${attributes} />`;
}
}
export function cssLiteral(value, options = {}) {
let { language = 'html' } = options;
if (language === 'css') {
return value;
} else {
return `<style>\n${value}\n</style>`;
}
}
// Params in correct order
export const themeParams = ['colors', 'palette', 'brand', 'typography'];
export function getThemeCode(base, params, options) {
let ret = [];
if (base) {
ret.push(urls.theme(base));
}
for (let aspect of themeParams) {
let value = params[aspect];
if (value) {
ret.push(urls[aspect](value));
}
}
return ret.map(url => cssImport(url, options)).join('\n');
}
export function cssRule(selector, declarations, { indent = ' ' } = {}) {
selector = Array.isArray(selector) ? selector.flat().join(',\n') : selector;
declarations = Array.isArray(declarations) ? declarations.flat() : declarations;
declarations = declarations.map(declaration => indent + declaration.trim()).join('\n');
return `${selector} {\n${declarations.trimEnd()}\n}`;
}

View File

@@ -0,0 +1,73 @@
/**
* Data related to theme remixing and palette tweaking
* Must work in both browser and Node.js
*/
export const cdnUrl = globalThis.document ? document.documentElement.dataset.cdnUrl : '/dist/';
export const urls = {
theme: id => `styles/themes/${id}.css`,
colors: id => `styles/themes/${id}/color.css`,
palette: id => `styles/color/${id}.css`,
brand: id => `styles/brand/${id}.css`,
typography: id => `styles/themes/${id}/typography.css`,
};
export const selectors = {
palette: id =>
[':where(:root)', ':host', ":where([class^='wa-theme-'], [class*=' wa-theme-'])", `.wa-palette-${id}`].join(',\n'),
};
export const hueRanges = {
red: { min: 5, max: 35 }, // 30
orange: { min: 35, max: 60 }, // 25
yellow: { min: 60, max: 112 }, // 45
green: { min: 112, max: 170 }, // 55
cyan: { min: 170, max: 220 }, // 50
blue: { min: 220, max: 265 }, // 45
indigo: { min: 265, max: 290 }, // 25
purple: { min: 290, max: 320 }, // 30
pink: { min: 320, max: 365 }, // 45
};
export const moreHue = {
red: 'Redder',
orange: 'More orange', // https://www.reddit.com/r/grammar/comments/u9n0uo/is_it_oranger_or_more_orange/
yellow: 'Yellower',
green: 'Greener',
cyan: 'More cyan',
blue: 'Bluer',
indigo: 'More indigo',
pink: 'Pinker',
};
/**
* Max gray chroma (% of chroma of undertone) per hue
*/
export const maxGrayChroma = {
red: 0.2,
orange: 0.2,
yellow: 0.25,
green: 0.25,
cyan: 0.3,
blue: 0.35,
indigo: 0.35,
purple: 0.3,
pink: 0.25,
};
export const docsURLs = {
colors: '/docs/themes/',
palette: '/docs/palettes/',
typography: '/docs/themes/',
};
export const icons = {
colors: 'palette',
palette: 'swatchbook',
brand: 'droplet',
typography: 'font-case',
};
export const hues = Object.keys(hueRanges);
export const tints = ['05', '10', '20', '30', '40', '50', '60', '70', '80', '90', '95'];

View File

@@ -0,0 +1,81 @@
const IDENTITY = x => x;
export default class Permalink extends URLSearchParams {
/** Params changed since last URL I/O */
changed = false;
constructor(params) {
super(location.search);
this.params = params;
}
toJSON() {
return Object.fromEntries(this.entries());
}
#mappings = new WeakMap();
mapObject(obj, mapping = {}) {
this.#mappings.set(obj, mapping);
}
readFrom(obj) {
let mapping = this.#mappings.get(obj) ?? {};
let { keyFrom = IDENTITY, valueFrom = IDENTITY } = mapping;
for (let key in obj) {
let value = obj[key];
let mappedValue = valueFrom(value);
let mappedKey = keyFrom(key);
this.set(mappedKey, mappedValue);
}
}
writeTo(obj) {
let mapping = this.#mappings.get(obj) ?? {};
let { keyTo = IDENTITY, valueTo = IDENTITY, canExtend = false } = mapping;
for (let [key, value] of this) {
let mappedKey = keyTo(key);
let mappedValue = valueTo(value);
if (canExtend || mappedKey in obj) {
obj[mappedKey] = mappedValue;
}
}
}
set(key, value, defaultValue) {
let oldValue = this.get(key);
if (!value || value == defaultValue) {
super.delete(key);
if (oldValue) {
this.changed = true;
}
} else {
super.set(key, value);
if (String(value) !== String(oldValue)) {
this.changed = true;
}
}
this.sort();
}
/**
* Update page URL if it has changed since last time
*/
updateLocation() {
if (this.changed) {
// If theres already a search, replace it.
// We dont want to clog the users history while they iterate
let search = this.toString();
let historyAction = location.search && search ? 'replaceState' : 'pushState';
history[historyAction](null, '', `?${search}`);
this.changed = false;
}
}
}

View File

@@ -0,0 +1,36 @@
export function normalizeAngles(angles) {
// First, normalize
angles = angles.map(h => ((h % 360) + 360) % 360);
// Remove top and bottom 25% and find average
let averageHue =
angles
.toSorted((a, b) => a - b)
.slice(angles.length / 4, -angles.length / 4)
.reduce((a, b) => a + b, 0) / angles.length;
for (let i = 0; i < angles.length; i++) {
let h = angles[i];
let prevHue = angles[i - 1];
let delta = h - prevHue;
if (Math.abs(delta) > 180) {
let equivalent = [h + 360, h - 360];
// Offset hue to minimize difference in the direction that brings it closer to the average
let delta = h - averageHue;
if (Math.abs(equivalent[0] - prevHue) <= Math.abs(equivalent[1] - prevHue)) {
angles[i] = equivalent[0];
} else {
angles[i] = equivalent[1];
}
}
}
return angles;
}
export function subtractAngles(θ1, θ2) {
let [a, b] = normalizeAngles([θ1, θ2]);
return a - b;
}

View File

@@ -1,6 +1,12 @@
pre {
background-color: var(--wa-color-gray-20);
color: white;
/* Ensures a discernible background color in dark mode
* Useful for themes that use gray-20 as --wa-color-surface-default */
.wa-dark & {
background-color: var(--wa-color-surface-lowered);
}
}
.code-comment,
.code-prolog,

View File

@@ -27,3 +27,19 @@ wa-copy-button.copy-button {
opacity: 1;
}
}
.block-link-icon {
position: absolute;
inset-block-start: 0;
inset-inline-end: calc(100% + var(--wa-space-s));
transition: var(--wa-transition-slow);
&:not(:hover, :focus) {
opacity: 50%;
}
:not(:hover, :focus-within) > & {
opacity: 0;
}
}

View File

@@ -156,7 +156,7 @@ wa-page > header {
}
/* Pro badges */
wa-badge.pro::part(base) {
wa-badge.pro {
background-color: var(--wa-brand-orange);
border-color: var(--wa-brand-orange);
}
@@ -188,6 +188,29 @@ wa-badge.pro::part(base) {
}
}
}
wa-icon-button.delete {
vertical-align: -0.2em;
margin-inline-start: var(--wa-space-xs);
&:not(li:hover > *, :focus) {
opacity: 0;
}
}
}
wa-icon-button.delete {
&:hover {
color: var(--wa-color-danger-on-quiet);
}
&::part(base):hover {
background: var(--wa-color-danger-fill-quiet);
}
&:not(:hover, :focus) {
opacity: 0.5;
}
}
#sidebar-close-button {
@@ -232,16 +255,32 @@ wa-page > main {
margin-inline: auto;
}
h1.title wa-badge {
vertical-align: middle;
h1.title {
wa-icon-button {
font-size: var(--wa-font-size-l);
color: var(--wa-color-text-quiet);
&::part(base) {
&:not(:hover, :focus) {
opacity: 0.5;
}
}
wa-badge {
vertical-align: middle;
font-size: 1.5rem;
}
}
.block-info {
display: flex;
gap: var(--wa-space-xs);
flex-wrap: wrap;
align-items: center;
margin-block-end: var(--wa-flow-spacing);
code {
line-height: var(--wa-line-height-condensed);
}
}
/* Current link */
@@ -333,6 +372,7 @@ wa-page > main:has(> .index-grid) {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(min(22ch, 100%), 1fr));
gap: var(--wa-space-2xl);
margin-block-end: var(--wa-space-3xl);
a {
border-radius: var(--wa-border-radius-l);
@@ -359,7 +399,7 @@ wa-page > main:has(> .index-grid) {
}
&::part(header) {
background-color: var(--wa-color-neutral-fill-quiet);
background-color: var(--header-background, var(--wa-color-neutral-fill-quiet));
border-bottom: none;
display: flex;
align-items: center;
@@ -382,15 +422,142 @@ wa-page > main:has(> .index-grid) {
/* Swatches */
.swatch {
position: relative;
display: flex;
align-items: center;
justify-content: center;
background-color: transparent;
border-color: var(--wa-color-neutral-border-normal);
border-style: var(--wa-border-style);
border-width: var(--wa-border-width-s);
border-radius: var(--wa-border-radius-m);
box-sizing: border-box;
line-height: 2.5;
height: 2.5em;
padding-inline: var(--wa-space-xs);
min-height: 2.5em;
padding: var(--wa-space-xs);
font-weight: var(--wa-font-weight-semibold);
line-height: var(--wa-line-height-condensed);
&.color {
border-color: transparent;
transition: background var(--wa-transition-slow);
background: linear-gradient(var(--color-2, transparent) 0% 100%) no-repeat border-box var(--color,);
background-position: var(--color-2-position, bottom);
background-size: var(--color-2-width, 100%) var(--color-2-height, 50%);
&.contrast-fail {
outline: 1px dashed var(--wa-color-red);
outline-offset: calc(-1 * var(--wa-space-2xs));
}
}
> wa-copy-button {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
--background-color-hover: transparent;
font-family: var(--wa-font-family-code);
&::part(button) {
display: block;
height: 100%;
width: 100%;
}
&::part(button):hover {
cursor: copy;
}
&::part(copy-icon),
&::part(success-icon),
&::part(error-icon) {
opacity: 0 !important;
}
}
}
table.colors {
thead {
th {
text-align: center;
padding-block: 0;
}
}
tbody {
tr {
border: none;
&:hover {
background: transparent;
}
}
th {
width: 0;
vertical-align: middle;
text-align: right;
}
td {
padding-inline: var(--wa-space-3xs);
padding-block: var(--wa-space-s);
}
}
.core-column {
padding-inline-end: var(--wa-space-xl);
}
}
.value-up,
.value-down {
position: relative;
&::after {
content: ' ' var(--icon);
position: absolute;
margin-inline-start: 3em;
scale: 1 0.6;
color: color-mix(in oklch, oklch(from var(--icon-color) none c h) 0%, oklch(from currentColor l none none));
font-size: 90%;
}
}
.value-down {
--icon: '▼';
--icon-color: var(--wa-color-danger-fill-quiet);
&::after {
margin-block-end: -0.2em;
}
}
.value-up {
--icon: '▲';
--icon-color: var(--wa-color-success-fill-quiet);
}
.icon-modifier {
position: relative;
display: inline-flex;
.modifier {
position: absolute;
bottom: -0.1em;
right: -0.3em;
font-size: 60%;
&::part(svg) {
stroke: var(--background-color, var(--wa-color-surface-default));
stroke-width: 100px;
paint-order: stroke;
overflow: visible;
stroke-linecap: round;
stroke-linejoin: round;
}
}
}
/* Layout Examples */
@@ -456,7 +623,7 @@ wa-page > main:has(> .index-grid) {
}
}
.layout-theme {
.page-wide {
wa-page > main {
max-width: 140ch;
@@ -464,7 +631,9 @@ wa-page > main:has(> .index-grid) {
max-width: 80ch;
}
}
}
.layout-theme {
iframe {
width: 100%;
min-height: 16lh;

View File

@@ -0,0 +1,34 @@
.theme-color-icon {
display: grid;
gap: var(--wa-space-xs);
grid-template-columns: repeat(4, auto);
div {
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
border-radius: var(--wa-border-radius-m);
background-color: var(--background-color);
border: var(--wa-border-width-s) var(--wa-border-style) var(--border-color);
padding: var(--wa-space-2xs) var(--wa-space-xs);
color: var(--text-color);
font-weight: var(--wa-font-weight-semibold);
&.plain {
font-weight: var(--wa-font-weight-bold);
}
}
}
.theme-typography-icon {
display: flex;
flex-direction: column;
gap: var(--wa-space-xs);
h3,
p {
margin-block: 0;
padding: 0;
}
}

View File

@@ -77,9 +77,9 @@ This example demonstrates all of the baked-in animations and easings. Animations
easingName.appendChild(option);
});
animationName.addEventListener('wa-change', () => (animation.name = animationName.value));
easingName.addEventListener('wa-change', () => (animation.easing = easingName.value));
playbackRate.addEventListener('wa-input', () => (animation.playbackRate = playbackRate.value));
animationName.addEventListener('change', () => (animation.name = animationName.value));
easingName.addEventListener('change', () => (animation.easing = easingName.value));
playbackRate.addEventListener('input', () => (animation.playbackRate = playbackRate.value));
</script>
<style>

View File

@@ -17,32 +17,39 @@ icon: button-group
### Button Sizes
All button sizes are supported, but avoid mixing sizes within the same button group.
Unless otherwise specified,
the size of [buttons](/docs/components/button) will be determined by the Button Group's `size` attribute.
```html {.example}
<wa-button-group label="Alignment">
<wa-button size="small">Left</wa-button>
<wa-button size="small">Center</wa-button>
<wa-button size="small">Right</wa-button>
<wa-button-group size="small" label="Alignment">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
<br /><br />
<wa-button-group label="Alignment">
<wa-button size="medium">Left</wa-button>
<wa-button size="medium">Center</wa-button>
<wa-button size="medium">Right</wa-button>
<wa-button-group size="medium" label="Alignment">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
<br /><br />
<wa-button-group label="Alignment">
<wa-button size="large">Left</wa-button>
<wa-button size="large">Center</wa-button>
<wa-button size="large">Right</wa-button>
<wa-button-group size="large" label="Alignment">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
```
:::info
While you can still set the size of [buttons](/docs/components/button) individually,
and it will override the inherited size,
it is rarely a good idea to mix sizes within the same button group.
:::
### Vertical button groups
Set the `orientation` attribute to `vertical` to make a vertical button group.
@@ -70,21 +77,21 @@ Set the `orientation` attribute to `vertical` to make a vertical button group.
### Theme Buttons
Theme buttons are supported through the button's `variant` attribute.
Theme buttons are supported through the button group's `variant` attribute.
```html {.example}
<wa-button-group label="Alignment">
<wa-button variant="brand">Left</wa-button>
<wa-button variant="brand">Center</wa-button>
<wa-button variant="brand">Right</wa-button>
<wa-button-group label="Alignment" variant="brand">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
<br /><br />
<wa-button-group label="Alignment">
<wa-button variant="success">Left</wa-button>
<wa-button variant="success">Center</wa-button>
<wa-button variant="success">Right</wa-button>
<wa-button-group label="Alignment" variant="success">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
<br /><br />
@@ -97,18 +104,28 @@ Theme buttons are supported through the button's `variant` attribute.
<br /><br />
<wa-button-group label="Alignment">
<wa-button variant="warning">Left</wa-button>
<wa-button variant="warning">Center</wa-button>
<wa-button variant="warning">Right</wa-button>
<wa-button-group label="Alignment" variant="warning">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
<br /><br />
<wa-button-group label="Alignment">
<wa-button variant="danger">Left</wa-button>
<wa-button variant="danger">Center</wa-button>
<wa-button variant="danger">Right</wa-button>
<wa-button-group label="Alignment" variant="danger">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button>Right</wa-button>
</wa-button-group>
```
You can still use the buttons own `variant` attribute to override the inherited variant.
```html {.example}
<wa-button-group label="Alignment" variant="brand">
<wa-button>Left</wa-button>
<wa-button>Center</wa-button>
<wa-button variant="neutral">Right</wa-button>
</wa-button-group>
```

View File

@@ -30,33 +30,43 @@ Use the `appearance` attribute to change the button's visual appearance.
```html {.example}
<div class="wa-stack">
<div class="wa-gap-m">
<div class="wa-gap-2xs">
<wa-button appearance="accent outlined" variant="neutral">A + O</wa-button>
<wa-button appearance="accent" variant="neutral">Accent</wa-button>
<wa-button appearance="outlined" variant="neutral">Outlined</wa-button>
<wa-button appearance="filled outlined" variant="neutral">F + O</wa-button>
<wa-button appearance="filled" variant="neutral">Filled</wa-button>
<wa-button appearance="plain" variant="neutral">Plain</wa-button>
</div>
<div class="wa-gap-m">
<div class="wa-gap-2xs">
<wa-button appearance="accent outlined" variant="brand">A + O</wa-button>
<wa-button appearance="accent" variant="brand">Accent</wa-button>
<wa-button appearance="outlined" variant="brand">Outlined</wa-button>
<wa-button appearance="filled outlined" variant="brand">F + O</wa-button>
<wa-button appearance="filled" variant="brand">Filled</wa-button>
<wa-button appearance="plain" variant="brand">Plain</wa-button>
</div>
<div class="wa-gap-m">
<div class="wa-gap-2xs">
<wa-button appearance="accent outlined" variant="success">A + O</wa-button>
<wa-button appearance="accent" variant="success">Accent</wa-button>
<wa-button appearance="outlined" variant="success">Outlined</wa-button>
<wa-button appearance="filled outlined" variant="success">F + O</wa-button>
<wa-button appearance="filled" variant="success">Filled</wa-button>
<wa-button appearance="plain" variant="success">Plain</wa-button>
</div>
<div class="wa-gap-m">
<div class="wa-gap-2xs">
<wa-button appearance="accent outlined" variant="warning">A + O</wa-button>
<wa-button appearance="accent" variant="warning">Accent</wa-button>
<wa-button appearance="outlined" variant="warning">Outlined</wa-button>
<wa-button appearance="filled outlined" variant="warning">F + O</wa-button>
<wa-button appearance="filled" variant="warning">Filled</wa-button>
<wa-button appearance="plain" variant="warning">Plain</wa-button>
</div>
<div class="wa-gap-m">
<div class="wa-gap-2xs">
<wa-button appearance="accent outlined" variant="danger">A + O</wa-button>
<wa-button appearance="accent" variant="danger">Accent</wa-button>
<wa-button appearance="outlined" variant="danger">Outlined</wa-button>
<wa-button appearance="filled outlined" variant="danger">F + O</wa-button>
<wa-button appearance="filled" variant="danger">Filled</wa-button>
<wa-button appearance="plain" variant="danger">Plain</wa-button>
</div>

View File

@@ -3,6 +3,7 @@ title: Callout
description: Callouts are used to display important messages inline.
tags: [feedback, content]
icon: callout
native: callout
---
```html {.example}

View File

@@ -19,13 +19,13 @@ icon: card
<div slot="footer">
<wa-button variant="brand" pill>More Info</wa-button>
<wa-rating></wa-rating>
<wa-rating label="Rating"></wa-rating>
</div>
</wa-card>
<style>
.card-overview {
max-width: 300px;
width: 300px;
}
.card-overview small {
@@ -143,3 +143,42 @@ If using SSR, you need to also use the `with-image` attribute to add an image to
}
</style>
```
### Sizing
Use the `size` attribute to change a card's size.
```html {.example}
<div class="wa-stack">
<wa-card with-footer size="small">
This is a small card.
<footer slot="footer" class="wa-flank">
<wa-button variant="brand" pill>More Info</wa-button>
<wa-rating></wa-rating>
</footer>
</wa-card>
<wa-card with-footer size="medium">
This is a medium card (default).
<footer slot="footer" class="wa-flank">
<wa-button variant="brand" pill>More Info</wa-button>
<wa-rating></wa-rating>
</footer>
</wa-card>
<wa-card with-footer size="large">
This is a large card.
<footer slot="footer" class="wa-flank">
<wa-button variant="brand" pill>More Info</wa-button>
<wa-rating></wa-rating>
</footer>
</wa-card>
</div>
```
<style>
</style>

View File

@@ -249,7 +249,7 @@ This example is best demonstrated using a mouse. Try clicking and dragging the s
const carousel = container.querySelector('wa-carousel');
const toggle = container.querySelector('wa-switch');
toggle.addEventListener('wa-change', () => {
toggle.addEventListener('change', () => {
carousel.toggleAttribute('mouse-dragging', toggle.checked);
});
</script>
@@ -450,7 +450,7 @@ Use the `--aspect-ratio` custom property to customize the size of the carousel's
const carousel = document.querySelector('wa-carousel.aspect-ratio');
const aspectRatio = document.querySelector('wa-select[name="aspect"]');
aspectRatio.addEventListener('wa-change', () => {
aspectRatio.addEventListener('change', () => {
carousel.style.setProperty('--aspect-ratio', aspectRatio.value);
});
})();

View File

@@ -73,4 +73,4 @@ if (name_search.value) {
filterByName(name_search.value);
}
name_search_group.addEventListener('wa-input', e => filterByName(name_search.value));
name_search_group.addEventListener('input', e => filterByName(name_search.value));

View File

@@ -82,7 +82,7 @@ Use the `setCustomValidity()` method to set a custom validation message. This wi
});
// Update validity on change
checkbox.addEventListener('wa-change', () => {
checkbox.addEventListener('change', () => {
checkbox.setCustomValidity(checkbox.checked ? '' : errorMessage);
});

View File

@@ -66,9 +66,11 @@ Use the `swatches` attribute to add convenient presets to the color picker. Any
Use the `size` attribute to change the color picker's trigger size.
```html {.example}
<wa-color-picker size="small" label="Select a color"></wa-color-picker>
<wa-color-picker size="medium" label="Select a color"></wa-color-picker>
<wa-color-picker size="large" label="Select a color"></wa-color-picker>
<div class="wa-gap-m wa-align-items-baseline">
<wa-color-picker size="small" label="Select a color"></wa-color-picker>
<wa-color-picker size="medium" label="Select a color"></wa-color-picker>
<wa-color-picker size="large" label="Select a color"></wa-color-picker>
</div>
```
### Disabled

View File

@@ -9,6 +9,10 @@ icon: copy-button
<wa-copy-button value="Web Awesome rocks!"></wa-copy-button>
```
:::info
Copy buttons use the browser's [`clipboard.writeText()`](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/writeText) method, which requires a [secure context](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts) (HTTPS) in most browsers.
:::
## Examples
### Custom Labels

View File

@@ -16,7 +16,7 @@ icon: format-bytes
const formatter = container.querySelector('wa-format-bytes');
const input = container.querySelector('wa-input');
input.addEventListener('wa-input', () => (formatter.value = input.value || 0));
input.addEventListener('input', () => (formatter.value = input.value || 0));
</script>
```

View File

@@ -19,7 +19,7 @@ Localization is handled by the browser's [`Intl.NumberFormat` API](https://devel
const formatter = container.querySelector('wa-format-number');
const input = container.querySelector('wa-input');
input.addEventListener('wa-input', () => (formatter.value = input.value || 0));
input.addEventListener('input', () => (formatter.value = input.value || 0));
</script>
```

View File

@@ -52,8 +52,8 @@ wa-page {
}
&[slot^='navigation'] {
background: var(--wa-color-violet-80);
color: var(--wa-color-violet-20);
background: var(--wa-color-purple-80);
color: var(--wa-color-purple-20);
}
strong {

View File

@@ -54,11 +54,11 @@ Popup is a low-level utility built specifically for positioning elements. Do not
const active = container.querySelector('wa-switch[name="active"]');
const arrow = container.querySelector('wa-switch[name="arrow"]');
select.addEventListener('wa-change', () => (popup.placement = select.value));
distance.addEventListener('wa-input', () => (popup.distance = distance.value));
skidding.addEventListener('wa-input', () => (popup.skidding = skidding.value));
active.addEventListener('wa-change', () => (popup.active = active.checked));
arrow.addEventListener('wa-change', () => (popup.arrow = arrow.checked));
select.addEventListener('change', () => (popup.placement = select.value));
distance.addEventListener('input', () => (popup.distance = distance.value));
skidding.addEventListener('input', () => (popup.skidding = skidding.value));
active.addEventListener('change', () => (popup.active = active.checked));
arrow.addEventListener('change', () => (popup.arrow = arrow.checked));
</script>
<style>
@@ -145,7 +145,7 @@ Popups are inactive and hidden until the `active` attribute is applied. Removing
const popup = container.querySelector('wa-popup');
const active = container.querySelector('wa-switch');
active.addEventListener('wa-change', () => (popup.active = active.checked));
active.addEventListener('change', () => (popup.active = active.checked));
</script>
```
@@ -233,7 +233,7 @@ Since placement is preferred when using `flip`, you can observe the popup's curr
const popup = container.querySelector('wa-popup');
const select = container.querySelector('wa-select');
select.addEventListener('wa-change', () => (popup.placement = select.value));
select.addEventListener('change', () => (popup.placement = select.value));
</script>
```
@@ -277,7 +277,7 @@ Use the `distance` attribute to change the distance between the popup and its an
const popup = container.querySelector('wa-popup');
const distance = container.querySelector('wa-slider');
distance.addEventListener('wa-input', () => (popup.distance = distance.value));
distance.addEventListener('input', () => (popup.distance = distance.value));
</script>
```
@@ -321,7 +321,7 @@ The `skidding` attribute is similar to `distance`, but instead allows you to off
const popup = container.querySelector('wa-popup');
const skidding = container.querySelector('wa-slider');
skidding.addEventListener('wa-input', () => (popup.skidding = skidding.value));
skidding.addEventListener('input', () => (popup.skidding = skidding.value));
</script>
```
@@ -409,9 +409,9 @@ By default, the arrow will be aligned as close to the center of the _anchor_ as
const arrowPlacement = container.querySelector('[name="arrow-placement"]');
const arrow = container.querySelector('[name="arrow"]');
placement.addEventListener('wa-change', () => (popup.placement = placement.value));
arrowPlacement.addEventListener('wa-change', () => (popup.arrowPlacement = arrowPlacement.value));
arrow.addEventListener('wa-change', () => (popup.arrow = arrow.checked));
placement.addEventListener('change', () => (popup.placement = placement.value));
arrowPlacement.addEventListener('change', () => (popup.arrowPlacement = arrowPlacement.value));
arrow.addEventListener('change', () => (popup.arrow = arrow.checked));
</script>
</div>
```
@@ -464,7 +464,7 @@ Use the `sync` attribute to make the popup the same width or height as the ancho
const fixed = container.querySelector('wa-switch');
const sync = container.querySelector('wa-select');
sync.addEventListener('wa-change', () => (popup.sync = sync.value));
sync.addEventListener('change', () => (popup.sync = sync.value));
</script>
```
@@ -523,7 +523,7 @@ Toggle the switch and scroll the container to see the difference.
const popup = container.querySelector('wa-popup');
const fixed = container.querySelector('wa-switch');
fixed.addEventListener('wa-change', () => (popup.strategy = fixed.checked ? 'fixed' : 'absolute'));
fixed.addEventListener('change', () => (popup.strategy = fixed.checked ? 'fixed' : 'absolute'));
</script>
```
@@ -575,7 +575,7 @@ Scroll the container to see how the popup flips to prevent clipping.
const popup = container.querySelector('wa-popup');
const flip = container.querySelector('wa-switch');
flip.addEventListener('wa-change', () => (popup.flip = flip.checked));
flip.addEventListener('change', () => (popup.flip = flip.checked));
</script>
```
@@ -670,7 +670,7 @@ Toggle the switch to see the difference.
const popup = container.querySelector('wa-popup');
const shift = container.querySelector('wa-switch');
shift.addEventListener('wa-change', () => (popup.shift = shift.checked));
shift.addEventListener('change', () => (popup.shift = shift.checked));
</script>
```
@@ -731,7 +731,7 @@ Scroll the container to see the popup resize as its available space changes.
const popup = container.querySelector('wa-popup');
const autoSize = container.querySelector('wa-switch');
autoSize.addEventListener('wa-change', () => (popup.autoSize = autoSize.checked ? 'both' : ''));
autoSize.addEventListener('change', () => (popup.autoSize = autoSize.checked ? 'both' : ''));
</script>
```
@@ -782,9 +782,9 @@ When a gap exists between the anchor and the popup element, this option will add
const hoverBridge = container.querySelector('wa-switch');
const distance = container.querySelector('wa-slider[label="Distance"]');
const skidding = container.querySelector('wa-slider[label="Skidding"]');
distance.addEventListener('wa-input', () => (popup.distance = distance.value));
skidding.addEventListener('wa-input', () => (popup.skidding = skidding.value));
hoverBridge.addEventListener('wa-change', () => (popup.hoverBridge = hoverBridge.checked));
distance.addEventListener('input', () => (popup.distance = distance.value));
skidding.addEventListener('input', () => (popup.skidding = skidding.value));
hoverBridge.addEventListener('change', () => (popup.hoverBridge = hoverBridge.checked));
</script>
```
@@ -837,7 +837,7 @@ This example anchors a popup to the mouse cursor using a virtual element. As suc
};
// Only activate the popup when the switch is checked
enabled.addEventListener('wa-change', () => {
enabled.addEventListener('change', () => {
popup.active = enabled.checked;
});

View File

@@ -24,7 +24,7 @@ QR codes are useful for providing small pieces of information to users who can q
customElements.whenDefined('wa-qr-code').then(() => {
input.value = qrCode.value;
input.addEventListener('wa-input', () => (qrCode.value = input.value));
input.addEventListener('input', () => (qrCode.value = input.value));
});
</script>

View File

@@ -9,7 +9,7 @@ icon: radio-group
Radio buttons are designed to be used with [radio groups](/docs/components/radio-group). When a radio button has focus, the arrow keys can be used to change the selected option just like standard radio controls.
```html {.example}
<wa-radio-group label="Select an option" name="a" value="1">
<wa-radio-group label="Select an option" orientation="horizontal" name="a" value="1">
<wa-radio-button value="1">Option 1</wa-radio-button>
<wa-radio-button value="2">Option 2</wa-radio-button>
<wa-radio-button value="3">Option 3</wa-radio-button>
@@ -23,7 +23,7 @@ Radio buttons are designed to be used with [radio groups](/docs/components/radio
To set the initial value and checked state, use the `value` attribute on the containing radio group.
```html {.example}
<wa-radio-group label="Select an option" name="a" value="1">
<wa-radio-group label="Select an option" orientation="horizontal" name="a" value="1">
<wa-radio-button value="1">Option 1</wa-radio-button>
<wa-radio-button value="2">Option 2</wa-radio-button>
<wa-radio-button value="3">Option 3</wa-radio-button>
@@ -35,7 +35,7 @@ To set the initial value and checked state, use the `value` attribute on the con
Use the `disabled` attribute to disable a radio button.
```html {.example}
<wa-radio-group label="Select an option" name="a" value="1">
<wa-radio-group label="Select an option" orientation="horizontal" name="a" value="1">
<wa-radio-button value="1">Option 1</wa-radio-button>
<wa-radio-button value="2" disabled>Option 2</wa-radio-button>
<wa-radio-button value="3">Option 3</wa-radio-button>
@@ -47,7 +47,7 @@ Use the `disabled` attribute to disable a radio button.
Use the `size` attribute to change a radio button's size.
```html {.example}
<wa-radio-group size="small" label="Select an option" name="a" value="1">
<wa-radio-group size="small" label="Select an option" orientation="horizontal" name="a" value="1">
<wa-radio-button value="1">Option 1</wa-radio-button>
<wa-radio-button value="2">Option 2</wa-radio-button>
<wa-radio-button value="3">Option 3</wa-radio-button>
@@ -55,7 +55,7 @@ Use the `size` attribute to change a radio button's size.
<br />
<wa-radio-group size="medium" label="Select an option" name="a" value="1">
<wa-radio-group size="medium" label="Select an option" orientation="horizontal" name="a" value="1">
<wa-radio-button value="1">Option 1</wa-radio-button>
<wa-radio-button value="2">Option 2</wa-radio-button>
<wa-radio-button value="3">Option 3</wa-radio-button>
@@ -63,7 +63,7 @@ Use the `size` attribute to change a radio button's size.
<br />
<wa-radio-group size="large" label="Select an option" name="a" value="1">
<wa-radio-group size="large" label="Select an option" orientation="horizontal" name="a" value="1">
<wa-radio-button value="1">Option 1</wa-radio-button>
<wa-radio-button value="2">Option 2</wa-radio-button>
<wa-radio-button value="3">Option 3</wa-radio-button>
@@ -75,7 +75,7 @@ Use the `size` attribute to change a radio button's size.
Use the `pill` attribute to give radio buttons rounded edges.
```html {.example}
<wa-radio-group size="small" label="Select an option" name="a" value="1">
<wa-radio-group size="small" label="Select an option" orientation="horizontal" name="a" value="1">
<wa-radio-button pill value="1">Option 1</wa-radio-button>
<wa-radio-button pill value="2">Option 2</wa-radio-button>
<wa-radio-button pill value="3">Option 3</wa-radio-button>
@@ -83,7 +83,7 @@ Use the `pill` attribute to give radio buttons rounded edges.
<br />
<wa-radio-group size="medium" label="Select an option" name="a" value="1">
<wa-radio-group size="medium" label="Select an option" orientation="horizontal" name="a" value="1">
<wa-radio-button pill value="1">Option 1</wa-radio-button>
<wa-radio-button pill value="2">Option 2</wa-radio-button>
<wa-radio-button pill value="3">Option 3</wa-radio-button>
@@ -91,7 +91,7 @@ Use the `pill` attribute to give radio buttons rounded edges.
<br />
<wa-radio-group size="large" label="Select an option" name="a" value="1">
<wa-radio-group size="large" label="Select an option" orientation="horizontal" name="a" value="1">
<wa-radio-button pill value="1">Option 1</wa-radio-button>
<wa-radio-button pill value="2">Option 2</wa-radio-button>
<wa-radio-button pill value="3">Option 3</wa-radio-button>
@@ -103,7 +103,7 @@ Use the `pill` attribute to give radio buttons rounded edges.
Use the `prefix` and `suffix` slots to add icons.
```html {.example}
<wa-radio-group label="Select an option" name="a" value="1">
<wa-radio-group label="Select an option" orientation="horizontal" name="a" value="1">
<wa-radio-button value="1">
<wa-icon slot="prefix" name="archive" variant="solid"></wa-icon>
Option 1
@@ -127,7 +127,7 @@ Use the `prefix` and `suffix` slots to add icons.
You can omit button labels and use icons instead. Make sure to set a `label` attribute on each icon so screen readers will announce each option correctly.
```html {.example}
<wa-radio-group label="Select an option" name="a" value="neutral">
<wa-radio-group label="Select an option" orientation="horizontal" name="a" value="neutral">
<wa-radio-button value="angry">
<wa-icon name="face-angry" variant="solid" label="Angry"></wa-icon>
</wa-radio-button>

View File

@@ -32,7 +32,28 @@ Add descriptive hint to a radio group with the `hint` attribute. For hints that
[Radio buttons](/docs/components/radio-button) offer an alternate way to display radio controls. In this case, an internal [button group](/docs/components/button-group) is used to group the buttons into a single, cohesive control.
```html {.example}
<wa-radio-group label="Select an option" hint="Select an option that makes you proud." name="a" value="1">
<wa-radio-group
label="Horizontal options"
hint="Select an option that makes you proud."
orientation="horizontal"
name="a"
value="1"
>
<wa-radio-button value="1">Option 1</wa-radio-button>
<wa-radio-button value="2">Option 2</wa-radio-button>
<wa-radio-button value="3">Option 3</wa-radio-button>
</wa-radio-group>
<br>
<wa-radio-group
label="Vertical options"
hint="Select an option that makes you proud."
orientation="vertical"
name="a"
value="1"
style="max-width: 300px;"
>
<wa-radio-button value="1">Option 1</wa-radio-button>
<wa-radio-button value="2">Option 2</wa-radio-button>
<wa-radio-button value="3">Option 3</wa-radio-button>
@@ -51,28 +72,39 @@ Radios and radio buttons can be disabled by adding the `disabled` attribute to t
</wa-radio-group>
```
### Orientation
The default orientation for radio items is `vertical`. Set the `orientation` to `horizontal` to items on the same row.
```html {.example}
<wa-radio-group
label="Select an option"
hint="Choose the most appropriate option."
orientation="horizontal"
name="a"
value="1"
>
<wa-radio value="1">Option 1</wa-radio>
<wa-radio value="2">Option 2</wa-radio>
<wa-radio value="3">Option 3</wa-radio>
</wa-radio-group>
```
### Sizing Options
The size of [Radios](/docs/components/radio) and [Radio Buttons](/docs/components/radio-buttons) will be determined by the Radio Group's `size` attribute.
The size of [Radios](/docs/components/radio) and [Radio Buttons](/docs/components/radio-button) will be determined by the Radio Group's `size` attribute.
```html preview
<wa-radio-group label="Select an option" size="medium" value="medium" class="radio-group-size">
```html {.example}
<wa-radio-group label="Select an option" size="medium" value="medium" onchange="this.size = this.value">
<wa-radio value="small">Small</wa-radio>
<wa-radio value="medium">Medium</wa-radio>
<wa-radio value="large">Large</wa-radio>
</wa-radio-group>
<script>
const radioGroup = document.querySelector('.radio-group-size');
radioGroup.addEventListener('wa-change', () => {
radioGroup.size = radioGroup.value;
});
</script>
```
:::info
[Radios](/docs/components/radio) and [Radio Buttons](/docs/components/radio-button) also have a `size` attribute. This can be useful in certain compositions, but it will be ignored when used inside of a Radio Group.
[Radios](/docs/components/radio) and [Radio Buttons](/docs/components/radio-button) also have a `size` attribute,
which will override the inherited size when used.
:::
### Validation
@@ -127,7 +159,7 @@ Use the `setCustomValidity()` method to set a custom validation message. This wi
});
// Update validity when a selection is made
form.addEventListener('wa-change', () => {
form.addEventListener('change', () => {
const isValid = radioGroup.value === '3';
radioGroup.setCustomValidity(isValid ? '' : errorMessage);
});

View File

@@ -11,8 +11,8 @@ Radios are designed to be used with [radio groups](/docs/components/radio-group)
```html {.example}
<wa-radio-group label="Select an option" name="a" value="1">
<wa-radio value="1">Option 1</wa-radio><br>
<wa-radio value="2">Option 2</wa-radio><br>
<wa-radio value="1">Option 1</wa-radio>
<wa-radio value="2">Option 2</wa-radio>
<wa-radio value="3">Option 3</wa-radio>
</wa-radio-group>
```
@@ -29,8 +29,8 @@ To set the initial value and checked state, use the `value` attribute on the con
```html {.example}
<wa-radio-group label="Select an option" name="a" value="3">
<wa-radio value="1">Option 1</wa-radio><br>
<wa-radio value="2">Option 2</wa-radio><br>
<wa-radio value="1">Option 1</wa-radio>
<wa-radio value="2">Option 2</wa-radio>
<wa-radio value="3">Option 3</wa-radio>
</wa-radio-group>
```
@@ -41,8 +41,8 @@ Use the `disabled` attribute to disable a radio.
```html {.example}
<wa-radio-group label="Select an option" name="a" value="1">
<wa-radio value="1">Option 1</wa-radio><br>
<wa-radio value="2" disabled>Option 2</wa-radio><br>
<wa-radio value="1">Option 1</wa-radio>
<wa-radio value="2" disabled>Option 2</wa-radio>
<wa-radio value="3">Option 3</wa-radio>
</wa-radio-group>
```
@@ -53,24 +53,36 @@ Add the `size` attribute to the [Radio Group](/docs/components/radio-group) to c
```html {.example}
<wa-radio-group size="small" value="1">
<wa-radio value="1">Small 1</wa-radio><br>
<wa-radio value="2">Small 2</wa-radio><br>
<wa-radio value="1">Small 1</wa-radio>
<wa-radio value="2">Small 2</wa-radio>
<wa-radio value="3">Small 3</wa-radio>
</wa-radio-group>
<br />
<wa-radio-group size="medium" value="1">
<wa-radio value="1">Medium 1</wa-radio><br>
<wa-radio value="2">Medium 2</wa-radio><br>
<wa-radio value="1">Medium 1</wa-radio>
<wa-radio value="2">Medium 2</wa-radio>
<wa-radio value="3">Medium 3</wa-radio>
</wa-radio-group>
<br />
<wa-radio-group size="large" value="1">
<wa-radio value="1">Large 1</wa-radio><br>
<wa-radio value="2">Large 2</wa-radio><br>
<wa-radio value="1">Large 1</wa-radio>
<wa-radio value="2">Large 2</wa-radio>
<wa-radio value="3">Large 3</wa-radio>
</wa-radio-group>
```
### Hint
Add descriptive hint to a switch with the `hint` attribute. For hints that contain HTML, use the `hint` slot instead.
```html {.example}
<wa-radio-group label="Select an option" name="a" value="1">
<wa-radio value="1" hint="What should the user know about radio 1?">Option 1</wa-radio>
<wa-radio value="2" hint="What should the user know about radio 2?">Option 2</wa-radio>
<wa-radio value="3" hint="What should the user know about radio 3?">Option 3</wa-radio>
</wa-radio-group>
```

View File

@@ -35,12 +35,20 @@ Use the `precision` attribute to let users select fractional ratings.
<wa-rating label="Rating" precision="0.5" value="2.5"></wa-rating>
```
### Symbol Sizes
### Sizing
Set the `--symbol-size` custom property to adjust the size.
Use the `size` attribute to adjust the size of the rating.
```html {.example}
<wa-rating label="Rating" style="--symbol-size: 2rem;"></wa-rating>
<wa-rating label="Rating" size="small"></wa-rating><br>
<wa-rating label="Rating" size="medium"></wa-rating><br>
<wa-rating label="Rating" size="large"></wa-rating>
```
For more granular sizing, you can use the `font-size` property.
```html {.example}
<wa-rating label="Rating" style="font-size: 2rem;"></wa-rating>
```
### Readonly

View File

@@ -130,6 +130,15 @@ Note that multi-select options may wrap, causing the control to expand verticall
Use the `value` attribute to set the initial selection.
```html {.example}
<wa-select value="option-1">
<wa-option value="option-1">Option 1</wa-option>
<wa-option value="option-2">Option 2</wa-option>
<wa-option value="option-3">Option 3</wa-option>
<wa-option value="option-4">Option 4</wa-option>
</wa-select>
```
When using `multiple`, the `value` _attribute_ uses space-delimited values to select more than one option. Because of this, `<wa-option>` values cannot contain spaces. If you're accessing the `value` _property_ through Javascript, it will be an array.
```html {.example}
@@ -294,7 +303,7 @@ Remember that custom tags are rendered in a shadow root. To style them, you can
return `
<wa-tag removable>
<wa-icon name="${name}" style="padding-inline-end: .5rem;"></wa-icon>
${option.getTextLabel()}
${option.label}
</wa-tag>
`;
};
@@ -420,5 +429,7 @@ This can be hard to conceptualize, so heres a fairly large example showing how l
//
// TODO - remove once we switch to the Popover API
//
document.querySelectorAll('wa-code-demo [slot="preview"] wa-select').forEach(select => select.hoist = true);
customElements.whenDefined('wa-select').then(() => {
document.querySelectorAll('wa-code-demo [slot="preview"] wa-select').forEach(select => select.hoist = true);
});
</script>

View File

@@ -208,7 +208,7 @@ Try resizing the example below with each option and notice how the panels respon
const splitPanel = container.querySelector('wa-split-panel');
const select = container.querySelector('wa-select');
select.addEventListener('wa-change', () => (splitPanel.primary = select.value));
select.addEventListener('change', () => (splitPanel.primary = select.value));
</script>
```

View File

@@ -7,7 +7,11 @@ native: input
---
```html {.example}
<wa-textarea></wa-textarea>
<form action="about:blank" target="_blank">
<wa-textarea label="Type something', will ya" name="a" value="no"></wa-textarea>
<button type="submit">Submit</button>
</form>
```
:::info

View File

@@ -88,7 +88,7 @@ The `selection` attribute lets you change the selection behavior of the tree.
const selectionMode = document.querySelector('#selection-mode');
const tree = document.querySelector('.tree-selectable');
selectionMode.addEventListener('wa-change', () => {
selectionMode.addEventListener('change', () => {
tree.querySelectorAll('wa-tree-item').forEach(item => (item.selected = false));
tree.selection = selectionMode.value;
});

View File

@@ -1,41 +1,49 @@
---
title: Customizing
description: Learn how to customize Web Awesome through parts and custom properties.
description: Learn how to customize Web Awesome through themes, parts, and custom properties.
layout: page-outline
---
Web Awesome components can be customized at a high level through a theming API. This gives you control over theme colors and general styling. For more advanced customizations, you can make use of CSS parts and custom properties to target individual components.
You can customize the look and feel of Web Awesome at a high level with themes. For more advanced customizations, you can make use of CSS parts and custom properties to target individual components.
## Themes
Web Awesome uses numerous CSS custom properties that make up a high-level theming API and provide a consistent look and feel across the entire library. You can customize them and use them in your own application just with CSS — no preprocessor required.
Web Awesome uses [themes](/docs/themes) to apply a cohesive look and feel across the entire library. Themes are built with a collection of predefined CSS custom properties, which we call [design tokens](/docs/tokens), and there are many premade themes you can choose from.
Because these custom properties live at the page level, they're prefixed with `--wa-` to avoid collisions with other libraries or your own custom properties.
To use a theme, simply add a link to the theme's stylesheet to the `<head>` of your page. For example, you can replace the link to `default.css` in the [installation code](/docs/installation/#quick-start-autoloading-via-cdn) with this snippet to use the *Awesome* theme:
To customize a theme, simply override any of these custom properties in your own stylesheet by scoping your styles to `:root`, `:host`, and, if needed, the class for the specific theme you want to override. Here's an example that changes the default brand color (blue) to violet in the light theme using existing [literal colors](/docs/theming/color/#literal-colors).
```html
<link rel="stylesheet" href="{% cdnUrl 'styles/themes/awesome.css' %}" />
```
You can [customize any theme](/docs/themes/creating) just with CSS — no preprocessor required. All design tokens are prefixed with `--wa-` to avoid collisions with other libraries or your own custom properties. Simply override any design token in your own stylesheet by scoping your styles to `:where(:root)`, `:host`, the class for the specific theme you want to override (if needed), and the class for the relevant color scheme (if needed). Here's an example that changes the default brand color to purple in light mode:
```css
:where(:root),
:host,
.wa-theme-default {
/* Changes the brand color to violet across the library */
--wa-color-brand-fill-quiet: var(--wa-color-violet-95);
--wa-color-brand-fill-normal: var(--wa-color-violet-90);
--wa-color-brand-fill-loud: var(--wa-color-violet-50);
--wa-color-brand-border-quiet: var(--wa-color-violet-90);
--wa-color-brand-border-normal: var(--wa-color-violet-80);
--wa-color-brand-border-loud: var(--wa-color-violet-60);
--wa-color-brand-on-quiet: var(--wa-color-violet-40);
--wa-color-brand-on-normal: var(--wa-color-violet-30);
.wa-light,
.wa-dark .wa-invert {
--wa-color-brand-fill-quiet: var(--wa-color-purple-95);
--wa-color-brand-fill-normal: var(--wa-color-purple-90);
--wa-color-brand-fill-loud: var(--wa-color-purple-50);
--wa-color-brand-border-quiet: var(--wa-color-purple-90);
--wa-color-brand-border-normal: var(--wa-color-purple-80);
--wa-color-brand-border-loud: var(--wa-color-purple-60);
--wa-color-brand-on-quiet: var(--wa-color-purple-40);
--wa-color-brand-on-normal: var(--wa-color-purple-30);
--wa-color-brand-on-loud: white;
}
```
For more examples and further guidance, refer to [Themes](/docs/themes) and the Theming section of this documentation. For a complete list of all custom properties used for theming, refer to `src/styles/themes/default.css` in the project's source code.
:::info
Wrapping the `:root` selector in `:where()` gives this selector 0 specificity. This allows us to define our design tokens' default values while ensuring they can be cleanly overridden as needed.
:::
For a complete list of all custom properties used for theming, refer to `src/styles/themes/default.css` in the project's source code.
## Components
Whereas a theme offers a high-level way to customize the library, components offer different hooks as a low-level way to customize them individually.
While themes offer a high-level way to customize the library, components offer different hooks as a low-level way to customize them individually.
Web Awesome components use a [shadow DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM) to encapsulate their styles and behaviors. As a result, you can't simply target their internals with the usual CSS selectors. Instead, components expose a set of custom properties and CSS parts that can be targeted to customize their appearance.
@@ -91,8 +99,8 @@ Parts allow you to style *any* standard CSS property, not just those exposed thr
<style>
.gradient-button::part(base) {
background: linear-gradient(217deg, var(--wa-color-indigo-50), var(--wa-color-violet-50), var(--wa-color-red-50));
border: solid 1px var(--wa-color-violet-50);
background: linear-gradient(217deg, var(--wa-color-indigo-50), var(--wa-color-purple-50), var(--wa-color-red-50));
border: solid 1px var(--wa-color-purple-50);
transition: transform 100ms, box-shadow 100ms;
}
@@ -122,3 +130,77 @@ CSS parts have a few important advantages:
- It encourages us to think more about how components are designed and how customizations should be allowed before users can take advantage of them. Once we opt a part into the component's API, it's guaranteed to be supported and can't be removed until a major version of the library is released.
Most (but not all) components expose parts. You can find them in each component's API documentation under the "CSS Parts" section.
## Native Elements
If you're using [native styles](/docs/native), any custom styles added for a component should also target the corresponding native element. In general, the same styles you declare for components will work just the same to style their native counterparts.
For example, we can give `<input type="checkbox">` the same custom styles as `<wa-checkbox>` by using the custom properties required to style the component:
```html {.example}
<wa-checkbox class="pinkify">Web Awesome checkbox</wa-checkbox>
<br />
<label>
<input type="checkbox" class="pinkify" />
HTML checkbox
</label>
<style>
wa-checkbox.pinkify,
input[type="checkbox"].pinkify {
--background-color-checked: hotpink;
--border-color-checked: hotpink;
--border-width: 3px;
--checked-icon-color: lavenderblush;
}
</style>
```
Or, if using CSS parts, we can give both checkboxes the same custom styles using standard CSS properties:
```html {.example}
<wa-checkbox class="purpleify">Web Awesome checkbox</wa-checkbox>
<br />
<label>
<input type="checkbox" class="purpleify" />
HTML checkbox
</label>
<style>
wa-checkbox.purpleify::part(control),
input[type="checkbox"].purpleify {
border-width: 3px;
}
wa-checkbox.purpleify:state(checked)::part(control),
input[type="checkbox"].purpleify:checked {
background-color: darkorchid;
border-color: darkorchid;
color: lavender;
}
</style>
```
## Style Utilities
Similarly, if you're using [style utilities](/docs/utilities), any custom styles added for a specific attribute variation of a component — such as `appearance`, `variant`, or `size` — should also target the corresponding style utility class. This ensures that the attribute and its utility class counterpart work interchangeably.
For example, we can give all outlined callouts a thick left border, regardless of whether they are styled with `appearance="outlined"` or `class="wa-outlined"`:
```html {.example}
<wa-callout appearance="outlined filled">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Here's a callout with <code>appearance="outlined"</code>
</wa-callout>
<wa-callout class="wa-outlined wa-filled">
<wa-icon slot="icon" name="circle-star"></wa-icon>
Here's a callout with <code>class="wa-outlined"</code>
</wa-callout>
<style>
wa-callout:is(
[appearance~="outlined"],
.wa-outlined
) {
border-left-width: var(--wa-panel-border-radius);
}
</style>
```

View File

@@ -0,0 +1,47 @@
---
title: Clamped brand tokens
layout: block
---
{% set tints = ['40-max', '50-max', '60-max', '40-min', '50-min', '60-min'] %}
{% for hue in hues %}
<link href="/dist/styles/brand/{{ hue }}.css" rel="stylesheet">
{% endfor %}
<table class="colors">
<thead>
<tr>
<th></th>
<th class="core-column">Core tint</th>
{% for tint in tints -%}
<th>{{ tint }}</th>
{%- endfor %}
</tr>
</thead>
{% for hue in hues -%}
<tr class="wa-brand-{{ hue }}">
<th>{{ hue | capitalize }}</th>
<td class="core-column">
<div class="color swatch" style="background-color: var(--wa-color-brand); color: var(--wa-color-brand-on);">
{{ palettes[paletteId][hue].maxChromaTint }}
<wa-copy-button value="--wa-color-brand" copy-label="--wa-color-brand"></wa-copy-button>
</div>
</td>
{% for tint in tints -%}
<td>
<div class="color swatch" style="background-color: var(--wa-color-brand-{{ tint }})">
<wa-copy-button value="--wa-color-brand-{{ tint }}" copy-label="--wa-color-brand-{{ tint }}"></wa-copy-button>
</div>
</td>
{%- endfor -%}
</tr>
{%- endfor %}
</table>
<style>
.core-column .color.swatch::before {
counter-reset: key var(--wa-color-brand-key);
content: counter(key);
}
</style>

View File

@@ -0,0 +1,84 @@
---
title: Inheritance & Default value tests
wide: true
---
## Variant
{%- set variantDefaults = {
button: 'neutral',
tag: 'neutral',
badge: 'brand',
callout: 'brand'
} %}
{%- set variants = ['', 'neutral', 'brand'] %}
### Defaults
```html {.example}
<table>
<thead>
<tr>
<th>Element</th>
<th>Default</th>
<th>Neutral</th>
<th>Brand</th>
</tr>
</thead>
{% for element, default in variantDefaults %}
<tr>
<th>{{ element | capitalize }}</th>
<td><wa-{{ element }}>{{ default | capitalize }}</wa-{{ element }}></td>
<td><wa-{{ element }} variant="neutral">Neutral</wa-{{ element }}></td>
<td><wa-{{ element }} variant="brand">Brand</wa-{{ element }}></td>
</tr>
{% endfor %}
</table>
```
### Nested elements
{% set containers = [
{parent: 'callout', child: 'button'},
{parent: 'callout', child: 'callout'},
{parent: 'button', child: 'badge'}
] %}
{% for container in containers %}
{% set parent = container.parent %}
{% set child = container.child %}
#### {{ child | capitalize }} in {{ parent | capitalize }}
```html {.example}
<table>
<thead>
<tr>
{% if parent == child -%}
<th>👇 Parent / Child 👉</th>
{% else %}
<th>👇 {{ parent | capitalize }} / {{ child | capitalize }} 👉</th>
{%- endif %}
<th>Default</th>
<th>Neutral</th>
<th>Brand</th>
</tr>
</thead>
{% for parentVariant in variants %}
{% set parentContent = (parentVariant | capitalize or 'Default') if parent == 'button' %}
<tr>
<th>{{ parentVariant | capitalize or 'Default' }}</th>
{% for childVariant in variants -%}
{% set childContent = (childVariant or parentVariant or variantDefaults[child]) | capitalize %}
{% set childContent = childContent[0] if child == 'badge' else childContent %}
<td><wa-{{ parent }}{{ parentVariant | attr('variant') }}>
{{ parentContent }}
<wa-{{ child }}{{ childVariant | attr('variant') }}>{{ childContent }}</wa-{{ child }}>
</wa-{{ parent }}></td>
{% endfor %}
</tr>
{% endfor %}
</table>
```
{% endfor %}

View File

@@ -1,352 +0,0 @@
---
title: Theming Sandbox
description: TODO
layout: page-outline
---
## Card
```html {.example}
<wa-card with-image with-footer class="card-overview">
<img
slot="image"
src="https://images.unsplash.com/photo-1559209172-0ff8f6d49ff7?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=500&q=80"
alt="A kitten sits patiently between a terracotta pot and decorative grasses."
/>
<strong>Mittens</strong><br />
This kitten is as cute as he is playful. Bring him home today!<br />
<small>6 weeks old</small>
<div slot="footer">
<wa-button variant="brand" pill>More Info</wa-button>
<wa-rating></wa-rating>
</div>
</wa-card>
<style>
.card-overview {
max-width: 300px;
}
.card-overview small {
color: var(--wa-color-text-quiet);
}
.card-overview [slot='footer'] {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>
```
## Alerts
```html {.example}
<wa-callout variant="brand">
<wa-icon slot="icon" name="circle-info" variant="regular"></wa-icon>
<strong>This is super informative</strong><br />
You can tell by how pretty the alert is.
</wa-callout>
<br />
<wa-callout variant="success">
<wa-icon slot="icon" name="circle-check" variant="regular"></wa-icon>
<strong>Your changes have been saved</strong><br />
You can safely exit the app now.
</wa-callout>
<br />
<wa-callout variant="neutral">
<wa-icon slot="icon" name="gear" variant="regular"></wa-icon>
<strong>Your settings have been updated</strong><br />
Settings will take affect on next login.
</wa-callout>
<br />
<wa-callout variant="warning">
<wa-icon slot="icon" name="triangle-exclamation" variant="regular"></wa-icon>
<strong>Your session has ended</strong><br />
Please login again to continue.
</wa-callout>
<br />
<wa-callout variant="danger">
<wa-icon slot="icon" name="circle-exclamation" variant="regular"></wa-icon>
<strong>Your account has been deleted</strong><br />
We're very sorry to see you go!
</wa-callout>
```
## Badges and Tags
```html {.example}
<wa-badge variant="brand">Brand</wa-badge>
<wa-badge variant="success">Success</wa-badge>
<wa-badge variant="neutral">Neutral</wa-badge>
<wa-badge variant="warning">Warning</wa-badge>
<wa-badge variant="danger">Danger</wa-badge>
<br />
<wa-tag variant="brand">Brand</wa-tag>
<wa-tag variant="success">Success</wa-tag>
<wa-tag variant="neutral">Neutral</wa-tag>
<wa-tag variant="warning">Warning</wa-tag>
<wa-tag variant="danger">Danger</wa-tag>
```
## Buttons
```html {.example}
<wa-button variant="brand">Brand</wa-button>
<wa-button variant="success">Success</wa-button>
<wa-button variant="neutral">Neutral</wa-button>
<wa-button variant="warning">Warning</wa-button>
<wa-button variant="danger">Danger</wa-button>
<br /><br />
<wa-button variant="brand" appearance="outlined">Brand</wa-button>
<wa-button variant="success" appearance="outlined">Success</wa-button>
<wa-button variant="neutral" appearance="outlined">Neutral</wa-button>
<wa-button variant="warning" appearance="outlined">Warning</wa-button>
<wa-button variant="danger" appearance="outlined">Danger</wa-button>
<br /><br />
<wa-button appearance="plain">Text</wa-button>
<br /><br />
<wa-radio-group label="Radio button group" name="a" value="1">
<wa-radio-button value="1">Option 1</wa-radio-button>
<wa-radio-button value="2">Option 2</wa-radio-button>
<wa-radio-button value="3">Option 3</wa-radio-button>
</wa-radio-group>
```
## Form controls
```html {.example}
<wa-checkbox>Unchecked</wa-checkbox>
<br />
<wa-checkbox checked>Checked</wa-checkbox>
<br /><br />
<wa-radio-group label="Radio" name="a" value="1">
<wa-radio value="1">Option 1</wa-radio>
<wa-radio value="2">Option 2</wa-radio>
<wa-radio value="3">Option 3</wa-radio>
</wa-radio-group>
<br />
<wa-switch>Switch off</wa-switch>
<br />
<wa-switch checked>Switch on</wa-switch>
<br /><br />
<wa-slider label="Range" hint="Here's a bit of handy content." min="0" max="100"></wa-slider>
<br /><br />
<wa-input label="Label" hint="Super helpful and/or contextual content" placeholder="Placeholder"></wa-input>
<br />
<wa-select label="Select" multiple value="option-1 option-2">
<wa-option value="option-1">Option 1</wa-option>
<wa-option value="option-2">Option 2</wa-option>
<wa-option value="option-3">Option 3</wa-option>
<wa-option value="option-4">Option 4</wa-option>
<wa-option value="option-5">Option 5</wa-option>
<wa-option value="option-6">Option 6</wa-option>
</wa-select>
```
## Progress
```html {.example}
<wa-progress-ring value="25" style="--indicator-width: 4px;"></wa-progress-ring>
<wa-progress-bar value="60"></wa-progress-bar>
<wa-spinner></wa-spinner>
```
## Shadows
```html {.example}
<style>
div.shadow {
border: var(--wa-border-width-s) solid var(--wa-color-surface-border);
border-radius: var(--wa-border-radius-s);
display: inline-block;
height: 4rem;
margin-right: 2rem;
width: 4rem;
}
</style>
<div class="shadow" style="box-shadow: var(--wa-shadow-s);"></div>
<div class="shadow" style="box-shadow: var(--wa-shadow-m);"></div>
<div class="shadow" style="box-shadow: var(--wa-shadow-l);"></div>
```
## Alignment Tests
```html {.example}
<style>
div.test-cases > * + * {
margin-top: 1rem;
}
div.alignment {
background: linear-gradient(to bottom, lightblue, lightblue 1px, transparent 1px, transparent), linear-gradient(to top, lightblue, lightblue 1px, transparent 1px, transparent);
position: relative;
display: flex;
gap: 1rem;
align-items: center;
}
div.alignment::after {
content: '';
position: absolute;
top: calc(50% - 0.5px);
width: 100%;
height: 1px;
background-color: red;
}
</style>
<div class="test-cases">
<div class="alignment">
<wa-switch size="small">OCBS</wa-switch>
<wa-checkbox size="small">OCBS</wa-checkbox>
<wa-radio value="1" size="small">OCBS</wa-radio>
</div>
<div class="alignment">
<wa-switch>OCBS</wa-switch>
<wa-checkbox>OCBS</wa-checkbox>
<wa-radio value="1">OCBS</wa-radio>
</div>
<div class="alignment">
<wa-switch size="large">OCBS</wa-switch>
<wa-checkbox size="large">OCBS</wa-checkbox>
<wa-radio value="1" size="large">OCBS</wa-radio>
</div>
<div class="alignment">
<wa-input size="small"></wa-input>
<wa-select size="small" value="ocbs" multiple>
<wa-option value="ocbs">OCBS</wa-option>
</wa-select>
<wa-color-picker size="small"></wa-color-picker>
<wa-button size="small">OCBS</wa-button>
</div>
<div class="alignment">
<wa-input size="medium"></wa-input>
<wa-select size="medium" value="ocbs" multiple>
<wa-option value="ocbs">OCBS</wa-option>
</wa-select>
<wa-color-picker size="medium"></wa-color-picker>
<wa-button size="medium">OCBS</wa-button>
</div>
<div class="alignment">
<wa-input size="large"></wa-input>
<wa-select size="large" value="ocbs" multiple>
<wa-option value="ocbs">OCBS</wa-option>
</wa-select>
<wa-color-picker size="large"></wa-color-picker>
<wa-button size="large">OCBS</wa-button>
</div>
<div class="alignment">
<wa-badge>OCBS</wa-badge>
<wa-avatar></wa-avatar>
<wa-rating></wa-rating>
<wa-slider></wa-slider>
<wa-icon-button name="gear" label="Settings"></wa-icon-button>
<wa-progress-bar value="50" style="width: 8rem;"></wa-progress-bar>
<wa-spinner></wa-spinner>
</div>
<div class="alignment">
<wa-input label="AaBbCc" hint="Ipsum"></wa-input>
<wa-select label="AaBbCc" value="ocbs" multiple hint="Ipsum">
<wa-option value="ocbs">OCBS</wa-option>
</wa-select>
<wa-color-picker label="AaBbCc" hint="Ipsum"></wa-color-picker>
</div>
</div>
```
## Custom Property Tests
```html {.example}
<style>
.wa-theme-test {
--wa-form-control-background-color: mistyrose;
--wa-form-control-border-style: dotted;
--wa-form-control-border-width: 3px;
--wa-form-control-border-radius: 12px;
--wa-form-control-activated-color: mediumvioletred;
--wa-form-control-border-color: palevioletred;
--wa-form-control-label-color: rosybrown;
--wa-form-control-label-font-weight: 900;
--wa-form-control-label-line-height: 1;
--wa-form-control-value-color: brown;
--wa-form-control-value-font-weight: 900;
--wa-form-control-value-line-height: 2;
--wa-form-control-placeholder-color: lightpink;
}
</style>
<div class="wa-theme-test" style="display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;">
<label>Native Input <input type="text" placeholder="placeholder"></label>
<wa-input label="WA Input" type="text" placeholder="placeholder"></wa-input>
<label>Native Input <input type="text" value="value"></label>
<wa-input label="WA Input" type="text" value="value"></wa-input>
<label>Native Textarea <textarea placeholder="placeholder"></textarea></label>
<wa-textarea label="WA Textarea" placeholder="placeholder"></wa-textarea>
<label>Native Textarea <textarea>value</textarea></label>
<wa-textarea label="WA Textarea" value="value"></wa-textarea>
<label><input type="checkbox" checked> Native Checkbox</label>
<wa-checkbox checked>WA Checkbox</wa-checkbox>
<label><input type="checkbox"> Native Checkbox</label>
<wa-checkbox>WA Checkbox</wa-checkbox>
<label><input type="radio" checked> Native Radio</label>
<wa-radio checked>WA Radio</wa-radio>
<label><input type="radio"> Native Radio</label>
<wa-radio>WA Radio</wa-radio>
<label>
Native Select
<select value="option-1">
<option value="option-1">Option 1</option>
<option value="option-2">Option 2</option>
<option value="option-3">Option 3</option>
<option value="option-4">Option 4</option>
</select>
</label>
<wa-select label="WA Select" value="option-1">
<wa-option value="option-1">Option 1</wa-option>
<wa-option value="option-2">Option 2</wa-option>
<wa-option value="option-3">Option 3</wa-option>
<wa-option value="option-4">Option 4</wa-option>
</wa-select>
</div>
```
## Text Controls Tests
```html {.example}
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;">
<label>Native Input <input type="text" value="value"></label>
<wa-input label="WA Input" type="text" value="value"></wa-input>
<label>
Native Select
<select value="option-1">
<option value="option-1">Option 1</option>
<option value="option-2">Option 2</option>
<option value="option-3">Option 3</option>
<option value="option-4">Option 4</option>
</select>
</label>
<wa-select label="WA Select" value="option-1">
<wa-option value="option-1">Option 1</wa-option>
<wa-option value="option-2">Option 2</wa-option>
<wa-option value="option-3">Option 3</wa-option>
<wa-option value="option-4">Option 4</wa-option>
</wa-select>
<label>Native Textarea <textarea>value</textarea></label>
<wa-textarea label="WA Textarea" value="value"></wa-textarea>
</div>
```

View File

@@ -0,0 +1,75 @@
---
title: Size tests
---
Button size should default to `medium`:
```html {.example}
<wa-button size=small>Small</wa-button>
<wa-button>Medium</wa-button>
<wa-button size=medium>Medium</wa-button>
<wa-button size=large>Large</wa-button>
```
If no button size is specified, it should default to that of its ancestor:
```html {.example}
<wa-button-group size="small">
<wa-button>Small 1</wa-button>
<wa-button>Small 2</wa-button>
<wa-button>Small 3</wa-button>
</wa-button-group>
<br><br>
<wa-button-group>
<wa-button>Medium 1</wa-button>
<wa-button>Medium 2</wa-button>
<wa-button>Medium 3</wa-button>
</wa-button-group>
<br><br>
<wa-button-group size="large">
<wa-button>Large 1</wa-button>
<wa-button>Large 2</wa-button>
<wa-button>Large 3</wa-button>
</wa-button-group>
```
Dropdown:
```html {.example}
<p>Small dropdown:
<wa-dropdown size="small">
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Dropdown Item 1</wa-menu-item>
<wa-menu-item>Dropdown Item 2</wa-menu-item>
<wa-menu-item>Dropdown Item 3</wa-menu-item>
</wa-menu>
</wa-dropdown>
<p>Small menu:
<wa-dropdown>
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu size="small">
<wa-menu-item>Dropdown Item 1</wa-menu-item>
<wa-menu-item>Dropdown Item 2</wa-menu-item>
<wa-menu-item>Dropdown Item 3</wa-menu-item>
</wa-menu>
</wa-dropdown>
<p>Small menu item:
<wa-dropdown>
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item size="small">Dropdown Item 1</wa-menu-item>
<wa-menu-item size="small">Dropdown Item 2</wa-menu-item>
<wa-menu-item size="small">Dropdown Item 3</wa-menu-item>
</wa-menu>
</wa-dropdown>
<p>No size:
<wa-dropdown>
<wa-button slot="trigger" caret>Dropdown</wa-button>
<wa-menu>
<wa-menu-item>Dropdown Item 1</wa-menu-item>
<wa-menu-item>Dropdown Item 2</wa-menu-item>
<wa-menu-item>Dropdown Item 3</wa-menu-item>
</wa-menu>
</wa-dropdown>
```

View File

@@ -506,7 +506,7 @@ hasOutline: false
<wa-option data-alpha="remove" value="playful">Playful</wa-option>
<wa-option data-alpha="remove" value="brutalist">Brutalist</wa-option>
<wa-option data-alpha="remove" value="tailspin">Tailspin</wa-option>
<wa-option data-alpha="remove" value="glassy">Glassy</wa-option>
<wa-option data-alpha="remove" value="glossy">Glossy</wa-option>
<wa-option data-alpha="remove" value="active">Active</wa-option>
<wa-option value="classic">Classic</wa-option>
</wa-select>
@@ -576,10 +576,10 @@ hasOutline: false
<wa-radio value="yellow"><span style="background-color:var(--wa-color-yellow-60);"></span></wa-radio>
<wa-radio value="lime"><span style="background-color:var(--wa-color-lime-60);"></span></wa-radio>
<wa-radio value="green"><span style="background-color:var(--wa-color-green-60);"></span></wa-radio>
<wa-radio value="teal"><span style="background-color:var(--wa-color-teal-60);"></span></wa-radio>
<wa-radio value="cyan"><span style="background-color:var(--wa-color-cyan-60);"></span></wa-radio>
<wa-radio value="blue"><span style="background-color:var(--wa-color-blue-60);"></span></wa-radio>
<wa-radio value="indigo"><span style="background-color:var(--wa-color-indigo-60);"></span></wa-radio>
<wa-radio value="violet"><span style="background-color:var(--wa-color-violet-60);"></span></wa-radio>
<wa-radio value="purple"><span style="background-color:var(--wa-color-purple-60);"></span></wa-radio>
<wa-radio value="gray"><span style="background-color:var(--wa-color-gray-60);"></span></wa-radio>
</wa-radio-group>
</wa-details>
@@ -803,7 +803,7 @@ hasOutline: false
const queue = [];
let inputTimeout;
variantInput.addEventListener('wa-change', () => {
variantInput.addEventListener('change', () => {
iconList.dataset.variant = variantInput.value;
});
@@ -823,7 +823,7 @@ hasOutline: false
});
// Filter as the user types
input.addEventListener('wa-input', () => {
input.addEventListener('input', () => {
clearTimeout(inputTimeout);
inputTimeout = setTimeout(() => {
[...iconList.children].map(item => {
@@ -886,7 +886,7 @@ hasOutline: false
case 'active':
colorPalette = 'rudimentary';
break;
case 'glassy':
case 'glossy':
colorPalette = 'elegant';
break;
case 'premium':
@@ -1049,7 +1049,7 @@ hasOutline: false
case 'brutalist':
case 'classic':
case 'awesome':
case 'glassy':
case 'glossy':
case 'active':
assetFolder = themeSelect.value;
break;
@@ -1084,10 +1084,10 @@ hasOutline: false
el.classList.add(`wa-theme-${theme}-${colorMode}`);
}
colorModeSelect.addEventListener('wa-change', setColorMode);
colorModeSelect.addEventListener('change', setColorMode);
// Theme Switcher
themeSelect.addEventListener('wa-change', event => {
themeSelect.addEventListener('change', event => {
const theme = event.target.value
const newStylesheet = Object.assign(document.createElement("link"), {
// This media: "print" allows us to lazy load the stylesheet then hot swap it on load.
@@ -1132,14 +1132,14 @@ hasOutline: false
});
// Color Palette
colorSelect.addEventListener('wa-change', event => {
colorSelect.addEventListener('change', event => {
const colorPalette = event.target.value;
colorStylesheet.href = `/dist/styles/themes/color/${colorPalette}.css`;
});
// Brand Color
brandColor.addEventListener('wa-change', event => {
brandColor.addEventListener('change', event => {
const documentStyles = document.documentElement.style
documentStyles.setProperty('--wa-color-primary-95', `var(--wa-color-${event.target.value}-95)`);
documentStyles.setProperty('--wa-color-primary-90', `var(--wa-color-${event.target.value}-90)`);
@@ -1223,7 +1223,7 @@ hasOutline: false
})
// Pre-generated logos
logoSelector.addEventListener('wa-change', event => {
logoSelector.addEventListener('change', event => {
const value = event.currentTarget.value
const projectLogo = previewContainer.querySelector("#project-logo");
@@ -1259,7 +1259,7 @@ hasOutline: false
case 'tailspin':
presetLogoIcons = ['wind', 'feather', 'lemon', 'wind-turbine'];
break;
case 'glassy':
case 'glossy':
presetLogoIcons = ['raindrops', 'citrus-slice', 'lighthouse', 'kiwi-bird'];
break;
case 'active':
@@ -1279,21 +1279,21 @@ hasOutline: false
})
}
themeSelect.addEventListener('wa-change', setLogoIcons);
themeSelect.addEventListener('change', setLogoIcons);
// Project Name
container.querySelector('[name="project-name"]').addEventListener('wa-input', event => {
container.querySelector('[name="project-name"]').addEventListener('input', event => {
previewContainer.querySelector("#project-name").innerText = event.target.value || event.target.getAttribute("placeholder")
})
// Heading font weight
resetHeadingFontWeightValue()
fontWeightHeading.addEventListener('wa-input', event => {
fontWeightHeading.addEventListener('input', event => {
document.documentElement.style.setProperty('--wa-font-weight-heading', event.target.value);
});
// Heading text
fontFamilyHeading.addEventListener('wa-change', event => {
fontFamilyHeading.addEventListener('change', event => {
let fontFamily;
switch (event.target.value) {
case 'assistant':
@@ -1351,7 +1351,7 @@ hasOutline: false
})
// Body text
fontFamilyBody.addEventListener('wa-change', event => {
fontFamilyBody.addEventListener('change', event => {
let fontFamily;
switch (event.target.value) {
case 'assistant':
@@ -1404,7 +1404,7 @@ hasOutline: false
// Body font weight
resetBodyFontWeightValue()
fontWeightBody.addEventListener('wa-input', event => {
fontWeightBody.addEventListener('input', event => {
document.documentElement.style.setProperty('--wa-font-weight-body', event.target.value);
});
@@ -1580,7 +1580,7 @@ hasOutline: false
}
// Swaps icons to the preferred set for the selected theme
themeSelect.addEventListener('wa-change', event => {
themeSelect.addEventListener('change', event => {
setPreferredIcons();
showIconStyleOptions();
syncLogoIcon();
@@ -1599,32 +1599,32 @@ hasOutline: false
});
// Changes available Icon Styles and swaps icons based on the selected Icon Family
iconFamily.addEventListener('wa-change', event => {
iconFamily.addEventListener('change', event => {
useFaIcons();
showIconStyleOptions();
});
// Swaps icons based on the selected Icon Style
iconStyle.addEventListener('wa-change', useFaIcons);
iconStyle.addEventListener('change', useFaIcons);
// Corners
container.querySelector('[name="corners"]').addEventListener('wa-input', event => {
container.querySelector('[name="corners"]').addEventListener('input', event => {
document.documentElement.style.setProperty('--wa-border-radius-scale', `${event.target.value}`);
});
// Border width
container.querySelector('[name="border-width"]').addEventListener('wa-input', event => {
container.querySelector('[name="border-width"]').addEventListener('input', event => {
document.documentElement.style.setProperty('--wa-border-width-scale', `${event.target.value / 16}`);
});
// Border style
borderStyle.addEventListener('wa-input', event => {
borderStyle.addEventListener('input', event => {
document.documentElement.style.setProperty('--wa-border-style', event.target.value);
});
// Spacing style
spacing.addEventListener('wa-input', event => {
spacing.addEventListener('input', event => {
document.documentElement.style.setProperty('--wa-space-scale', `${event.target.value}`);
});

View File

@@ -146,7 +146,7 @@ To create a custom validation error, pass a non-empty string to the `setCustomVa
alert('All fields are valid!');
});
input.addEventListener('wa-input', () => {
input.addEventListener('input', () => {
if (input.value === 'webawesome') {
input.setCustomValidity('');
} else {

View File

@@ -6,7 +6,7 @@ layout: page-outline
Welcome to the Web Awesome alpha release for early backers! 👋
==This is a very early alpha release!== For this preview, we're only offering access to the free components through a temporary CDN. Please be aware: Things can change. Things can break. You probably shouldn't be using this software in production yet! But fear not, we're working hard to polish up the free stuff you see here _plus_ all the great stuff we have planned for Web Awesome Pro!
==This is a very early alpha release!== For this preview, we're offering access to Web Awesome through a temporary CDN. Please be aware: Things can change. Things can break. You probably shouldn't be using this software in production yet! But fear not, we're working hard to polish up everything you see here _plus_ all the great stuff we have planned for Web Awesome Pro!
Thank you so much for backing us!
@@ -20,22 +20,78 @@ As a Web Awesome backer, this early alpha release is _just for you_. Please refr
---
## Autoloading via CDN (Easiest)
## Quick Start (Autoloading via CDN)
The autoloader is the easiest way to use Web Awesome. A lightweight script watches the DOM for unregistered Web Awesome elements and lazy loads them for you — even if they're added dynamically.
To get everything included in Web Awesome, add the following code to the `<head>` of your site:
```html
<link rel="stylesheet" href="{% cdnUrl 'styles/themes/default.css' %}" />
<link rel="stylesheet" href="{% cdnUrl 'styles/webawesome.css' %}" />
<script type="module" src="{% cdnUrl 'webawesome.loader.js' %}"></script>
```
This snippet includes three parts:
1. **The default theme**, a stylesheet that gives a cohesive look to Web Awesome components with both light and dark modes
2. **Web Awesome styles**, an optional stylesheet that [styles native HTML elements](/docs/native) and includes [utility classes](/docs/utilities) you can use in your project
3. **The autoloader**, a lightweight script watches the DOM for unregistered Web Awesome elements and lazy loads them for you — even if they're added dynamically
Now you can [start using Web Awesome!](/docs/usage)
:::info
While convenient, autoloading may lead to a [Flash of Undefined Custom Elements](https://www.abeautifulsite.net/posts/flash-of-undefined-custom-elements/). The linked article describes some ways to alleviate it.
:::
## Setting the Base Path
---
## Using Font Awesome Kit Codes
Font Awesome users can set their kit code to unlock Font Awesome Pro icons. You can provide it by adding the `data-fa-kit-code` attribute to any element on the page, or by calling the `setKitCode()` method.
```html
<!-- Option 1: the data-fa-kit-code attribute -->
<script src="bundle.js" data-fa-kit-code="abc123"></script>
<!-- Option 2: the setKitCode() method -->
<script type="module">
import { setKitCode } from '{% cdnUrl 'webawesome.loader.js' %}';
setKitCode('YOUR_KIT_CODE_HERE');
</script>
```
---
## Advanced Setup
The autoloader is the easiest way to use Web Awesome, but different projects (or your own preferences!) may require different installation methods.
### Installing via npm
An npm package isn't available in the early backer alpha release, but we'll have one soon! For now, please enjoy [Web Awesome from the CDN](#quick-start-autoloading-via-cdn).
### Cherry Picking
Cherry picking will only load the components you need up front, while limiting the number of files the browser has to download. The disadvantage is that you need to import each individual component on each page it's used. You'll still need to include the default theme (`styles/themes/default.css`) or another theme to style any imported components.
Here's an example that loads only the button component.
```html
<link rel="stylesheet" href="{% cdnUrl 'styles/themes/default.css' %}" />
<script type="module">
import '{% cdnUrl 'components/button/button.js' %}';
// <wa-button> is ready to use!
</script>
```
You can copy and paste the code to import a component from the "Importing" section of the component's documentation. Note that some components have dependencies that are automatically imported when you cherry pick. If a component has dependencies, they will be listed in the "Dependencies" section of its docs.
:::warning
You will see files named `chunk.[hash].js` in the `chunks` directory. Never import these files directly, as they are generated and change from version to version.
:::
### Setting the Base Path
Some components rely on assets (icons, images, etc.) and Web Awesome needs to know where they're located. For convenience, Web Awesome will try to auto-detect the correct location based on the script you've loaded it from. This assumes assets are colocated with `webawesome.loader.js` and will "just work" for most users.
@@ -70,45 +126,4 @@ Most of the magic behind assets is handled internally by Web Awesome, but if you
// Get the path to an asset, e.g. /path/to/assets/file.ext
const assetPath = getBasePath('file.ext');
</script>
```
## Using Font Awesome Kit Codes
Font Awesome users can set their kit code to unlock Font Awesome Pro icons. You can provide it by adding the `data-fa-kit-code` attribute to any element on the page, or by calling the `setKitCode()` method.
```html
<!-- Option 1: the data-fa-kit-code attribute -->
<script src="bundle.js" data-fa-kit-code="abc123"></script>
<!-- Option 2: the setKitCode() method -->
<script type="module">
import { setKitCode } from '/path/to/web-awesome/dist/webawesome.js';
setKitCode('YOUR_KIT_CODE_HERE');
</script>
```
## Cherry Picking
Cherry picking will only load the components you need up front, while limiting the number of files the browser has to download. The disadvantage is that you need to import each individual component on each page it's used.
Here's an example that loads only the button component.
```html
<link rel="stylesheet" href="/path/to/web-awesome/dist/styles/themes/default.css" />
<script type="module" data-webawesome="/path/to/web-awesome/dist">
import '/path/to/web-awesome/dist/components/button/button.js';
// <wa-button> is ready to use!
</script>
```
You can copy and paste the code to import a component from the "Importing" section of the component's documentation. Note that some components have dependencies that are automatically imported when you cherry pick. If a component has dependencies, they will be listed in the "Dependencies" section of its docs.
:::warning
You will see files named `chunk.[hash].js` in the `chunks` directory. Never import these files directly, as they are generated and change from version to version.
:::
## Using Web Awesome with npm
An npm package isn't available in the early backer alpha release, but we'll have one soon! For now, please enjoy Web Awesome from the CDN as shown above.
```

View File

@@ -1,7 +1,25 @@
---
title: Layout
description: Layout components and utility classes help you organize content that can adapt to any device or screen size. Browse the collection of responsive layout tools included in Web Awesome Pro.
description: Layout components and utility classes help you organize content that can adapt to any device or screen size. See the [installation instructions](#installation) to use Web Awesome's layout tools in your project.
layout: overview
categories: ["components", "utilities"]
override:tags: []
---
{% markdown %}
## Installation
Layout components are included in Web Awesome's [autoloader](/docs/installation/#quick-start-autoloading-via-cdn). You can also import them individually via [cherry picking](/docs/installation/#cherry-picking).
Layout utilities are bundled with all [style utilities](/docs/utilities). You can import all Web Awesome page styles (including [native styles](/docs/native/)) by including the following stylesheet in your project:
```html
<link rel="stylesheet" href="{% cdnUrl 'styles/webawesome.css' %}" />
```
Or, you can choose to import _only_ the utilities:
```html
<link rel="stylesheet" href="{% cdnUrl 'styles/utilities.css' %}" />
```
{% endmarkdown %}

View File

@@ -7,6 +7,7 @@ icon: button
snippets:
'<button>': https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
'.wa-button': false
file: styles/native/button.css
---
```html {.example}
@@ -20,7 +21,7 @@ snippets:
### Variants
Use the variant utility classes to set the button's semantic variant.
Use the [variant utility classes](../utilities/color.md) to set the button's semantic variant.
```html {.example}
<button class="wa-neutral">Neutral</button>
@@ -32,44 +33,54 @@ Use the variant utility classes to set the button's semantic variant.
### Appearance
Use the appearance utility classes to change the button's visual appearance:
Use the [appearance utility classes](../utilities/appearance.md) to change the button's visual appearance:
```html {.example}
<div style="margin-block-end: 1rem;">
<button class="wa-accent wa-outlined wa-neutral">A + O</button>
<button class="wa-accent wa-neutral">Accent</button>
<button class="wa-filled wa-neutral">Filled</button>
<button class="wa-outlined wa-neutral">Outlined</button>
<button class="wa-plain wa-neutral">Text</button>
<button class="wa-filled wa-outlined wa-neutral">F + O</button>
<button class="wa-filled wa-neutral">Filled</button>
<button class="wa-plain wa-neutral">Plain</button>
</div>
<div style="margin-block-end: 1rem;">
<button class="wa-accent wa-outlined wa-brand">A + O</button>
<button class="wa-accent wa-brand">Accent</button>
<button class="wa-filled wa-brand">Filled</button>
<button class="wa-outlined wa-brand">Outlined</button>
<button class="wa-plain wa-brand">Text</button>
<button class="wa-filled wa-outlined wa-brand">F + O</button>
<button class="wa-filled wa-brand">Filled</button>
<button class="wa-plain wa-brand">Plain</button>
</div>
<div style="margin-block-end: 1rem;">
<button class="wa-accent wa-outlined wa-success">A + O</button>
<button class="wa-accent wa-success">Accent</button>
<button class="wa-filled wa-success">Filled</button>
<button class="wa-outlined wa-success">Outlined</button>
<button class="wa-plain wa-success">Text</button>
<button class="wa-filled wa-outlined wa-success">F + O</button>
<button class="wa-filled wa-success">Filled</button>
<button class="wa-plain wa-success">Plain</button>
</div>
<div style="margin-block-end: 1rem;">
<button class="wa-accent wa-outlined wa-warning">A + O</button>
<button class="wa-accent wa-warning">Accent</button>
<button class="wa-filled wa-warning">Filled</button>
<button class="wa-outlined wa-warning">Outlined</button>
<button class="wa-plain wa-warning">Text</button>
<button class="wa-filled wa-outlined wa-warning">F + O</button>
<button class="wa-filled wa-warning">Filled</button>
<button class="wa-plain wa-warning">Plain</button>
</div>
<div>
<button class="wa-accent wa-outlined wa-danger">A + O</button>
<button class="wa-accent wa-danger">Accent</button>
<button class="wa-filled wa-danger">Filled</button>
<button class="wa-outlined wa-danger">Outlined</button>
<button class="wa-plain wa-danger">Text</button>
<button class="wa-filled wa-outlined wa-danger">F + O</button>
<button class="wa-filled wa-danger">Filled</button>
<button class="wa-plain wa-danger">Plain</button>
</div>
```
### Sizes
Use `wa-size-*` classes to change a button's size.
Use the [size utility classes](../utilities/size.md) to change a button's size.
```html {.example}
<button class="wa-size-s">Small</button>

118
docs/docs/native/callout.md Normal file
View File

@@ -0,0 +1,118 @@
---
title: Callout
description: Callouts are used to display important messages inline.
component: callout
icon: callout
snippets: '.wa-callout'
noAlpha: true
file: styles/native/callout.css
---
```html {.example}
<article class="wa-callout">
This is a callout style, applied to a standard article element.
</article>
```
## Examples
### Variants
Use the [variant utility classes](../utilities/color.md) to set the callout's color variant.
```html {.example}
<article class="wa-callout wa-brand">
<strong>This is super informative</strong><br />
You can tell by how pretty the callout is.
</article>
<br />
<article class="wa-callout wa-success">
<strong>Your changes have been saved</strong><br />
You can safely exit the app now.
</article>
<br />
<article class="wa-callout wa-neutral">
<strong>Your settings have been updated</strong><br />
Settings will take effect on next login.
</article>
<br />
<article class="wa-callout wa-warning">
<strong>Your session has ended</strong><br />
Please login again to continue.
</article>
<br />
<article class="wa-callout wa-danger">
<strong>Your account has been deleted</strong><br />
We're very sorry to see you go!
</article>
```
### Appearance
Use the [appearance utility classes](../utilities/appearance.md) to change the callout's visual appearance (the default is `outlined filled`).
```html {.example}
<article class="wa-callout wa-brand wa-outlined wa-accent">
This <strong>accent</strong> callout is also <strong>outlined</strong>
</article>
<br />
<article class="wa-callout wa-brand wa-accent">
This <strong>accent</strong> callout draws attention without an outline
</article>
<br />
<article class="wa-callout wa-brand wa-outlined wa-filled">
This callout is both <strong>filled</strong> and <strong>outlined</strong>
</article>
<br />
<article class="wa-callout wa-brand wa-filled">
This callout is only <strong>filled</strong>
</article>
<br />
<article class="wa-callout wa-brand wa-outlined">
Here's an <strong>outlined</strong> callout
</article>
<br />
<article class="wa-callout wa-brand wa-plain">
No bells and whistles on this <strong>plain</strong> callout
</article>
```
### Sizes
Use the [size utility classes](../utilities/size.md) to change a callout's size.
```html {.example}
<article class="wa-callout wa-brand wa-outlined wa-accent wa-size-l">
This is meant to be very emphasized.
</article>
<br />
<article class="wa-callout">
Normal-sized callout.
</article>
<br />
<article class="wa-callout wa-plain wa-plain wa-size-s">
Just a small tip!
</article>
```

View File

@@ -6,6 +6,7 @@ component: checkbox
icon: checkbox
elements:
"<input type=checkbox>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
file: styles/native/checkbox.css
---
```html {.example}

View File

@@ -4,6 +4,25 @@ description: 'Content styles apply your Web Awesome theme to HTML text content,
tags: content
layout: element
icon: skeleton
elements:
"<h1>-<h6>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements
"<blockquote>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/blockquote
"<strong>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong
"<em>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/em
"<u>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/u
"<del>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/del
"<ins>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins
"<s>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s
"<small>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/small
"<sub>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub
"<sup>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup
"<abbr>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/abbr
"<kbd>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/kbd
"<mark>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/mark
"<a>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a
"<code>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/code
"<img>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
file: styles/native/content.css
---

View File

@@ -7,6 +7,7 @@ component: details
icon: details
elements:
"<details>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
file: styles/native/details.css
---
```html {.example}

View File

@@ -6,6 +6,7 @@ icon: dialog
elements:
"<dialog>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog
component: dialog
file: styles/native/dialog.css
---
```html {.example}

View File

@@ -1,6 +1,7 @@
---
title: Native Styles
description: Native Styles use your theme to style native HTML elements to match the look and feel of Web Awesome components.
description: Native styles apply your theme to native HTML elements so they match the look and feel of Web Awesome components.
See the [installation instructions](#installation) to use native styles in your project.
layout: overview
categories: ['forms', 'apps', 'content']
override:tags: []
@@ -19,7 +20,7 @@ To use all Web Awesome page styles (including [utilities](/docs/utilities/)), in
<link rel="stylesheet" href="{% cdnUrl 'styles/webawesome.css' %}" />
```
Or, to _only_ include styles for built-in elements:
Or, to _only_ include styles for native elements:
```html
<link rel="stylesheet" href="{% cdnUrl 'styles/native.css' %}" />

View File

@@ -6,6 +6,7 @@ icon: input
component: input
elements:
"<input>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
file: styles/native/input.css
---
<style>
@@ -41,6 +42,14 @@ wa-code-demo::part(preview) {
<wa-input label="WA Input (url)" type="url"></wa-input>
```
## Pill shaped text fields
Add the `wa-pill` class to an `<input>` to make it pill-shaped.
```html {.example}
<label>Input <input type="text" placeholder="placeholder" class="wa-pill"></label>
```
## Color Picker
Basic:

View File

@@ -7,6 +7,7 @@ elements:
"<ul>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul
"<ol>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol
"<dl>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dl
file: styles/native/lists.css
---
## Unordered Lists

View File

@@ -7,6 +7,7 @@ status: experimental
component: progress-bar
elements:
"<progress>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress
file: styles/native/progress.css
---

View File

@@ -6,21 +6,14 @@ icon: radio-group
component: radio
elements:
"<input type=radio>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio
file: styles/native/radio.css
---
<style>
label {
display: inline-block;
}
label + label {
margin-inline-start: var(--wa-space);
}
</style>
```html {.example}
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<div class="wa-cluster">
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
</div>
```
## Examples
@@ -30,9 +23,11 @@ elements:
To set the initial value and checked state, use the `checked` attribute on the corresponding radio.
```html {.example}
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<label><input type="radio" name="radio" value="3" checked> Option 3</label>
<div class="wa-cluster">
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<label><input type="radio" name="radio" value="3" checked> Option 3</label>
</div>
```
### Disabled
@@ -40,9 +35,11 @@ To set the initial value and checked state, use the `checked` attribute on the c
Use the `disabled` attribute to disable a radio.
```html {.example}
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2" disabled> Option 2</label>
<label><input type="radio" name="radio" value="3"> Option 3</label>
<div class="wa-cluster">
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2" disabled> Option 2</label>
<label><input type="radio" name="radio" value="3"> Option 3</label>
</div>
```
### Sizes
@@ -50,27 +47,47 @@ Use the `disabled` attribute to disable a radio.
Use the [size utilities](/docs/utilities/size) to change the radios' size.
```html {.example}
<fieldset class="wa-size-s">
<legend>Small</legend>
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<label><input type="radio" name="radio" value="3"> Option 3</label>
<fieldset class="wa-size-s wa-cluster">
<legend>Small</legend>
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<label><input type="radio" name="radio" value="3"> Option 3</label>
</fieldset>
<br />
<fieldset class="wa-size-m">
<legend>Medium</legend>
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<label><input type="radio" name="radio" value="3"> Option 3</label>
<fieldset class="wa-size-m wa-cluster">
<legend>Medium</legend>
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<label><input type="radio" name="radio" value="3"> Option 3</label>
</fieldset>
<br />
<fieldset class="wa-size-l">
<legend>Large</legend>
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<label><input type="radio" name="radio" value="3"> Option 3</label>
<fieldset class="wa-size-l wa-cluster">
<legend>Large</legend>
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<label><input type="radio" name="radio" value="3"> Option 3</label>
</fieldset>
```
### Orientation
You can wrap native radios in a flex container to give them a horizontal or vertical orientation with even spacing. The convenience [`wa-cluster`](/docs/utilities/cluster) and [`wa-stack`](/docs/utilities/stack) utilities make this easy.
```html {.example}
<div class="wa-cluster">
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<label><input type="radio" name="radio" value="3" checked> Option 3</label>
</div>
```
```html {.example}
<div class="wa-stack">
<label><input type="radio" name="radio" value="1"> Option 1</label>
<label><input type="radio" name="radio" value="2"> Option 2</label>
<label><input type="radio" name="radio" value="3" checked> Option 3</label>
</div>
```

View File

@@ -6,6 +6,7 @@ icon: select
component: select
elements:
"<select>": https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select
file: styles/native/select.css
---
```html {.example}
@@ -33,3 +34,39 @@ Use the [appearance utilities](/docs/utilities/appearance/) to change the select
</select>
</label>
```
### Grouping options
In [modern browsers](https://caniuse.com/mdn-html_elements_select_hr_in_select), you can use the `<hr>` element as a divider:
```html {.example}
<select>
<small>Section 1</small>
<option value="option-1">Option 1</option>
<option value="option-2">Option 2</option>
<option value="option-3">Option 3</option>
<hr />
<small>Section 2</small>
<option value="option-4">Option 4</option>
<option value="option-5">Option 5</option>
<option value="option-6">Option 6</option>
</select>
```
To provide labels, you can use the `<optgroup>` element (with or without dividers):
```html {.example}
<select>
<optgroup label="Section 1">
<option value="option-1">Option 1</option>
<option value="option-2">Option 2</option>
<option value="option-3">Option 3</option>
</optgroup>
<optgroup label="Section 2">
<option value="option-4">Option 4</option>
<option value="option-5">Option 5</option>
<hr />
<option value="option-6">Option 6</option>
</optgroup>
</select>
```

Some files were not shown because too many files have changed in this diff Show More