* reverting custom `getLastModifiedISO` utility
* using 11ty's `git Last Modified` on docs/resources/changelog
* dumbing down "Last updated" date to be static
* fixing broken links in docs/resources/contributing.md
* removing broken links in docs/resources/changelog.md
* fixing broken link in docs/components/button-group.md
* fixing broken link in docs/components/comparison.md
* fixing broken link in docs/components/divider.md
* fixing broken link in docs/components/radio-group.md
* fixing broken link in docs/utilities/frame.md
* fixing broken link in docs/utilities/gap.md
* fixing broken link in docs/utilities/rounding.md
* Apply suggestions from code review
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
* addressing PR feedback
---------
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
* adding Free Badge macro
* using semantic color value for Pro Badge's `color`
* removing unncessary `border-color` from Pro Badge's custom CSS
* adding `data-pro-badge` attr to Pro Badge
* using freeBadge and proBadge macros in themes.njk
* using wa-icon in generated anchors
* moving anchor-heading styling from docs.css to utils.css
* improving anchor-heading styling
* adding subtle transition
* using --wa-space-3xs custom property for padding
* adding option to set 11ty's `data-no-anchor` at view-level
* moving all `base.njk` initializations to before `<html>`
* updating anchor-headings.js transformer logic
* Use <title> for search indexing but strip trailing site suffix at
build time
* centralize title logic with shared composePageTitle() and
stripSiteTitleSuffix() helpers
* introduce single source of truth for site name and separators
* keep client search rendering simple; no post-processing in the browser
* preserve existing page/OG title behavior while improving search
relevance
* adding decorative underline to utils.css
* adding banner to base.njk
* disabling sticky banner in layouts
* adding logic to show/hide pageBanner
* add changelog for `<wa-page>` fix in related Pro PR
---------
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
* adding site data to `.eleventy.js`
* adding open graph metadata to `/eleventy.js`
* adding Open Graph metadata to head.njk
* adding default site Open Graph image
* updating formatting for title metadata
* addressing PR feedback
* adding link to Privacy Policy in sidebar.njk
* adding link to Refund Policy in sidebar.njk
* separating legal bits into a 'Terms & Policies' sidebar.njk section
* remove themer from sidebar
* fix themes/palettes spacing
* suppress error in layouts without <wa-page>
* remove broken themer link, add more helpful deets
* make my last commit actually work 🙄
---------
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
* initial take on text utility improvements
* re-introduce `.wa-caption-*`
* reorg stylesheet
* remove font weight classes
* gimme the font weights
* add `.wa-text-truncate`, `.wa-list-plain`
* add longform, color-text-link, and placeholder classes
* document utilities
* document missing font weight tokens
* use proper longform font weight
* find and replace outdated text utilities
* use new font size utilities
* missed a spot!
* add changelog
* adding bg-wa-pattern.svg asset
* adding background-wa-pattern to utils.css
* as a repeating background image
* defining customizable elements
* adding background-dot-grid to utils.css
* updating sidebar's version info
* removing beta badge
* updating tooltip + version number decorator for official launch
* removing beta notice from docs landing view
* removing beta from Installation docs
* Document code completion setup for Web Awesome
Added instructions for enabling code completion in VS Code and JetBrains IDEs for Web Awesome components.
This mirror what already exist for Shoelace: https://shoelace.style/getting-started/usage#code-completion
+ a new line to explain how to setup VS Code completion from the CDN
* Update packages/webawesome/docs/docs/usage.md
* Update packages/webawesome/docs/docs/usage.md
* Update packages/webawesome/docs/docs/usage.md
* Update packages/webawesome/docs/docs/usage.md
* Update packages/webawesome/docs/docs/usage.md
* Update packages/webawesome/docs/docs/usage.md
---------
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
* adding .appearance-plain for lists to utils.css
* adding gitLastModifiedISO filter to .eleventy.js
* adding link to Pro License in sidebar.njk
* adding link to Free License in sidebar.njk
* adding link to Terms of Service in sidebar.njk
* adding "last updated" date to changelog.md
* Make the README better
• Replace straight quotes with smart quotes
• Revise Node.js minimum requirement wording (to prevent line breaks)
• Replace old links to LitElement (Polymer) to Lit
• Replace mentions of “NPM” with “npm”, as per https://github.com/npm/cli?tab=readme-ov-file#is-it-npm-or-npm-or-npm
• Fix some grammar and abbreviations
• Made “dependencies” and “devDependencies” mentions unquoted to be consistent
• Correct “MIT license” with “MIT License”, as per https://opensource.org/license/mit
* Make some specific changes to make wording more clear
* add missing dot
* remove smart quotes
* updating Pro Badge's appearance
* abstracting Pro Badge into include
* adding nanoid-based uniqueId filter to eleventyConfig
* ensuring Pro Badge instances have unique ids
* using added uniqueId filter + nanoid
* converting Pro Badge to be macro-based
* customizing Pro Badge's associated wa-tooltip size
* syncing up `<body>` classes on blank.njk
* using `wa_page_attributes` block instead of `pageType`
* using `head` block instead of `pageType`
* removing `pageType` from `<body>` classes
* removing `pageType` from eleventyConfig
* updating color-scheme-selector's icons
* allowing `wa-page` attributes to override those set in base.njk
* allowing pageClass to be used on base.njk's `<body>`
* import relevant utilities into native styles
* import color variant classes into free palettes
* import the default palette into kitchen sink, not the default theme
* fix palette path
* import each theme's intended palette
* started horizontal card logic
* a little more work
* remove SSR attributes
These are no longer used since we're not serving up an SSR version of the website anymore.
* more work
* looking for old code
* added actions slot to horizontal card
* troubleshooting linter issue
* fixed liniting error
* responded to feedback
* added jsDoc and updated example
---------
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
* adding conditional header + footer includes to `base.njk`
- support for custom headers via `header` front matter variable
- support for custom footers via `footer` front matter variable
- backward compatibility with default header
* revising `base.njk`'s body classes
* adding fileSlug-based class to body
* adding pageType-based class (default `docs`) to body
* adding conditional CSS asset logic to `base.njk`
* to load marketing-based CSS based on pageType
* to load docs-based CSS by default
* disabling wa-page's sticky header for marketing pageType
* using layout utilities for sidebar heading link styling
* syncing up sidebar heading + general link styles
* updating sidebar heading text + icon alignment
* updating layout of experimental + pro badge decoratives
* increasing visual padding of `#search-trigger`'s `<kbd>`
* fixing `<li>` indentations
* Add FA 7 support
* Add FA 7 support
* Add FA 7 support
* Update the system library to use FA 7 icons
* fix: fix type issues
* Update the SVGs in the system library to be minified/compressed
* add suggestions and more features
* feat: add `swap-opacity` attribute
* fix: remove unrelated stuff in `swap-opacity` attribute styling
* Only scale paths for fixed width icons
* fix: fix Prettier lint issues
* fix: fix more syntax errors
* lint: Fix CSS linting, batch 1 of 3
* lint: fix TS linting issues, batch 2 of 3
* lint: Fix JS linting issues, batch 3 of 3
* lint: fix hopefully last linting issue, batch 3.5 of 3
* lint: fix final linting issues, 3.75 of 3
* lint: the actual last lint fix, batch 3.875 of 3
* chore: centre SVG paths within the SVG for fixed‐width icons
* fix iconoir example
* add comment to clarify
* use a constant for fa version
* remove unsupported features
* update for FA7; improve duotone support
* update changelog
* remove redundant fixed-width attributes
* update kit code
* notdog!
* add support for pro+ icons
* clean up example layouts, use consistent icon sizes
---------
Co-authored-by: randomguy-2650 <150704902+randomguy-2650@users.noreply.github.com>
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
* Adjust label styles for button and checkbox components to not crush space of nested tags
* Adjust label styles for button and checkbox components to not crush space of nested tags
* Update packages/webawesome/src/components/checkbox/checkbox.css
---------
Co-authored-by: Tobias Bannwart <tobias.bannwart@bison-group.com>
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
* add before / after watch events so pro can properly incrementally build
* add events for pro / app
* add extra hooks for non-wa dev
* add old new line
* use package-lock.json from next
* npm install
* prettier
* change to webawesome
* change to webawesome
* update index.md
* whitespace
* add thanks for being a webawesome pro subscriber
* add stub for currentUser
* add source code link
* add source code link
* prettier
* fix raw call
* add pro badge to themer
* add isPro flag to palettes
* show based on currentUser.hasPro
* fix logged out user stuff
---------
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
* progress, components A – C
* left behind tweaks for A – C
* all the rest
* tweaks
* remove 'accent + outlined' appearances and other tweaks
* fix overlooked docs + scouts rule
* re-add `--checked-icon-color` to radio and checkbox
* revert to `--thumb-size`
* fix theme overrides
---------
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
* consolidate theme files
* move dimension to its own layer
* touch up
* fix `.wa-invert`
* fix selectors and missing fonts
* fix selectors (for real this time)
* add button for drawer example
* scaffolding
* building initial page
* loading blank
* committing to pull down changes
* committing to merge
* trying to sync with next
* drawer issue
* added content to drawer
* added checkout page
* added checkout page
* committing to merge
* committing to merge
* made changes to sidebar
* syncing with repo
* syncing with repo
* update sidebar again
---------
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
* use wa-popup in color picker
* remove test
* remove old dropdown, menu, menu item, menu label
* remove old dropdown
* rework dropdown + dropdown item
* update examples
* add hide duration
* update jsdoc
* add event
* add size
* add size
* fix docs
* remove old test; fix types
* add submenu to example
* adapt for <wa-popup>
* remove state
* fix dropdown stuff (#1044)
* fix dropdown stuff
* prettier
* get typescript to give a real error
* remove unnecessary checks
* prettier
* remove old tag
* convert old dropdowns to new syntax
* update example
* update styles
---------
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
* tidy and touch up content styles
* finish touching up inline text styles
* move styles for docs code blocks from `native.css` to appropriate files
* tidy and touch up list and table styles
* tidy and touch up details styles
* tidy up dialog styles
* fix bloated spacing in dialog and drawer
* add fieldset, refactor radio and checkbox styles
* refactor input, textarea, and select styles
* refactor range styles to match new `<wa-slider>`
* readability improvements
* touch up theme overrides
* fix Matter checkbox and radio hover styles
* visual test setup
* fix improper class placement in visual tests
* add `wa-form-control-*-font-size` and `-wa-form-control-hint-*` custom properties
* use new custom properties
* dump of component sizing improvements
* fix native color picker styles
* update menu with relative sizes
* tidy up menu, select, and tag sizing
* use relative sizing across components
* touch up custom properties
* update docs and comments
* update changelog
* revert changes to visual tests to simplify PR
* revert leftover change to visual tests
* tidy up space doc markdown
* fix default card spacing
* fix card docs
* wrap up new `--tag-max-size` for `<wa-select>`
* change default `--tag-max-size`
* prettier
* touch up
* clean up leftovers
* fix native form control margins
* set default toggle size relative to font size
* correct toggle size in docs
* Konnorrogers/lm form control sizing (#1025)
* try a second updateComplete??
* try a second updateComplete??
* more timeouts?
* try logging
* more logging
gp
* maybe now
* radio group test
* add todo note'
* add workflow dispatch for client tests
---------
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
* remove redundant styles from template
* rotate arrow based on placement so borders show correctly when applied
* use actual placement, not preferred
* add popover
* update changelog
* update changelog
* use <dialog> for popover
* fix arrow border in FF/Safari
* update content
* add sidebar to plop
* add popover
* remove test value
* remove animation to prevent page-to-page blips
* static sidebar
* manage open sections on page load and with turbo
* cleanup unused scripts
* Remove overlap between Style Utilities and Layout
---------
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
* vertical => orientation="vertical"; fixes#674
* add issue
* Update divider styles and docs to use `orientation='vertical'`
* Update split panel styles and docs to use `orientation='vertical'`
* Update remaining docs and patterns examples to `orientation='vertical'`
---------
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
* Exclude Create link from sidebar, for reals this time
* Fix bug
* Very rough prototype of look & feel
* a11y
* Clean up data files
* Automatically generate theme metadata
* Read look & feel params straight from theme
* First stab at dimensionality icons
* Fix rounding 0 bug
* Add border width slider
* [Image-comparer] Expose wrapper as part
* [Comparer] `pointer-events: none` while dragging
* Dark mode slider
* Adjust increments and ranges for look + feel sliders
* Fix preview
* Fix bug where dark mode was not inverted
* Ability to select panel from URL
* Create mixin for Vue form controls and use it in `<swatch-select>`
* Prototype of slider min/max icon buttons
* Nx tooltip
* Icons
* Prevent failed request
* info-tip: Support passing text as prop
* Clearable
* [Brutalist] Match `--wa-shadow-offset-x-scale` to `--wa-shadow-offset-y-scale`
* Add 'Blocky' dimension (derived from Awesome theme)
* Only show Reset button when `clearable` is set
* Remove `clearable` from Look & Feel sliders
* Add tooltips to min/max buttons
* Remove superfluous `aria-label`
* Do not assume that all hyphens in URLs mean nesting, make it explicit
* Formatting
* Fix bug where styles were not applied on page load
* Update Subtle dimension to maximize compatibility
* `<wa-scoped>`: Do not allow non-template children
* Workaround for card not updating
* Update Glossy dimension to maximize compatibility
* Sync scrolling between regular and inverted preview
* Fix bug
* Make changing the base theme reset customizations
* Fix palette page
* Remove cancel button from editable text
* Don't error in theme pages
* Update Playful dimension to maximize compatibility
* Rename 'Look and Feel' to 'Elements' for better parallel structure
* Hide dimensionality controls
* Make back icon motion more subtle
* Expand spacing slider bounds
* Add `tabindex="-1"` where missing in theme showcase
* Remove extraneous gap from theme headers
* fix edit button bug
* rename comparer => comparison; fix aria-controls
* Always save theme name on blur
* Add changelog for themer and new patterns category
---------
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
* initial commit to this pr
* updated patterns
* category lists
* post headers
* WIP
* made some content updates
* deleted rogue file
* updated descriptions
* ran prettier
* updated padding
* updated prettierignore
* updated element
* swtiched to token
* updated with category list feedback
* updated with category list feedback
* updated with feedback for featurd post
* updated with feedback for footer
* updated with newsletter feedback'
* updated with feedback to the paywall
* updated with updates for post footer
* more footer updates
* updated with feedback for the post header
* updated with feedback for post list
* updated social share
* updated sign up and login
* added logic to elements to prevent them from closing on escape
* Fix typo (incomplete `<h2>` tag)
* Add missing input labels, fix capitalization and punctuation
* Add description to Blog & News index
* ran prettier on markdown files
* ignored the post list file
* changed hierarchy
---------
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
* [Menu-item] Drop `base` wrapper (rel #207)
Also add two states: `has-submenu` and `submenu-expanded`
* Add `checked-icon` and `submenu-icon` slots
* [Menu-label] Drop `base` part
* update changelog
---------
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
* Basic scaffolding
* Generate theme & palette data.js that other JS can import
* Make it possible to include page-card without links
* WIP
* Add `appearance` to details, closes#569
Except `accent` as that's a) far less useful and b) trickier due to the icon color
* Fix broken link
* WIP
* WIP
* Icons icon
* Unify styles for interactive cards
* Prevent focusing inside theme icons
* Fixes
* Action page cards
* Panel scrollables
* scrollable
* Scroll shadows
* Add renaming UI
* UI
* Move styling of heading icons to `ui.css`
* Support permalinks & CRUD
* Make clickable cards more accessible
* Style cards a little better
* Default to styles panel if theme is selected
* Update theme-icons.css
* Custom themes should be saved under Custom
* Get theme code
* Bigger title
* Fixes
* Use theme Vue app for remixing too
* Fix preview jank and make preview script more flexible
* Make radio groups scrollable
* Add affordance to button cards
* Sticky
* `<color-select>`
* Fix theme remixing
* Improve previewing logic
* Fix preview
* Move `domChange()` to separate module
`theme-picker.js` includes side-effects, which may not always be desirable everywhere we may want to import `domChange()`
* Update preview.js
* Panel animation
* Hide Save button if no changes and not saved
* Do not show blank code when no selection has been made
* Use theme slug in filename
* Remove unused component
* Better UI for editing title (and any other text)
* Tweak UI of renaming
* Better indicate default selection
* Fix preview reverting bug
* Fill out app preview with more examples
* Remove `zoom` from theme showcase (yields unexpected/painful results Safari), improve display in wider viewports
* Pending delete
* Make styles panel cards scrollable
* Fix some of the Safari issues
* Update search.css
* Update panel.css
* Select preview UI
* Fix typo
* Frame colors setting as color contrast
* Show dark mode in color mappings
* Brand color
* Swatch styling
* Fix caret icon
* Move Starting theme to the same level as other controls
* Rename typography to Fonts
* Fix bug: Swatch select should show swatches from the selected palette
* Move capitalize to shared utils
* Add utils for handling nested objects
* Icons panel
* Update code.js
* Move utils around
* Add fit and finish to sidebar panels
* Theme card: Move icons to separate data structure
* Move data to dedicated folder since we now have a lot more of it
* Add default icon families and variants to themes
* Data
* Add `deepEntries()`
* Add Duotone
* Spruce up icons preview
* Use theme's icon family in showcase
* Font cards
* Font cards
* Add `max-inline-size` to preview container
* Remove alternate preview options
* Remove theme subtitle
* Support FA kit codes
* Remove Pro badges from theme cards
* Use panagram preview for Fonts
* Consistent heading and label capitalization
* Classes for different icons-card types
* Update data.js.njk
* Variable style on icon family cards
* Fix Sharp Duotone
* Clean up FA kit code hint
* Hide non-functional Icon Library field
* Fix theme icon heights
* icon variant -> style in theme metadata
* Fix bug with icons defaults not being shown
* More convenient theme defaults
* Fix bug with non updating URL
* Fix bug
* Fix multiplying badges
* Custom docs pages
* Add Duotone icons to Mellow theme
* Fix 404
* Remove "Create" from sidebar
* Fix bug
* Move vue components to `/assets/`, move their CSS with them
* Safari/FF compatibility
* Make panels scrollable again
* Fix extra spacing
---------
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
* Reduce build process noise
- Only run 11ty when something has changed within `docs/`
- Only run esbuild if a JS file has changed within
* Update scripts/build.js
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
---------
Co-authored-by: Cory LaViska <cory@abeautifulsite.net>
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
- Add `:where([class^='wa-theme-'], [class*=' wa-theme-'])` to default `typography.css` since we declare mappings that need to be inherited by other themes.
- Remove declarations that redeclare defaults
- Ensure consistent order
- [Awesome] Switch code font to ui-monospace
Fixes several issues for components using the `display: contents` technique:
- Introduce `--display` CSS property to make it possible to override internal display value of base part.
- Ensure `display: contents` is always applied with `!important` to avoid rendering glitches like the one here
- Ensure non-inherited custom properties are also inherited
- Ensure the `hidden` attribute still works.
* dividing up e-commerce patterns
* started invoice table
* building out the filter
* Initial Commit
* switching machines
* switching machines
* started split image pattern:
* commiting to merge in next
* commiting to switch machines
* upated the product detail patterns
* updated product list patterns
* updated some patterns
* filter work
* added utilities to order history
* added utilities to order-summary
* updated width of container
* switching machines
* switching machines
* fixing conflicts
* editing descriptions
* updated descriptions
* adding some polish
* more filter work
* updated prouct preview
* Revisions to "Product Features"
* "Category Filters" revisions + `wa-placeholder` utility
* cleaned up product list
* tweaked product overview
* tweaked order history
* tweak category preview
* "Checkout Form" revisions
* Re-add `navigation` to "Product Features" carousel
* cleaned up shopping cart
* tweaked order summary
* Add missing file extension
* Fix typo in file name
* Revert checkout form changes in attempt to improve diff
* Reimplement checkout form revisions
* cleaned up checkout form
* Add "What's a Pattern?" and "Using Patterns" to index
* Update category descriptions and headings
* Add docs layout for patterns with stylesheet
* tweaked customer review
* Add checkout form example
* a little more polish
* more tweaks
* switching branches to merge
* created e-commerce index
* unlisted links
* updtated content
* updated content for category preview
* updated order history
* committing to bring branches up to next
* inital commit
* Reorganize app patterns into separate pages
* switching machines
* Add link style utilities
* Refactor product list patterns
* more polish
* Refactor product overview patterns
* switching machines
* Refactor shopping cart patterns
* committing to pull down changes
* updated product preview
* updated image
* updated incentives
* Clean up utility usage and code formatting for category previews
* started updating with style utilities
* Clean up utilities and formatting, replace placeholder text in order history
* updated incentive images
* updated reviews
* added review variant
* more polish
* some heavy duty updates
* removed store navigation
* switching machines
:
* Clean up utility usage and code formatting for order summaries
* Clean up utility usage and code formatting for product previews
* big switchover
* removed old file
* working on sidebar
* updated sidebar
* created info category
* splitting up the old blog page
* a little cleanup and adding detail
* got three done
* updated social share
* Quick formatting adjustment
* initial paywalls
* Use overviews in pattern subcategories (#826)
* Do not error if no pages
* Automatically set parents and tags for patterns
* Update overview.njk
* [WIP] Use overview pages for pattern listings
* Remove explicit parents
---------
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
* some newsletter signups
* added login patterns
* reworked feeds'
* a few more
* added a few more
* add more app patterns
* App pattern tweaks (#827)
* Fix `patterns.css` reference
* Tweaks to action panel patterns
* Tweaks to comments patterns
* Progress on data display patterns
* Progress on empty state patterns
* Use email-related data from recent update in `pattern-main` (altered slightly)
* Tweaks to data display patterns
* Tweaks to empty state patterns
* Tweaks to FAQ patterns
* Tweaks to feed patterns
* Tweaks to grid patterns
* Tweaks to pagination patterns
* Tweaks to pricing patterns
* Tweaks to description list patterns
* Tweaks to leaderboard patterns
* Add and update names and descriptions
* Ensure comments fields have labels
* Tweak recent additions
* switching machines
* catching up with next
* added permissions pattern
* switching machines
* added post articles
* having local browset issues
* a few more app patterns
* took out info patterns
* spiffed up the action panels
* gave the action panels a once over
* added content to data display
* updated a few patterns
* clean up a few e-commerce patterns
* added time componen to reviews
---------
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
Co-authored-by: Lea Verou <lea@verou.me>
Co-authored-by: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
* First stab at using the Popover API for PE
* fix popup
* First stab at using the Popover API for PE
* fix popup
* Prettier
* Fix TS error
* Remove workaround
* Default to `strategy = fixed` if Popover API is not supported
* Clear out default UA styles for popovers
* Kill `hoist` with fire 🔥
* Refactor
* Update `@floating-ui/dom`
* Fix flipping and shofting
* Fix autosize
* Use `defaultBoundary` for `flip` too
That way we get the previous behavior for it.
* Remove `strategy`, just use `SUPPORTS_POPOVER` check where relevant
* Remove uses of `strategy`
* Use viewport as the default boundary for shifting and autosizing and add `boundary=scroll` to override
---------
Co-authored-by: konnorrogers <konnor5456@gmail.com>
* Generalize CRUD logic to more easily support themes (and other types of entities)
* Decouple data structures managing saved entities (palettes, themes), sidebar update logic, and palette app (and soon themer) by using events
* Simplify logic (a lot of it carried complexity back from the time we did not use uids and/or was overly general)
* `PersistedArray` class to encapsulate arrays persisted in localStorage
* Remove unused `palette.equals()` function
- Moved fixes to bug fixes section
- Linked `allDefined()` and `.wa-cloak` to their docs
- Grouped related bugfixes together
- Moved docs bugfixes to the end (since they are of least interest to users)
* Fix: Parent URL should be undefined if parent is falsy
* Document `docs.11tydata.js` better
* Move `docs/installation.md` to `docs/`, fixes#585
* Just in case
* Make sure components that only appear within page icons are still detected
* Palette icons
* Update theme-icons.css
* Reduce whitespace between swatches
---------
Co-authored-by: lindsaym-fa <dev@lindsaym.design>
* revert structure and styles to fix WA-A #123
* fix WA-A #201
* update changelog
* fix search dialog position so it doesn't jump around
* remove close watcher; fix dialog/drawer backdrop animations
Instead of raw DSD, use a component that pulls in a child template and then goes over the CSS and extracts font-related rules into the document, just once per rule.
This also fixes theme icons in Vue.
* Fix outline for headings that have links
Previously produced blank items because it assumed any link in a heading is an anchor
* Filter unlisted items from overviews
Previously they were filtered only when the card was rendered, so their heading was still shown
* [Overview] Add id to group headings
* Hide headings from empty groups
Should never happen but you never know
* [Overview] Ensure "Other" is always last even when no sorting
- Sidebar, overview listings, breadcrumbs now based on actual parent-child relationships, rather than increasingly outdated heuristics
- parent properties are now generated automatically from the URL structure, and need only be specified to override that default
- Ability to group by page hierarchy in overview pages, where pages that have >= 2 children become categories
Smaller improvements:
- More flexible syntax for specifying the params of overview pages
- [Overviews] Hide group heading if only one group is present
- parentItem and parentUrl properties that can be used on any page
- Alias a collection as the children of a page (useful for "virtual" parents like Layout)
- Do not error if a page card icon is missing
* Initial comment, based on #768
* Add `neutral` color variables
* Add `success`, `warning`, and `danger` variables
* Theme touch-ups
* Remove unused clamped tokens
* Re-add clamped tokens test page, refactor to be based on hue instead of `brand`
- 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
- 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)
- 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
* 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
* 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
* 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>
- 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`
- 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
* 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
- Minimize needless swaps
- Centralize logic
- Use an actual `<wa-select>` rather than hacking it with `<wa-dropdown>`
- Move shared includes to shared template
- Rewrite critical theme JS
- Refactor of theme picker code
- Utilize view transitions better and use them for color scheme too
- Do not store default value in localStorage
- Removed unused `*-wide` templates
- Fixed#482
* Presentation improvements
* Change `-webkit-text-size-adjust` to supported value (`none` isn't a supported keyword on iOS)
* Try using `text-size-adjust`
* Throwing caution to the wind
* Give up on `text-size-adjust` and add 1-column view
* tweaked the tag component
* updated based on feedback
* updated to remove span
* changed display to initial
* prettier
---------
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
* skip broken test
* add middleware to follow new stylesheet imports
* fix avatar tests
* update badge tests
* fix button tests
* skip carousel test
* fix checkbox tests
* fix details test
* update radio button tests
* fix input tests
* fix progress bar tests
* update
* fix range tests
* fix select tests
* restore wrapper div to pass a11y tests
* fix switch tests
* fix tag tests
* fix textarea tests
* fix tooltip tests
* skips
* fix tree item tests
* [DRAFT]: test fixes (#421)
* working on some stuff..
* add a small delay for menu-item
* prettier
* add a small delay for menu-item
* prettier
* add a small delay for menu-item
* add a small delay for menu-item
* add a small delay for menu-item
* prettier
* Empty commit
* add a small delay for menu-item
* always build with alpha
* always build with alpha
* move to alpha builds
---------
Co-authored-by: Konnor Rogers <konnor5456@gmail.com>
- Use hueless color tokens so it can be used with variants (and add example)
- Fix hover effect on zebra rows
- Reduce padding a bit
- Shorten utility class
- CSS nesting
- Simplify styles and DOM
- Add `.wa-text-field` utility class
- Eliminate `--border-color` (except when set by appearance utils), `--border-style`, `--border-radius`
Revert "Replace font-size variable with `1em`"
This reverts commit 1ac70f31abe2bab310bbfbdbb3aa5d4498c5648d.
Replace font-size vars with 1em when calculating form control height
As discussed with @lindsaym-fa last week. Hopefully this will eventually help reduce duplication across themes.
Co-Authored-By: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
As discussed with @lindsaym-fa
Still unsure about some of these (especially about whether blockquote & details should be separate) but I figured better go ahead and split and we can fine tune later
Co-Authored-By: Lindsay M <126139086+lindsaym-fa@users.noreply.github.com>
- Removed BEM-style naming (the shadow DOM gives you scoping already!)
- Use new size helper
- Organize styles to keep an element’s styles together, using nesting for modifiers
- Removed unused classes
Turns out `prettier-plugin-organize-imports` sorts imports differently than the old one so this will prevent spreading the change across multiple commits whenever we touch a file (and potentially introducing conflicts)
- Reduce class names by using `:has()`, native pseudo-classes, or `[part~=foo]` selectors
- Remove `hasFocus` property since it’s no longer needed
- Move the icon hiding logic to CSS
Shared styles are now added in the base class, rather than having to be repeated in every component.
In the odd case a component does not want the shared styles, it can define a custom `styles` property of its own.
Rn this means we don't get expand animations at all but that’s fine. I think it's fine to have an animation on close and not on open (different user goals — you open to get to the info, you close to get it out of the way, the opening is more urgent)
* initial progress
* spruce up docs sample page
* clean up and organization
* revert extraneous addition to applied.css
* accidentally reverted the wrong change 😅
* take 2 - revert extraneous addition in applied.css
* more cleanup
* Simplify how list of components is exposed to 11ty
No need for functions or computing multiple times, that's what data is for!
* Add attributes to component data
* Cleanup
* Add slug (tagName without wa-)
* Add component reference / cheatsheet
* initial progress
* testing progress
* play with naming, utility classes
* more tweaking and testing
* progress on 12 column grid
* add layout index, start documenting
* documentation progress
* cleanup and doc progress
* more doc progress
* more progress
* final progress hurdle and cleanup
* refining and editing
* remove sandbox
* refactor extra utility classes
* layout index improvements
* change gap modifiers to utility classes
* change align modifiers to utility classes
* move layout examples above fold
* reduce demo markup
* use standard aspect ratio property for wa-frame
* change border-radius modifier to utility class
* rename wa-grid's 'min-inline-size' to 'min-column-size'
* clean up comments
* rename wa-align-* to wa-align-items-*
* break out style utilities from layout
* clean up
* continued ssr work
* continued ssr work
* prettier
* all components now rendering
* everything finally works
* fix type issues
* working on breadcrumb
* working on breadcrumb
* radio group
* convert all tests to ssr
* prettier
* test suite finally passing
* add layout stuff
* add changelog
* fix TS issue
* fix tests
* fixing deploy stuff
* get QR code displaying
* fix tests
* fix tests
* prettier
* condense hydration stuff
* prettier
* comment out range test
* fixing issues
* use base fixtures
* fixing examples
* dont vendor
* fix import of hydration support
* adding notes
* add notesg
* add ssr loader
* fix build
* prettier
* add notes
* add notes
* prettier
* fixing bundled stuff
* remove cdn
* remove cdn
* prettier
* fiixng tests
* prettier
* split jobs??
* prettier
* fix build stuff
* add reset mouse and await aTimeout
* prettier
* fix improper tests
* prettier
* bail on first
* fix linting
* only test form with client
* redundancy on ssr-loader??
* maybe this will work
* prettier
* try callout now
* fix form.test.ts
* fix form.test.ts
* prettier
* fix forms
* fix forms
* try again
* prettier
* add some awaits
* prettier
* comment out broken SSR tests
* prettier
* comment out broken SSR tests
* prettier
* dont skip in CI
* upgrade playwright to beta
* prettier
* try some trickery
* try some trickery
* await updateComplete
* try to fix form.test.ts
* import hydrateable elements 1 time
* prettier
* fix input defaultValue issues
* fix form controls to behave like their native counterpartS
* add changelog entry
* prettier
* fix unexpected behavior with range / button
* add test for min / maxlength
* prettier
* fix accessibility issue in tab group
* add changelog entry
gp
* fix swatches for things that dont have background colors
# # This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name:Client Tests
on:
workflow_dispatch:
push:
branches:[next]
pull_request:
branches:[next]
jobs:
client_test:
runs-on:ubuntu-latest
strategy:
matrix:
node-version:[20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name:Node.js CI
on:
push:
branches:[next]
pull_request:
branches:[next]
jobs:
build:
runs-on:ubuntu-latest
strategy:
matrix:
node-version:[18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name:SSR Tests
on:
# push:
# branches: [next]
workflow_dispatch:
jobs:
ssr_test:
runs-on:ubuntu-latest
strategy:
matrix:
node-version:[20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
Developers can use this documentation to learn how to build Web Awesome from source. You will need Node >= 14.17 to build and run the project locally.
Developers can use this documentation to learn how to build Web Awesome from source. You will need Node.js 14.17 or later to build and run the project locally.
**You don't need to do any of this to use Web Awesome!** This page is for people who want to contribute to the project, tinker with the source, or create a custom build of Web Awesome.
If that's not what you're trying to do, the [documentation website](https://shoelace.style) is where you want to be.
If that's not what you're trying to do, the [documentation website](https://webawesome.com) is where you want to be.
### What are you using to build Web Awesome?
Components are built with [LitElement](https://lit-element.polymer-project.org/), a custom elements base class that provides an intuitive API and reactive data binding. The build is a custom script with bundling powered by [esbuild](https://esbuild.github.io/).
Components are built with [Lit](https://lit.dev/), a custom elements base class that provides an intuitive API and reactive data binding. The build is a custom script with bundling powered by [esbuild](https://esbuild.github.io/).
### Understanding the Web Awesome monorepo
Web Awesome uses [npm workspaces](https://docs.npmjs.com/cli/v11/using-npm/workspaces) for its monorepo structure and is fairly minimal in what it provides.
By using npm workspaces and a monorepo structure, we can get consistent builds, shared configurations, and reduced duplication across repositories which reduces regressions and forces consistency across `webawesome`, `webawesome-pro`, and `webawesome-app`.
Generally, if you plan to only work with the free version of `webawesome` it is easiest to go to `packages/webawesome` and run all commands from there.
### Where do npm dependencies go?
Any dependencies intended to be used across all packages (i.e., `prettier`, `eslint`) that are **not** used at runtime should be in the root `devDependencies` of `package.json`.
```bash
npm install -D -w prettier
```
Any dependencies that will be used at runtime by a package should be part of the specific package's `dependencies` such as `lit`. This is required because if that dependency is not in the `packages/*/package.json`, it will not be installed when used via npm.
Individual packages are also free to install `devDependencies` as needed as long as they are specific to that package only.
To install a package specific to a Web Awesome package, change your working directory to that package's root (i.e., `cd packages/webawesome && npm install <package-name>`).
### Forking the Repo
Start by [forking the repo](https://github.com/shoelace-style/shoelace/fork) on GitHub, then clone it locally and install dependencies.
Start by [forking the repo](https://github.com/shoelace-style/webawesome/fork) on GitHub, then clone it locally and install dependencies.
Once you've cloned the repo, run the following command.
Once you've cloned the repo, run the following command from the respective directory within `packages/*`.
```bash
cd packages/webawesome
npm start
```
This will spin up the dev server. After the initial build, a browser will open automatically. There is currently no hot module reloading (HMR), as browser's don't provide a way to reregister custom elements, but most changes to the source will reload the browser automatically.
This will spin up the dev server. After the initial build, a browser will open automatically. There is currently no hot module reloading (HMR), as browsers don't provide a way to reregister custom elements, but most changes to the source will reload the browser automatically.
### Building
To generate a production build, run the following command.
```bash
cd packages/webawesome
npm run build
```
You can also run `npm run build:serve` to start an [`http-server`](https://www.npmjs.com/package/http-server) instance on `http://localhost:4000` after the build completes, so you can preview the production build.
### Creating New Components
To scaffold a new component, run the following command, replacing `wa-tag-name` with the desired tag name.
```bash
cd packages/webawesome
npm run create wa-tag-name
```
This will generate a source file, a stylesheet, and a docs page for you. When you start the dev server, you'll find the new component in the "Components" section of the sidebar.
### Adding additional packages
Right now the only additional packages are in private repositories.
To add additional packages from other repositories, run `git clone <url> packages/<package-name>` to clone your repo into `packages/`.
Make sure to run `npm install` at the root of the monorepo after adding your package!
### Contributing
Web Awesome is an open source project and contributions are encouraged! If you're interesting in contributing, please review the [contribution guidelines](CONTRIBUTING.md) first.
## License
Web Awesome is available under the terms of the MIT license.
Web Awesome is available under the terms of the [MIT License](LICENSE.md).
One of the most common use cases for badges is attaching them to buttons. To make this easier, badges will be automatically positioned at the top-right when they're a child of a button.
```html {.example}
<wa-button>
Requests
<wa-badge pill>30</wa-badge>
</wa-button>
<wa-button style="margin-inline-start: 1rem;">
Warnings
<wa-badge variant="warning" pill>8</wa-badge>
</wa-button>
<wa-button style="margin-inline-start: 1rem;">
Errors
<wa-badge variant="danger" pill>6</wa-badge>
</wa-button>
```
### With Menu Items
When including badges in menu items, use the `suffix` slot to make sure they're aligned correctly.
It's often helpful to have a button that works like a link. This is possible by setting the `href` attribute, which will make the component render an `<a>` under the hood. This gives you all the default link behavior the browser provides (e.g. [[CMD/CTRL/SHIFT]] + [[CLICK]]) and exposes the `target` and `download` attributes.
When a `target` is set, the link will receive `rel="noreferrer noopener"` for [security reasons](https://mathiasbynens.github.io/rel-noopener/).
:::
### Setting a Custom Width
As expected, buttons can be given a custom width by setting the `width` attribute. This is useful for making buttons span the full width of their container on smaller screens.
This example demonstrates how to style buttons using a custom class. This is the recommended approach if you need to add additional variations. To customize an existing variation, modify the selector to target the button's `variant` attribute instead of a class (e.g. `wa-button[variant="brand"]`).
description: Color pickers allow the user to select a color.
layout: component.njk
---
```html {.example}
<form>
<wa-color-picker required label="Select a color"></wa-color-picker>
<wa-button type="submit">Submit</wa-button>
</form>
```
:::info
This component works with standard `<form>` elements. Please refer to the section on [form controls](/getting-started/form-controls) to learn more about form submission and client-side validation.
:::
## Examples
### Initial Value
Use the `value` attribute to set an initial value for the color picker.
```html {.example}
<wa-color-picker value="#4a90e2" label="Select a color"></wa-color-picker>
```
### Opacity
Use the `opacity` attribute to enable the opacity slider. When this is enabled, the value will be displayed as HEXA, RGBA, HSLA, or HSVA based on `format`.
```html {.example}
<wa-color-picker value="#f5a623ff" opacity label="Select a color"></wa-color-picker>
```
### Formats
Set the color picker's format with the `format` attribute. Valid options include `hex`, `rgb`, `hsl`, and `hsv`. Note that the color picker's input will accept any parsable format (including CSS color names) regardless of this option.
To prevent users from toggling the format themselves, add the `no-format-toggle` attribute.
```html {.example}
<wa-color-picker format="hex" value="#4a90e2" label="Select a color"></wa-color-picker>
<wa-color-picker format="rgb" value="rgb(80, 227, 194)" label="Select a color"></wa-color-picker>
<wa-color-picker format="hsl" value="hsl(290, 87%, 47%)" label="Select a color"></wa-color-picker>
<wa-color-picker format="hsv" value="hsv(55, 89%, 97%)" label="Select a color"></wa-color-picker>
```
### Swatches
Use the `swatches` attribute to add convenient presets to the color picker. Any format the color picker can parse is acceptable (including CSS color names), but each value must be separated by a semicolon (`;`). Alternatively, you can pass an array of color values to this property using JavaScript.
description: Details show a brief summary and expand to show additional content.
layout: component.njk
---
<!-- cspell:dictionaries lorem-ipsum -->
```html {.example}
<wa-details summary="Toggle Me">
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>
```
## Examples
### Disabled
Use the `disable` attribute to prevent the details from expanding.
```html {.example}
<wa-details summary="Disabled" disabled>
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>
```
### Customizing the Summary Icon
Use the `expand-icon` and `collapse-icon` slots to change the expand and collapse icons, respectively. To disable the animation, override the `rotate` property on the `summary-icon` part as shown below.
```html {.example}
<wa-details summary="Toggle Me" class="custom-icons">
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>
<style>
wa-details.custom-icons::part(summary-icon) {
/* Disable the expand/collapse animation */
rotate: none;
}
</style>
```
### Grouping Details
Details are designed to function independently, but you can simulate a group or "accordion" where only one is shown at a time by listening for the `wa-show` event.
```html {.example}
<div class="details-group-example">
<wa-details summary="First" open>
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>
<wa-details summary="Second">
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>
<wa-details summary="Third">
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.
Add the `vertical` attribute to draw the divider in a vertical orientation. The divider will span the full height of its container. Vertical dividers work especially well inside of a flex container.
description: 'Dropdowns expose additional content that "drops down" in a panel.'
layout: component.njk
---
Dropdowns consist of a trigger and a panel. By default, activating the trigger will expose the panel and interacting outside of the panel will close it.
Dropdowns are designed to work well with [menus](/components/menu) to provide a list of options the user can select from. However, dropdowns can also be used in lower-level applications (e.g. [color picker](/components/color-picker)). The API gives you complete control over showing, hiding, and positioning the panel.
When dropdowns are used with [menus](/components/menu), you can listen for the [`wa-select`](/components/menu#events) event to determine which menu item was selected. The menu item element will be exposed in `event.detail.item`. You can set `value` props to make it easier to identify commands.
Alternatively, you can listen for the `click` event on individual menu items. Note that, using this approach, disabled menu items will still emit a `click` event.
The preferred placement of the dropdown can be set with the `placement` attribute. Note that the actual position may vary to ensure the panel remains in the viewport.
```html {.example}
<wa-dropdown placement="top-start">
<wa-button slot="trigger" caret>Edit</wa-button>
<wa-menu>
<wa-menu-item>Cut</wa-menu-item>
<wa-menu-item>Copy</wa-menu-item>
<wa-menu-item>Paste</wa-menu-item>
<wa-divider></wa-divider>
<wa-menu-item>Find</wa-menu-item>
<wa-menu-item>Replace</wa-menu-item>
</wa-menu>
</wa-dropdown>
```
### Distance
The distance from the panel to the trigger can be customized using the `distance` attribute. This value is specified in pixels.
```html {.example}
<wa-dropdown distance="30">
<wa-button slot="trigger" caret>Edit</wa-button>
<wa-menu>
<wa-menu-item>Cut</wa-menu-item>
<wa-menu-item>Copy</wa-menu-item>
<wa-menu-item>Paste</wa-menu-item>
<wa-divider></wa-divider>
<wa-menu-item>Find</wa-menu-item>
<wa-menu-item>Replace</wa-menu-item>
</wa-menu>
</wa-dropdown>
```
### Skidding
The offset of the panel along the trigger can be customized using the `skidding` attribute. This value is specified in pixels.
```html {.example}
<wa-dropdown skidding="30">
<wa-button slot="trigger" caret>Edit</wa-button>
<wa-menu>
<wa-menu-item>Cut</wa-menu-item>
<wa-menu-item>Copy</wa-menu-item>
<wa-menu-item>Paste</wa-menu-item>
<wa-divider></wa-divider>
<wa-menu-item>Find</wa-menu-item>
<wa-menu-item>Replace</wa-menu-item>
</wa-menu>
</wa-dropdown>
```
### Submenus
To create a submenu, nest an `<wa-menu slot="submenu">` element in a [menu item](/components/menu-item).
As a UX best practice, avoid using more than one level of submenu when possible.
:::
### Hoisting
Dropdown panels will be clipped if they're inside a container that has `overflow: auto|hidden`. The `hoist` attribute forces the panel to use a fixed positioning strategy, allowing it to break out of the container. In this case, the panel will be positioned relative to its [containing block](https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#Identifying_the_containing_block), which is usually the viewport unless an ancestor uses a `transform`, `perspective`, or `filter`. [Refer to this page](https://developer.mozilla.org/en-US/docs/Web/CSS/position#fixed) for more details.
Icon buttons are designed to have a uniform appearance, so their color is not inherited. However, you can still customize them by styling the `base` part.
Add the `disabled` attribute to disable the menu item so it cannot be selected.
```html {.example}
<wa-menu style="max-width: 200px;">
<wa-menu-item>Option 1</wa-menu-item>
<wa-menu-item disabled>Option 2</wa-menu-item>
<wa-menu-item>Option 3</wa-menu-item>
</wa-menu>
```
### Loading
Use the `loading` attribute to indicate that a menu item is busy. Like a disabled menu item, clicks will be suppressed until the loading state is removed.
```html {.example}
<wa-menu style="max-width: 200px;">
<wa-menu-item>Option 1</wa-menu-item>
<wa-menu-item loading>Option 2</wa-menu-item>
<wa-menu-item>Option 3</wa-menu-item>
</wa-menu>
```
### Checkbox Menu Items
Set the `type` attribute to `checkbox` to create a menu item that will toggle on and off when selected. You can use the `checked` attribute to set the initial state.
Checkbox menu items are visually indistinguishable from regular menu items. Their ability to be toggled is primarily inferred from context, much like you'd find in the menu of a native app.
The `value` attribute can be used to assign a hidden value, such as a unique identifier, to a menu item. When an item is selected, the `wa-select` event will be emitted and a reference to the item will be available at `event.detail.item`. You can use this reference to access the selected item's value, its checked state, and more.
description: Menus provide a list of options for the user to choose from.
layout: component.njk
---
You can use [menu items](/components/menu-item), [menu labels](/components/menu-label), and [dividers](/components/divider) to compose a menu. Menus support keyboard interactions, including type-to-select an option.
Menus are intended for system menus (dropdown menus, select menus, context menus, etc.). They should not be mistaken for navigation menus which serve a different purpose and have a different semantic meaning. If you're building navigation, use `<nav>` and `<a>` elements instead.
:::
## Examples
### In Dropdowns
Menus work really well when used inside [dropdowns](/components/dropdown).
```html {.example}
<wa-dropdown>
<wa-button slot="trigger" caret>Edit</wa-button>
<wa-menu>
<wa-menu-item value="cut">Cut</wa-menu-item>
<wa-menu-item value="copy">Copy</wa-menu-item>
<wa-menu-item value="paste">Paste</wa-menu-item>
</wa-menu>
</wa-dropdown>
```
### Submenus
To create a submenu, nest an `<wa-menu slot="submenu">` in any [menu item](/components/menu-item).
description: Layouts offer an easy way to scaffold pages using minimal markup.
layout: 'component.njk'
---
The layout component is designed to power full webpages. It is flexible enough to handle most modern designs and includes a simple mechanism for handling desktop and mobile navigation.
A number of sections are available as part of the layout, most of which are optional. Content is added by [slotting elements](/getting-started/usage/#slots) into various locations.
This component _does not_ implement any [content sectioning](https://developer.mozilla.org/en-US/docs/Web/HTML/Element#content_sectioning) or "semantic elements" internally (such as `<main>`, `<header>`, `<footer>`, etc.). Instead, it is recommended that you slot in content sectioning elements wherever you feel they're appropriate.
## Layout Anatomy
This image depicts the layout's anatomy, including the default positions of each section. The labels represent the [named slots](#slots) you can use to populate them.
Most slots are optional. Slots that have no content will not be shown, allowing you to opt-in to just the sections of the layout you actually need.

:::info
If you're not familiar with how slots work in HTML, you might want to [learn more about slots](/getting-started/usage/#slots) before using this component.
:::
## Sticky Sections
The following sections of the layout are "sticky" by default, meaning they remain in position as the user scrolls.
-`banner`
-`header`
-`sub-header`
-`aside`
-`menu`
This is often desirable, but you can change this behavior using the `disable-sticky` attribute. Use a space-delimited list of names to tell the layout which sections should not be sticky.
The layout component _does not_ apply spacing for you. You can apply the appropriate paddings or margins directly to the elements you slot in to fine tune your spacing needs.
TODO - add example here
When using `<wa-page>`, make sure to zero out all paddings and margins on `<html>` and `<body>`, otherwise you may see unexpected gaps. The following styles are highly recommended when using `<wa-page>`.
```css
html,
body{
min-height:100%;
height:100%;
padding:0;
margin:0;
}
```
## Skip To Content
The layout provides a "skip to content" link that's visually hidden until the user tabs into it. You don't have to do anything to configure this, unless you want to change the text displayed in the link. In that case, you can slot in your own text using the `skip-to-content` slot.
This example localizes the "skip to content" link for German users.
The layout component tries not to have too many opinions in terms of responsive behaviors —you get to decide with your own CSS and media queries how your content responds! However, the navigation menu _does_ respond by collapsing on smaller screens. The breakpoint at which this occurs is 768px by default, but you can change it using the `mobile-breakpoint` attribute.
```html
<wa-pagemobile-breakpoint="600"> ... </wa-page>
```
You can provide a button to toggle the navigation menu anywhere inside the layout by adding the `data-toggle-nav` attribute. (This _does not_ have to be a Web Awesome button.)
```html
<wa-pagemobile-breakpoint="600">
...
<wa-buttondata-toggle-nav>Menu</wa-button>
...
</wa-page>
```
Alternatively, you can apply `nav-state="open"` and `nav-state="closed"` to the layout component to show and hide the navigation, respectively.
```html
<wa-pagenav-state="open"> ... </wa-page>
```
## Providing Navigation Items
- TODO - example with navigation items
- TODO - example with`<h2>` and `<a>` as navigation items
## Examples
### Hero Layout
- TODO - Sticky header + main + footer
### Blog Layout
- TODO - Sticky header + main + aside + footer (blog)
### App Layout
- TODO - Menu + main, plus maybe headers and footers in each (app)
description: Radios buttons allow the user to select a single option from a group using a button-like control.
layout: component.njk
---
Radio buttons are designed to be used with [radio groups](/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">
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">
description: Radios allow the user to select a single option from a group.
layout: component.njk
---
Radios are designed to be used with [radio groups](/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="3">Option 3</wa-radio>
</wa-radio-group>
```
:::info
This component works with standard `<form>` elements. Please refer to the section on [form controls](/getting-started/form-controls) to learn more about form submission and client-side validation.
:::
## Examples
### Initial Value
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="3">
<wa-radio value="1">Option 1</wa-radio><br>
<wa-radio value="2">Option 2</wa-radio><br>
<wa-radio value="3">Option 3</wa-radio>
</wa-radio-group>
```
### Disabled
Use the `disabled` attribute to disable a radio.
```html {.example}
<wa-radio-group label="Select an option" name="a" value="1">
description: Ranges allow the user to select a single value within a given range using a slider.
layout: component.njk
---
```html {.example}
<wa-range></wa-range>
```
:::info
This component works with standard `<form>` elements. Please refer to the section on [form controls](/getting-started/form-controls) to learn more about form submission and client-side validation.
:::
## Examples
### Labels
Use the `label` attribute to give the range an accessible label. For labels that contain HTML, use the `label` slot instead.
Add descriptive help text to a range with the `help-text` attribute. For help texts that contain HTML, use the `help-text` slot instead.
```html {.example}
<wa-range label="Volume" help-text="Controls the volume of the current song." min="0" max="100"></wa-range>
```
### Min, Max, and Step
Use the `min` and `max` attributes to set the range's minimum and maximum values, respectively. The `step` attribute determines the value's interval when increasing and decreasing.
```html {.example}
<wa-range min="0" max="10" step="1"></wa-range>
```
### Disabled
Use the `disabled` attribute to disable a slider.
```html {.example}
<wa-range disabled></wa-range>
```
### Tooltip Placement
By default, the tooltip is shown on top. Set `tooltip` to `bottom` to show it below the slider.
```html {.example}
<wa-range tooltip="bottom"></wa-range>
```
### Disable the Tooltip
To disable the tooltip, set `tooltip` to `none`.
```html {.example}
<wa-range tooltip="none"></wa-range>
```
### Custom Track Colors
You can customize the active and inactive portions of the track using the `--track-color-active` and `--track-color-inactive` custom properties.
description: Selects allow you to choose items from a menu of predefined options.
layout: component.njk
---
```html {.example}
<wa-select>
<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>
```
:::info
This component works with standard `<form>` elements. Please refer to the section on [form controls](/getting-started/form-controls) to learn more about form submission and client-side validation.
:::
## Examples
### Labels
Use the `label` attribute to give the select an accessible label. For labels that contain HTML, use the `label` slot instead.
```html {.example}
<wa-select label="Select one">
<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>
```
### Help Text
Add descriptive help text to a select with the `help-text` attribute. For help texts that contain HTML, use the `help-text` slot instead.
```html {.example}
<wa-select label="Experience" help-text="Please tell us your skill level.">
<wa-option value="1">Novice</wa-option>
<wa-option value="2">Intermediate</wa-option>
<wa-option value="3">Advanced</wa-option>
</wa-select>
```
### Placeholders
Use the `placeholder` attribute to add a placeholder.
```html {.example}
<wa-select placeholder="Select one">
<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>
```
### Clearable
Use the `clearable` attribute to make the control clearable. The clear button only appears when an option is selected.
```html {.example}
<wa-select clearable 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>
```
### Filled Selects
Add the `filled` attribute to draw a filled select.
```html {.example}
<wa-select filled>
<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>
```
### Pill
Use the `pill` attribute to give selects rounded edges.
```html {.example}
<wa-select pill>
<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>
```
### Disabled
Use the `disabled` attribute to disable a select.
```html {.example}
<wa-select placeholder="Disabled" disabled>
<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>
```
### Multiple
To allow multiple options to be selected, use the `multiple` attribute. It's a good practice to use `clearable` when this option is enabled. To set multiple values at once, set `value` to a space-delimited list of values.
```html {.example}
<wa-select label="Select a Few" value="option-1 option-2 option-3" multiple clearable>
<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>
```
:::info
Note that multi-select options may wrap, causing the control to expand vertically. You can use the `max-options-visible` attribute to control the maximum number of selected options to show at once.
:::
### Setting Initial Values
Use the `value` attribute to set the initial selection.
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.
Use `<wa-divider>` to group listbox items visually. You can also use `<small>` to provide labels, but they won't be announced by most assistive devices.
```html {.example}
<wa-select>
<small>Section 1</small>
<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-divider></wa-divider>
<small>Section 2</small>
<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>
```
### Sizes
Use the `size` attribute to change a select's size. Note that size does not apply to listbox options.
```html {.example}
<wa-select placeholder="Small" size="small">
<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>
<br />
<wa-select placeholder="Medium" size="medium">
<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>
<br />
<wa-select placeholder="Large" size="large">
<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>
```
### Placement
The preferred placement of the select's listbox can be set with the `placement` attribute. Note that the actual position may vary to ensure the panel remains in the viewport. Valid placements are `top` and `bottom`.
```html {.example}
<wa-select placement="top">
<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>
```
### Prefix Icons
Use the `prefix` slot to prepend an icon to the control.
When multiple options can be selected, you can provide custom tags by passing a function to the `getTag` property. Your function can return a string of HTML, a <a href="https://lit.dev/docs/templates/overview/">Lit Template</a>, or an [`HTMLElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement). The `getTag()` function will be called for each option. The first argument is an `<wa-option>` element and the second argument is the tag's index (its position in the tag list).
Remember that custom tags are rendered in a shadow root. To style them, you can use the `style` attribute in your template or you can add your own [parts](/getting-started/customizing/#css-parts) and target them with the [`::part()`](https://developer.mozilla.org/en-US/docs/Web/CSS/::part) selector.
description: The visually hidden utility makes content accessible to assistive devices without displaying it on the screen.
layout: component.njk
---
According to [The A11Y Project](https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/), "there are real world situations where visually hiding content may be appropriate, while the content should remain available to assistive technologies, such as screen readers. For instance, hiding a search field's label as a common magnifying glass icon is used in its stead."
Since visually hidden content can receive focus when tabbing, the element will become visible when something inside receives focus. This behavior is intentional, as sighted keyboard user won't be able to determine where the focus indicator is without it.
```html {.example}
<div style="min-height: 1.875rem;">
<wa-visually-hidden>
<a href="#">Skip to main content</a>
</wa-visually-hidden>
</div>
```
## Examples
### Links That Open in New Windows
In this example, the link will open a new window. Screen readers will announce "opens in a new window" even though the text content isn't visible to sighted users.
<wa-visually-hidden>opens in a new window</wa-visually-hidden>
</a>
```
### Content Conveyed By Context
Adding a label may seem redundant at times, but they're very helpful for unsighted users. Rather than omit them, you can provide context to unsighted users with visually hidden content that will be announced by assistive devices such as screen readers.
description: Learn how to customize Web Awesome through parts and custom properties.
layout: page.njk
---
Web Awesome components can be customized at a high level through design tokens. 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.
## Design Tokens
Web Awesome makes use of several design tokens to provide a consistent appearance across components. You can customize them and use them in your own application with pure CSS — no preprocessor required.
Design tokens offer a high-level way to customize the library with minimal effort. There are no component-specific variables, however, as design tokens are intended to be generic and highly reusable. To customize an individual component, refer to the section entitled [CSS Parts](#css-parts).
Design tokens are accessed through CSS custom properties that are defined in your theme. Because design tokens live at the page level, they're prefixed with `--wa-` to avoid collisions with other libraries.
To customize a design token, simply override it in your stylesheet using a `:root` block. Here's an example that changes the primary theme to purple based on existing [color primitives](/tokens/color#primitives).
```css
:root{
/* Changes the primary theme color to purple using primitives */
Many design tokens are described further along in this documentation. For a complete list, refer to `src/themes/default.css` in the project's [source code](https://github.com/shoelace-style/shoelace/blob/current/src/themes/default.css).
## CSS Parts
Whereas design tokens offer a high-level way to customize the library, CSS parts offer a low-level way to customize individual components. Again, this is done with pure CSS — no preprocessor required.
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 "parts" that can be targeted with the [CSS part selector](https://developer.mozilla.org/en-US/docs/Web/CSS/::part), or `::part()`.
Here's an example that modifies buttons with the `tomato-button` class.
At first glance, this approach might seem a bit verbose or even limiting, but it comes with a few important advantages:
- Customizations can be made to components with explicit selectors, such as `::part(icon)`, rather than implicit selectors, such as `.button > div > span + .icon`, that are much more fragile.
- The internal structure of a component will likely change as it evolves. By exposing CSS parts through an API, the internals can be reworked without fear of breaking customizations as long as its parts remain intact.
- 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.
## Custom Properties
For convenience, some components expose CSS custom properties you can override. These are not design tokens, nor do they have the same `--wa-` prefix since they're scoped to a component.
You can set custom properties on a component in your stylesheet.
```css
wa-avatar {
--size: 6rem;
}
```
This will also work if you need to target a subset of components with a specific class.
```css
wa-avatar.your-class {
--size: 6rem;
}
```
Alternatively, you can set them inline directly on the element.
```html
<wa-avatar style="--size: 6rem;"></wa-avatar>
```
Not all components expose CSS custom properties. For those that do, they can be found in the component's API documentation.
Adding the `wa-valid` or `wa-invalid` class to a form control will change its appearance. This is useful for applying validation styles to server-rendered form controls.
The styles shown below can be all yours by adding Web Awesome's applied stylesheet to your project.
---
## Typography
Vel risus commodo viverra maecenas accumsan lacus vel facilisis volutpat. Amet mauris commodo quis imperdiet. Bibendum ut tristique et egestas quis ipsum suspendisse. Sit amet nulla facilisi morbi tempus iaculis urna id volutpat.
Cras pulvinar mattis nunc sed blandit libero. Facilisis magna etiam tempor orci. Scelerisque eleifend donec pretium vulputate sapien nec. Donec et odio pellentesque diam volutpat commodo sed egestas egestas. Mauris rhoncus aenean vel elit scelerisque mauris pellentesque.
> What is a Web year now, about three months? And when people can browse around, discover new things, and download them fast, when we all have agents - then Web years could slip by before human beings can notice.
>
> — Tim Berners-Lee
## Inline Text
```html
Feugiat nisl pretium fusce id. Ipsum dolor sit amet consectetur adipiscing elit. Eget nunc lobortis mattis aliquam faucibus purus. Metus dictum at tempor commodo ullamcorper a lacus vestibulum. Urna condimentum mattis pellentesque id nibh tortor id.
```
<div class="docs-grid">
<p><strong>Bold</strong></p>
<p><em>Italics</em></p>
<p><u>Underline</u></p>
<p><del>Deleted</del></p>
<p><ins>Inserted</ins></p>
<p><s>Strike-through</s></p>
<p><small>Small</small></p>
<p><span>Text <sub>Sub</sub></span></p>
<p><span>Text <sup>Sup</sup></span></p>
<p><abbr title="Abbreviation">Abbr.</abbr></p>
<p><kbd>Keyboard</kbd></p>
<p><mark>Highlighted</mark></p>
<p><a href="#">Link text</a></p>
<p><code>Inline code</code></p>
</div>
## Lists
- List item 1
- List item 2
- List item 3
- Subitem a
- Subitem b
1. List item 1
2. List item 2
3. List item 3
- Subitem a
- Subitem b
## Headings
### Heading 3
Feugiat nisl pretium fusce id. Ipsum dolor sit amet consectetur adipiscing elit. Eget nunc lobortis mattis aliquam faucibus purus. Metus dictum at tempor commodo ullamcorper a lacus vestibulum. Urna condimentum mattis pellentesque id nibh tortor id.
#### Heading 4
Gravida arcu ac tortor dignissim convallis aenean. Pellentesque pulvinar pellentesque habitant morbi tristique senectus et. Ipsum nunc aliquet bibendum enim facilisis gravida neque. Donec adipiscing tristique risus nec feugiat in.
##### Heading 5
Enim diam vulputate ut pharetra sit. Enim facilisis gravida neque convallis a cras. Enim neque volutpat ac tincidunt vitae semper. Sed egestas egestas fringilla phasellus faucibus scelerisque eleifend donec pretium.
###### Heading 6
Tincidunt ornare massa eget egestas purus viverra accumsan in nisl. Facilisis mauris sit amet massa vitae. Nunc faucibus a pellentesque sit amet porttitor. Adipiscing tristique risus nec feugiat in fermentum.
## Details
Individual details look like this.
<details>
<summary>Tincidunt nunc pulvinar</summary>
<p>Ut lectus arcu bibendum at varius. Convallis a cras semper auctor neque vitae. Odio pellentesque diam volutpat commodo sed egestas. Amet dictum sit amet justo donec enim diam vulputate ut.</p>
</details>
Grouping them provides accordion-style functionality.
<details>
<summary>Enim diam</summary>
<p>Nunc faucibus a pellentesque sit amet porttitor. Adipiscing tristique risus nec feugiat in fermentum. Leo duis ut diam quam nulla porttitor massa id. Mauris nunc congue nisi vitae.</p>
</details>
<details>
<summary>Arcu non odio</summary>
<p>Sed libero enim sed faucibus turpis in eu mi bibendum. Nunc mi ipsum faucibus vitae aliquet nec. Ultricies tristique nulla aliquet enim tortor. Tellus at urna condimentum mattis pellentesque.</p>
</details>
<details>
<summary>Ut porttitor</summary>
<p>Eu facilisis sed odio morbi quis commodo odio aenean sed. Sit amet purus gravida quis blandit turpis cursus. Eu consequat ac felis donec et odio pellentesque diam volutpat.</p>
</details>
## Code Blocks
```
// do a thing
export function thing() {
return true;
}
```
## Images

## Tables
<table>
<caption>I'm just a table</caption>
<thead>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
</tr>
<tr>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
</tr>
<tr>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
</tr>
<tr>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
<td>Cell</td>
</tr>
</tbody>
</table>
## Definition Lists
<dl>
<dt>Definition 1</dt>
<dd>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.</dd>
<dt>Definition 2</dt>
<dd>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</dd>
<dt>Definition 3</dt>
<dd>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</dd>
description: Choose the installation method that works best for you.
layout: page.njk
---
You can load Web Awesome via CDN or by installing it locally. If you're using a framework, make sure to check out the pages for [React](/frameworks/react), [Vue](/frameworks/vue), and [Angular](/frameworks/angular) for additional information.
The experimental autoloader is the easiest and most efficient 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.
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.
The traditional CDN loader registers all Web Awesome elements up front. Note that, if you're only using a handful of components, it will be much more efficient to stick with the autoloader. However, you can also [cherry pick](#cherry-picking) components if you want to load specific ones up front.
The code above will load the light theme. If you want to use the [dark theme](/getting-started/themes#dark-theme) instead, update the stylesheet as shown below and add `<html class="wa-theme-default-dark">` to your page.
If you want to load the light or dark theme based on the user's `prefers-color-scheme` setting, use the stylesheets below. The `media` attributes ensure that only the user's preferred theme stylesheet loads and the `onload` attribute sets the appropriate [theme class](/getting-started/themes) on the `<html>` element.
Now you can [start using Web Awesome!](/getting-started/usage)
## npm installation
If you don't want to use the CDN, you can install Web Awesome from npm with the following command.
```bash
npm install @shoelace-style/shoelace
```
It's up to you to make the source files available to your app. One way to do this is to create a route in your app called `/shoelace` that serves static files from `node_modules/@shoelace-style/shoelace`.
Once you've done that, add the following tags to your page. Make sure to update `href` and `src` so they point to the route you created.
Alternatively, [you can use a bundler](#bundling).
:::info
For clarity, the docs will usually show imports from `@shoelace-style/shoelace`. If you're not using a module resolver or bundler, you'll need to adjust these paths to point to the folder Web Awesome is in.
:::
## 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 `autoloader.js` and will "just work" for most users.
However, if you're [cherry picking](#cherry-picking) or [bundling](#bundling) Web Awesome, you'll need to set the base path. You can do this one of two ways.
An easy way to make sure the base path is configured properly is to check if [icons](/components/icon) are loading.
:::
### Referencing Assets
Most of the magic behind assets is handled internally by Web Awesome, but if you need to reference the base path for any reason, the same module exports a function called `getBasePath()`. An optional string argument can be passed, allowing you to get the full path to any asset.
// Get the path to an asset, e.g. /path/to/assets/file.ext
constassetPath=getBasePath('file.ext');
</script>
```
## Setting a Kit Code
Font Awesome users can set their kit code to unlock Font Awesome Pro icons. You can provide it through the `data-fa-kit-code` attribute or by calling the `setKitCode()` method.
Cherry picking can be done from [the CDN](#cdn-installation-easiest) or from [npm](#npm-installation). This approach will load only 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.
Here's an example that loads only the button component. Again, if you're not using a module resolver, you'll need to adjust the path to point to the folder Web Awesome is in.
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.
:::
## Bundling
Web Awesome is distributed as a collection of standard ES modules that [all modern browsers can understand](https://caniuse.com/es6-module). However, importing a lot of modules can result in a lot of HTTP requests and potentially longer load times. Using a CDN can alleviate this, but some users may wish to further optimize their imports with a bundler.
To use Web Awesome with a bundler, first install Web Awesome along with your bundler of choice.
```bash
npm install @shoelace-style/webawesome
```
Now it's time to configure your bundler. Configurations vary for each tool, but here are some examples to help you get started.
// Set the base path to the folder you copied Web Awesome's assets to
setBasePath('/path/to/web-awesome/%NPMDIR%');
// <wa-button>, <wa-icon>, <wa-input>, and <wa-rating> are ready to use!
```
## The difference between CDN and npm
You'll notice that the CDN links all start with `/%CDNDIR%/<path>` and npm imports use `/%NPMDIR%/<path>`. The `/%CDNDIR%` files are bundled separately from the `/%NPMDIR%` files. The `/%CDNDIR%` files come pre-bundled, which means all dependencies are inlined so you do not need to worry about loading additional libraries. The `/%NPMDIR%` files **DO NOT** come pre-bundled, allowing your bundler of choice to more efficiently deduplicate dependencies, resulting in smaller bundles and optimal code sharing.
TL;DR:
-`/path/to/web-awesome/%CDNDIR%` is for CDN users
-`/path/to/web-awesome/%NPMDIR%` is for npm users
This change was introduced in `v2.5.0` to address issues around installations from npm loading multiple versions of libraries (such as the Lit) that Web Awesome uses internally.
<wa-radio-group label="Delivery Method" help-text="Select an option that makes you proud." name="a" value="1" class="full-row" style="margin-top: 1.5rem;">
description: Web Awesome has a growing community of designers and developers that are building amazing things with web components.
layout: page.njk
---
Web Awesome has a growing community of designers and developers that are building amazing things with web components. We'd love for you to become a part of it!
Please be respectful of other users and remember that Web Awesome is an open source project. We'll try to help when we can, but there's no guarantee we'll be able solve your problem. Please manage your expectations and don't forget to contribute back to the conversation when you can!
## Discussion Forum
The [discussion forum](https://github.com/shoelace-style/shoelace/discussions) is open to anyone with a GitHub account. This is the best place to:
- Ask for help
- Share ideas and get feedback
- Show the community what you're working on
- Learn more about the project, its values, and its roadmap
Follow [@webawesomer](https://twitter.com/webawesomer) on Twitter for general updates and announcements about Web Awesome. This is a great place to say "hi" or to share something you're working on.
**Please avoid using Twitter for support questions.** The [discussion forum](https://github.com/shoelace-style/shoelace/discussions) is a much better place to share code snippets, screenshots, and other troubleshooting info. You'll have much better luck there, as more users will have a chance to help you.
description: Everything you need to know about theming Web Awesome.
layout: page.njk
---
Web Awesome is designed to be highly customizable through pure CSS. Out of the box, you can choose from a light or dark theme. Alternatively, you can design your own theme.
A theme is nothing more than a stylesheet that uses the Web Awesome API to define design tokens and apply custom styles to components. To create a theme, you will need a decent understanding of CSS, including [CSS Custom Properties](https://developer.mozilla.org/en-US/docs/Web/CSS/--*) and the [`::part` selector](https://developer.mozilla.org/en-US/docs/Web/CSS/::part).
:::info
For component developers, built-in themes are also available as JavaScript modules that export [Lit CSSResult](https://lit.dev/docs/api/styles/#CSSResult) objects. You can find them in `/%NPMDIR%/themes/*.styles.js`.
:::
## Theme Basics
All themes are scoped to classes using the `wa-theme-{name}` convention, where `{name}` is a lowercase, hyphen-delimited value representing the name of the theme. The included light and dark themes use `wa-theme-default-light` and `wa-theme-default-dark`, respectively. A custom theme called "Purple Power", for example, would use a class called `wa-theme-purple-power`
All selectors must be scoped to the theme's class to ensure interoperability with other themes. You should also scope them to `:host` so they can be imported and applied to custom element shadow roots.
```css
:host,
.wa-theme-purple-power{
/* ... */
}
```
### Activating Themes
To activate a theme, import it and apply the theme's class to the `<html>` element. This example imports and activates the built-in dark theme.
There is one exception to this rule — the light theme _does not_ need to be activated. For convenience, the light theme is scoped to `:root` and will be activated by default when imported.
:::
### Using Multiple Themes
You can activate themes on various containers throughout the page. This example uses the light theme with a dark-themed sidebar.
It's for this reason that themes must be scoped to specific classes.
## Creating Themes
There are two ways to create themes. The easiest way is to customize a built-in theme. The advanced way is to create a new theme from scratch. Which method you choose depends on your project's requirements and the amount of effort you're willing to commit to.
### Customizing a Built-in Theme
The easiest way to customize Web Awesome is to override one of the built-in themes. You can do this by importing the light or dark theme as-is, then creating a separate stylesheet that overrides [design tokens](/getting-started/customizing#design-tokens) and adds [component styles](/getting-started/customizing#component-parts) to your liking. You must import your theme _after_ the built-in theme.
If you're customizing the light theme, you should scope your styles to the following selectors.
```css
:root,
:host,
.wa-theme-default-light{
/* your custom styles here */
}
```
If you're customizing the dark theme, you should scope your styles to the following selectors.
```css
:host,
.wa-theme-default-dark{
/* your custom styles here */
}
```
By customizing a built-in theme, you'll maintain a smaller stylesheet containing only the changes you've made. Contrast this to [creating a new theme](#creating-a-new-theme), where you need to explicitly define every design token required by the library. This approach is more "future-proof," as new design tokens that emerge in subsequent versions of Web Awesome will be accounted for by the built-in theme.
While this approach is easier to maintain, the drawback is that your theme can't be activated independently — it's tied to the built-in theme you're extending.
### Creating a New Theme
Creating a new theme is more of an undertaking than [customizing an existing one](#customizing-a-built-in-theme). At a minimum, you must implement all of the required design tokens. The easiest way to do this is by "forking" one of the built-in themes and modifying it from there.
Start by changing the selector to match your theme's name. Assuming your new theme is called "Purple Power", your theme should be scoped like this.
```css
:host,
.wa-theme-purple-power{
/* your custom styles here */
}
```
By creating a new theme, you won't be relying on a built-in theme as a foundation. Because the theme is decoupled from the built-ins, you can activate it independently as an alternative to the built-ins. This is the recommended approach if you're looking to open source your theme for others to use.
You will, however, need to maintain your theme more carefully, as new versions of Web Awesome may introduce new design tokens that your theme won't have accounted for. Because of this, it's recommended that you clearly specify which version(s) of Web Awesome your theme is designed to work with and keep it up to date as new versions of Web Awesome are released.
## Dark Theme
The built-in dark theme uses an inverted color scale so, if you're using design tokens as intended, you'll get dark mode for free. While this isn't the same as a professionally curated dark theme, it provides an excellent baseline for one and you're encouraged to customize it depending on your needs.
The dark theme works by taking the light theme's [color tokens](/tokens/color) and "flipping" the scale so 100 becomes 900, 200 becomes 800, 300 becomes 700, etc. Next, the luminance of each primitive was fine-tuned to avoid true black, which is often undesirable in dark themes, and provide a richer experience. The result is a custom dark palette that complements the light theme and makes it easy to offer light and dark modes with minimal effort.
To install the dark theme, add the following to the `<head>` section of your page.
To activate the theme, apply the `wa-theme-default-dark` class to the `<html>` element.
```html
<htmlclass="wa-theme-default-dark">
...
</html>
```
### Detecting the User's Color Scheme Preference
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
- Allow the user to override the setting in your app
- Remember the user's preference and restore it on subsequent logins
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.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
<p class="copy wa-body-l line-length line-length-m" style="text-align: center;">Mind the <code>wa-gap</code>! webawesome.com is undergoing maintenance and will be back shortly.</p>
<strong style="margin-inline-end: var(--wa-space-2xs)">Web Awesome is here!</strong>
Celebrate with <span class="appearance-underlined variant-drawn">20% off</span> on a Web Awesome Pro plan… <span class="appearance-underlined variant-drawn">for life</span>!
<h2 class="wa-heading-2xl brand-font">Get a lifetime discount on Web Awesome Pro!</h2>
</div>
</div>
<div class="wa-stack wa-gap-l">
<p>Celebrate our official launch with a 20% discount on a Web Awesome Pro plan…<span class="appearance-underlined variant-drawn" style="--underline-color: var(--wa-color-brand);">for life</span>! But hurry, this lifetime discount is only available for a limited time.</p>
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.