Merge branch 'next' into kj/bug-fix-for-filled-outlined

This commit is contained in:
Lindsay M
2025-11-17 15:06:17 -05:00
committed by GitHub
24 changed files with 242 additions and 150 deletions

View File

@@ -1,6 +1,5 @@
import { nanoid } from 'nanoid';
import { parse as HTMLParse } from 'node-html-parser';
import { execFileSync } from 'node:child_process';
import * as fs from 'node:fs';
import * as path from 'node:path';
import { anchorHeadingsTransformer } from './_transformers/anchor-headings.js';
@@ -21,7 +20,6 @@ import { replaceTextPlugin } from './_plugins/replace-text.js';
import { searchPlugin } from './_plugins/search.js';
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
const isDev = process.argv.includes('--develop');
const ignoreGit = process.env.ELEVENTY_IGNORE_GIT === 'true';
const passThroughExtensions = ['js', 'css', 'png', 'svg', 'jpg', 'mp4'];
async function getPackageData() {
@@ -60,15 +58,6 @@ export default async function (eleventyConfig) {
if (updateComponentData) {
allComponents = getComponents();
}
// Invalidate last-modified cache for changed content files during watch
if (Array.isArray(changedFiles)) {
for (const file of changedFiles) {
if (/\.(md|njk|html)$/i.test(file)) {
lastModCache.delete(file);
}
}
}
});
/**
@@ -135,78 +124,8 @@ export default async function (eleventyConfig) {
eleventyConfig.addFilter('stripExtension', string => path.parse(string + '').name);
eleventyConfig.addFilter('stripPrefix', content => content.replace(/^wa-/, ''));
eleventyConfig.addFilter('uniqueId', (_value, length = 8) => nanoid(length));
// Returns last modified date as ISO 8601 (UTC, Z-suffixed)
// Fallback order: front matter override -> Git last commit date -> filesystem mtime -> now
// Caching: in-memory per inputPath during one build/dev session
// Override: pass a Date or string: {{ page.inputPath | gitLastModifiedISO(lastUpdated) }}
const lastModCache = new Map();
let repoRoot = null; // lazily resolved; null => not resolved, undefined => failed
function getLastModifiedISO(inputPath, overrideDate) {
if (overrideDate instanceof Date) {
return overrideDate.toISOString();
}
if (typeof overrideDate === 'string' && overrideDate) {
const parsed = new Date(overrideDate);
if (!isNaN(parsed.getTime())) return parsed.toISOString();
}
if (!inputPath) return new Date().toISOString();
if (lastModCache.has(inputPath)) return lastModCache.get(inputPath);
// Try Git (ISO via %cI). Use a repo-root-relative path for portability.
if (!ignoreGit) {
try {
if (repoRoot === null) {
try {
repoRoot = execFileSync('git', ['rev-parse', '--show-toplevel'], {
stdio: ['ignore', 'pipe', 'ignore'],
cwd: __dirname,
})
.toString()
.trim();
} catch (_) {
repoRoot = undefined;
}
}
const gitPath = repoRoot ? path.relative(repoRoot, inputPath) : inputPath;
const args = ['log', '-1', '--format=%cI', '--follow', '--', gitPath];
const result = execFileSync('git', args, {
stdio: ['ignore', 'pipe', 'ignore'],
cwd: repoRoot || path.dirname(inputPath),
})
.toString()
.trim();
if (result) {
const iso = new Date(result).toISOString();
lastModCache.set(inputPath, iso);
return iso;
}
} catch (_) {
// continue to fs fallback
}
}
// Fallback to filesystem mtime
try {
const stats = fs.statSync(inputPath);
const iso = new Date(stats.mtime).toISOString();
lastModCache.set(inputPath, iso);
return iso;
} catch (_) {
const now = new Date().toISOString();
lastModCache.set(inputPath, now);
return now;
}
}
eleventyConfig.addFilter('gitLastModifiedISO', function (inputPath, overrideDate) {
return getLastModifiedISO(inputPath, overrideDate);
});
// Attach lastUpdatedISO to page data so templates can use {{ lastUpdatedISO }} directly
eleventyConfig.addGlobalData('eleventyComputed', {
lastUpdatedISO: data => getLastModifiedISO(data.page?.inputPath, data.lastUpdated),
// Page title with smart + default site name formatting
pageTitle: data => composePageTitle(data.title),
// Open Graph title with smart + default site name formatting
@@ -220,6 +139,7 @@ export default async function (eleventyConfig) {
},
ogType: data => data.ogType || 'website',
});
// Trims whitespace and pipes from the start and end of a string. Useful for CEM types, which can be pipe-delimited.
// With Prettier 3, this means a leading pipe will exist be present when the line wraps.
eleventyConfig.addFilter('trimPipes', content => {
@@ -393,18 +313,19 @@ export default async function (eleventyConfig) {
// This needs to happen in "eleventy.after" otherwise incremental builds never update.
eleventyConfig.on('eleventy.after', function () {
let assetsDir = path.join(process.env.BASE_DIR || 'docs', 'assets');
const baseDir = process.env.BASE_DIR || 'docs';
let assetsDir = path.join(baseDir, 'assets');
const siteAssetsDir = path.join(eleventyConfig.directories.output, 'assets');
fs.cpSync(assetsDir, siteAssetsDir, { recursive: true });
// Passthrough copy for manifest.json (PWA manifest file)
fs.cpSync(path.join(baseDir, 'manifest.json'), path.join(eleventyConfig.directories.output, 'manifest.json'));
});
for (let glob of passThrough) {
eleventyConfig.addPassthroughCopy(glob);
}
// Passthrough copy for manifest.json (PWA manifest file)
eleventyConfig.addPassthroughCopy('manifest.json');
// // SSR plugin
// if (!isDev) {
// //

View File

@@ -1,5 +1,5 @@
{% raw %}
{%- if not currentUser.hasPro -%}
{%- if req.stripe.discount.active and not currentUser.hasPro -%}
<div slot="banner" class="banner-wa-launch wa-dark">
<div class="banner-content wa-split">
<div class="wa-cluster wa-gap-s">

View File

@@ -0,0 +1,95 @@
{% raw %}
{%- if req.stripe.discount.active and not currentUser.hasPro -%}
<wa-dialog id="dialog-site" light-dismiss without-header>
<div class="background-wa-pattern" style="justify-content: center; margin-inline: calc(var(--spacing) * -1); margin-block-start: calc(var(--spacing) * -1); margin-block-end: var(--spacing); background: linear-gradient(to bottom, var(--wa-color-brand), var(--wa-color-brand-50)); color: var(--wa-color-brand-on-loud); padding: var(--wa-space-3xl) var(--spacing); --background-pattern-opacity: 0.2; --background-pattern-image: url('/assets/images/bg-wa-pattern.svg');">
<div class="wa-stack wa-align-items-center" style="text-align: center;">
<wa-icon name="party-horn" family="duotone" variant="solid" style="font-size: var(--wa-font-size-3xl); --secondary-color: var(--wa-color-brand-40); --secondary-opacity: 1.0;"></wa-icon>
<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&hellip;<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>
<div class="wa-split">
<wa-button type="button" appearance="plain" data-dialog="close" class="plausible-event-name=launch_dialog:close_button_click">Maybe Later</wa-button>
<wa-button variant="neutral" appearance="accent" href="/purchase" class="brand-font plausible-event-name=launch_dialog:pro_purchase_button_click">
<wa-icon slot="start" variant="regular" name="rocket-launch"></wa-icon>
Get Pro + Save 20%
</wa-button>
</div>
</div>
</wa-dialog>
<script type="module">
(function() {
const SITE_DIALOG_DISMISSED_KEY = 'dialog-wa-launch-sale-dismissed';
// Early exit if user has dismissed the dialog
try {
if (localStorage.getItem(SITE_DIALOG_DISMISSED_KEY) === 'true') {
return;
}
} catch (e) {
// localStorage may be disabled or unavailable
return;
}
// Wait for DOM and dialog element
const dialog = document.getElementById('dialog-site');
if (!dialog) {
return;
}
// Helper function to safely track Plausible events
const trackEvent = (eventName) => {
if (typeof plausible !== 'undefined') {
plausible(eventName);
}
};
// Initialize dialog functionality
let initCalled = false;
const initDialog = () => {
// Prevent double initialization
if (initCalled) {
return;
}
initCalled = true;
// Track when dialog is shown
dialog.addEventListener('wa-show', () => {
trackEvent('launch_dialog:view');
}, { once: true });
// Track when dialog is dismissed
dialog.addEventListener('wa-hide', (event) => {
// Track overlay click or Escape key dismissal
// Button clicks are tracked via CSS classes, so we only track non-button dismissals
if (event.detail?.source === dialog) {
trackEvent('launch_dialog:overlay_click');
}
// Save dismissal state to localStorage
try {
localStorage.setItem(SITE_DIALOG_DISMISSED_KEY, 'true');
} catch (e) {
// localStorage may be disabled or unavailable
}
}, { once: true });
// Show dialog after a short delay to ensure page is loaded
setTimeout(() => {
dialog.open = true;
}, 500);
};
customElements.whenDefined("wa-dialog").then(() => {
initDialog()
})
})();
</script>
{%- endif -%}
{% endraw %}

View File

@@ -1,5 +1,9 @@
<!DOCTYPE html>
<html lang="en" data-fa-kit-code="38c11e3f20" data-version="{{ package.version }}" class="wa-cloak">
{% if hasAnchors == undefined %}{% set hasAnchors = true %}{% endif %}
{% if hasBanner == undefined %}{% set hasBanner = true %}{% endif %}
{% if hasSiteDialog == undefined %}{% set hasSiteDialog = true %}{% endif %}
{% if hasGeneratedTitle == undefined %}{% set hasGeneratedTitle = true %}{% endif %}
<html lang="en" data-fa-kit-code="38c11e3f20" data-version="{{ package.version }}" class="wa-cloak"{% if hasAnchors == false %} data-no-anchor{% endif %}>
<head>
{% include 'head.njk' %}
<meta name="theme-color" content="#f36944">
@@ -27,9 +31,6 @@
</script>
</head>
<body class="layout-{{ layout | stripExtension }} page-{{ pageClass or page.fileSlug or 'home' }}{{ ' page-wide' if wide }}">
{% if hasBanner == undefined %}
{% set hasBanner = true %}
{% endif %}
{% set defaultWaPageAttributes = defaultWaPageAttributes or { view: 'desktop', 'disable-navigation-toggle': true, 'mobile-breakpoint': 1180, 'disable-sticky': 'banner' } %}
{% set waPageAttributes = waPageAttributes or {} %}
@@ -120,7 +121,9 @@
<div id="flashes">{% server "flashes" %}</div>
{% block header %}
<h1 class="title">{{ title }}</h1>
{% if hasGeneratedTitle %}
<h1 class="title">{{ title }}</h1>
{% endif %}
{% endblock %}
{% block beforeContent %}{% endblock %}
@@ -134,6 +137,11 @@
{% include 'search.njk' %}
{#- Site-Wide Dialog -#}
{% if hasSiteDialog %}
{% include "_dialog-wa-launch.njk" ignore missing %}
{% endif %}
{# Footer #}
{% block pageFooter %}{% endblock %}
</wa-page>

View File

@@ -0,0 +1,7 @@
{% macro freeBadge(params) %}
{% set description = params.description or "This feature is available in the free version of Web Awesome" %}
{% set badgeId = params.id or ("free-badge-" + ("" | uniqueId(8))) %}
<wa-badge appearance="filled" variant="neutral" pill class="free" id="{{ badgeId }}" data-free-badge>Free</wa-badge>
<wa-tooltip for="{{ badgeId }}">{{ description }}</wa-tooltip>
{% endmacro %}

View File

@@ -1,6 +1,6 @@
{% macro proBadge(params) %}
{% set description = params.description or "This requires access to Web Awesome Pro" %}
{% set badgeId = params.id or ("pro-badge-" + ("" | uniqueId(8))) %}
<wa-badge appearance="accent" pill class="pro" id="{{ badgeId }}">Pro</wa-badge>
<wa-badge appearance="accent" pill class="pro" id="{{ badgeId }}" data-pro-badge>Pro</wa-badge>
<wa-tooltip for="{{ badgeId }}">{{ description }}</wa-tooltip>
{% endmacro %}

View File

@@ -35,9 +35,23 @@ export function anchorHeadingsTransformer(options = {}) {
return doc;
}
// Look for headings
let selector = `:is(${options.headingSelector}):not([data-no-anchor], [data-no-anchor] *)`;
// Check if the document or container has data-no-anchor (view-level)
const hasNoAnchorOnDocument = doc.querySelector('html')?.hasAttribute('data-no-anchor') || false;
const hasNoAnchorOnContainer = container.closest('[data-no-anchor]') !== null;
// If view-level data-no-anchor is set, skip processing all headings
if (hasNoAnchorOnDocument || hasNoAnchorOnContainer) {
return doc;
}
// Look for headings (selector excludes headings with data-no-anchor attribute)
let selector = `:is(${options.headingSelector}):not([data-no-anchor])`;
container.querySelectorAll(selector).forEach(heading => {
// Skip if heading is a descendant of an element with data-no-anchor
// (selector already excludes headings with the attribute directly)
if (heading.closest('[data-no-anchor]') !== null) {
return;
}
const hasAnchor = heading.querySelector('a');
const existingId = heading.getAttribute('id');
const clone = parse(heading.outerHTML);
@@ -65,7 +79,7 @@ export function anchorHeadingsTransformer(options = {}) {
const anchor = parse(`
<a href="#${encodeURIComponent(id)}">
<span class="wa-visually-hidden"></span>
<span aria-hidden="true">#</span>
<wa-icon variant="regular" name="hashtag" class="icon-shrink"></wa-icon>
</a>
`);
anchor.querySelector('.wa-visually-hidden').textContent = options.anchorLabel;

View File

@@ -64,6 +64,24 @@ wa-page > [slot='banner'] {
}
}
/* Site-Wide Dialog */
#dialog-site {
/* custom brand colors carrried over from theme-site for the banner */
--wa-color-brand-95: #fef0ec;
--wa-color-brand-90: #fce0d8;
--wa-color-brand-80: #f8bcac;
--wa-color-brand-70: #fa9378;
--wa-color-brand-60: #f46a45;
--wa-color-brand-50: #cb4b27;
--wa-color-brand-40: #9d371a;
--wa-color-brand-30: #7c2a13;
--wa-color-brand-20: #5d1d0b;
--wa-color-brand-10: #3b0f05;
--wa-color-brand-05: #270802;
--wa-color-brand: var(--wa-color-brand-60);
--wa-color-brand-on: var(--wa-color-brand-10);
}
/* Header */
wa-page::part(header) {
background-color: var(--wa-color-surface-default);
@@ -351,26 +369,6 @@ h1.title {
}
}
/* Anchor headings */
.anchor-heading a {
visibility: hidden;
text-decoration: none;
}
@media (hover: hover) {
.anchor-heading:hover a {
visibility: visible;
padding: 0 0.125em;
}
}
@media print {
/* Show URLs for printed links */
a:not(.anchor-heading)[href]::after {
content: ' (' attr(href) ')';
}
}
/* Callouts */
.callout {
display: flex;

View File

@@ -70,9 +70,8 @@
/* #region shared UI */
/* pro badge */
wa-badge.pro {
color: white;
color: var(--wa-color-brand-on-loud);
background-color: var(--wa-brand-orange);
border-color: var(--wa-brand-orange);
+ wa-tooltip {
font-size: var(--wa-font-size-xs);
@@ -80,6 +79,14 @@
}
}
/* free badge */
wa-badge.free {
+ wa-tooltip {
font-size: var(--wa-font-size-xs);
--max-width: unset;
}
}
/* planned badge */
wa-badge.planned {
background-color: var(--wa-color-neutral-fill-quiet);
@@ -123,6 +130,28 @@
}
}
/* anchor headings */
.anchor-heading a {
opacity: 0;
visibility: hidden;
text-decoration: none;
transition: opacity var(--wa-transition-normal) var(--wa-transition-easing);
}
@media (hover: hover) {
.anchor-heading:hover a {
opacity: 1;
visibility: visible;
padding: var(--wa-space-3xs);
}
}
@media print {
/* show URLs for printed links */
a:not(.anchor-heading)[href]::after {
content: ' (' attr(href) ')';
}
}
/* #endregion */
/* #region funsies + cosmetics */

View File

@@ -141,7 +141,7 @@ Dropdowns can be placed into button groups.
### Split Buttons
Create a split button using a button and a dropdown. Use a [visually hidden](/docs/components/visually-hidden) label to ensure the dropdown is accessible to users with assistive devices.
Create a split button using a button and a dropdown. Use a [visually hidden](/docs/utilities/visually-hidden) label to ensure the dropdown is accessible to users with assistive devices.
```html {.example}
<wa-button-group label="Example Button Group">

View File

@@ -5,7 +5,7 @@ layout: component
category: Imagery
---
This is especially useful for comparing images, but can be used for comparing any type of content (for an example of using it to compare entire UIs, check out our [theme pages](/docs/themes/default/)).
This is especially useful for comparing images, but can be used for comparing any type of content (for an example of using it to compare entire UIs, check out our [theme page](/docs/themes)).
For best results, use content that shares the same dimensions.
The slider can be controlled by dragging or pressing the left and right arrow keys. (Tip: press shift + arrows to move the slider in larger intervals, or home + end to jump to the beginning or end.)

View File

@@ -53,9 +53,9 @@ The default orientation for dividers is `horizontal`. Set `orientation` attribut
</div>
```
### Menu Dividers
### Dropdown Dividers
Use dividers in [menus](/docs/components/menu) to visually group menu items.
Use dividers in [dropdowns](/docs/components/dropdown) to visually group dropdown items.
```html {.example}
<wa-dropdown style="max-width: 200px;">

View File

@@ -102,7 +102,7 @@ The default orientation for radio items is `vertical`. Set the `orientation` to
### Sizing Options
The size of [Radios](/docs/components/radio) will be determined by the Radio Group's `size` attribute.
The size of radios will be determined by the Radio Group's `size` attribute.
```html {.example}
<wa-radio-group label="Select an option" size="medium" value="medium" onchange="this.size = this.value">
@@ -113,7 +113,7 @@ The size of [Radios](/docs/components/radio) will be determined by the Radio Gro
```
:::info
[Radios](/docs/components/radio) and [Radio Buttons](/docs/components/radio-button) also have a `size` attribute,
[Radios](/docs/components/radio) also have a `size` attribute,
which will override the inherited size when used.
:::

View File

@@ -1,10 +1,11 @@
---
title: Changelog
dateLastUpdated: 2025-11-07
description: Changes to each version of the project are documented here.
layout: page-outline
---
<p class="wa-caption-s">Last updated: <wa-format-date month="long" day="numeric" year="numeric" date="{{ lastUpdatedISO }}"></wa-format-date></p>
<p class="wa-caption-s">Last updated: <wa-format-date month="long" day="numeric" year="numeric" date="{{ dateLastUpdated }}"></wa-format-date></p>
Web Awesome follows [Semantic Versioning](https://semver.org/). Breaking changes in components with the <wa-badge variant="brand">Stable</wa-badge> badge will not be accepted until the next major version. As such, all contributions must consider the project's roadmap and take this into consideration. Features that are deemed no longer necessary will be deprecated but not removed.
@@ -12,7 +13,10 @@ Components with the <wa-badge variant="warning">Experimental</wa-badge> badge sh
## Next
- 🚨 BREAKING: Changed `appearance="filled outlined"` to `appearance="filled-outlined"` in the `wa-card` component [issue:1671]
- 🚨 BREAKING: Changed `appearance="filled outlined"` to `appearance="filled-outlined"` in `<wa-card>` [issue:1671]
- Fixed a bug in `<wa-slider>` that caused some touch devices to end up with the incorrect value [issue:1703]
- Fixed a bug in `<wa-card>` that prevented some slots from being detected correctly [discuss:1450]
- Improved performance of `<wa-icon>` so initial rendering occurs faster, especially with multiple icons on the page [issue:1729]
## 3.0.0
@@ -250,7 +254,7 @@ Many of these changes and improvements were the direct result of feedback from u
- 🚨 BREAKING: Renamed `<image-comparer>` to `<wa-comparison>` and improved compatibility for non-image content
- 🚨 BREAKING: Added slot detection to `<wa-dialog>` and `<wa-drawer>` so you don't need to specify `with-header` and `with-footer`; headers are on by default now, but you can use the `without-header` attribute to turn them off
- 🚨 BREAKING: Renamed the `image` slot to `media` for a more appropriate naming convention
- Added [a theme builder](/docs/themes/edit/) to create your own themes
- Added Theme Builder to create your own themes
- Added a new Blog & News pattern category
- Added a new free component: `<wa-scroller>` (#1 of 14 per stretch goals)
- Added support for Duotone Thin, Light, and Regular styles and the Sharp Duotone family of styles to `<wa-icon>`
@@ -267,7 +271,7 @@ Many of these changes and improvements were the direct result of feedback from u
### Enhancements {data-no-outline}
- Added `appearance` to [`<wa-details>`](/docs/components/details) and [`<wa-card>`](/docs/components/card) and support for the [appearance utilities](/docs/utilities/appearance/) in the [`<details>` native styles](/docs/utilities/native/details).
- Added `appearance` to [`<wa-details>`](/docs/components/details) and [`<wa-card>`](/docs/components/card) and support for the appearance utilities in the [`<details>` native styles](/docs/utilities/native/#details).
- Added an `orange` scale to all color palettes
- Added the [`.wa-cloak` utility](/docs/utilities/fouce) to prevent FOUCE
- Added the [`allDefined()` utility](/docs/usage/#all-defined) for awaiting component registration
@@ -292,7 +296,7 @@ Many of these changes and improvements were the direct result of feedback from u
- Revert `<wa-dialog>` structure and CSS to fix clipped content in dialogs (WA-A #123) and light dismiss in iOS Safari (WA-A #201)
- Fixed a bug in `<wa-color-picker>` that prevented light dismiss from working when clicking immediately above the color picker dropdown
- Fixed a bug in `<wa-progress>` that prevented Safari from animation progress changes
- Fixed the missing indeterminate icon in [native checkbox styles](/docs/utilities/native/checkbox)
- Fixed the missing indeterminate icon in [native checkbox styles](/docs/utilities/native/#form-controls)
- Fixed a bug in `<wa-radio>` where elements would stack instead of display inline
- Docs fixes:
- Fixed the search dialog's styles so it doesn't jump around as you search
@@ -439,13 +443,13 @@ Many of these changes and improvements were the direct result of feedback from u
### Native styles {data-no-outline}
- Added native styles for
[buttons](/docs/utilities/native/button),
[input fields](/docs/utilities/native/input),
[dialogs](/docs/utilities/native/dialog),
[details](/docs/utilities/native/details),
[tables](/docs/utilities/native/table),
[lists](/docs/utilities/native/lists),
and most [content elements](/docs/utilities/native/content).
[buttons](/docs/utilities/native/#buttons),
[input fields](/docs/utilities/native/#form-controls),
[dialogs](/docs/utilities/native/#dialog),
[details](/docs/utilities/native/#details),
[tables](/docs/utilities/native/#tables),
[lists](/docs/utilities/native/#lists),
and most [content elements](/docs/utilities/native/#typography).
### Style utilities {data-no-outline}
@@ -453,7 +457,7 @@ Many of these changes and improvements were the direct result of feedback from u
- Added [appearance utilities](/docs/utilities/appearance/)
- Added [size utilities](/docs/utilities/size/)
- Added [layout utilities](/docs/layout/#utilities)
- Added [`.wa-visually hidden`](/docs/utilities/a11y/#visually-hidden) utility
- Added [`.wa-visually hidden`](/docs/utilities/visually-hidden) utility
- Added [`<wa-page>`](/docs/components/page/#styles) native styles and utilities
### Components {data-no-outline}

View File

@@ -164,7 +164,7 @@ This section can be a lot to digest in one sitting, so don't feel like you need
Web Awesome is built with accessibility in mind. Creating generic components that are fully accessible to users with varying capabilities across a multitude of circumstances is a daunting challenge. Oftentimes, the solution to an a11y problem is not written in black and white and, therefore, we may not get it right the first time around. There are, however, guidelines we can follow in our effort to make Web Awesome an accessible foundation from which applications and websites can be built.
We take this commitment seriously, so please ensure your contributions have this goal in mind. If you need help with anything a11y-related, please [reach out to the community](/resources/community) for assistance. If you discover an accessibility concern within the library, please file a bug on the [issue tracker](https://github.com/shoelace-style/webawesome/issues).
We take this commitment seriously, so please ensure your contributions have this goal in mind. If you need help with anything a11y-related, please reach out on the [community chat](https://discord.gg/mg8f26C) for assistance. If you discover an accessibility concern within the library, please file a bug on the [issue tracker](https://github.com/shoelace-style/webawesome/issues).
It's important to remember that, although accessibility starts with foundational components, it doesn't end with them. It everyone's responsibility to encourage best practices and ensure we're providing an optimal experience for all of our users.
@@ -364,7 +364,7 @@ Form controls should support submission and validation through the following con
### System Icons
Avoid inlining SVG icons inside of templates. If a component requires an icon, make sure `<wa-icon>` is a dependency of the component and use the [system library](/components/icon#customizing-the-system-library):
Avoid inlining SVG icons inside of templates. If a component requires an icon, make sure `<wa-icon>` is a dependency of the component and use the [system library](/docs/components/icon#customizing-the-system-library):
```html
<wa-icon library="system" name="..." variant="..."></wa-icon>

View File

@@ -11,7 +11,7 @@ layout: page
<div class="wa-stack wa-gap-xl">
<div class="wa-stack wa-align-items-start">
<div class="wa-stack wa-gap-s">
<h2 class="anchor-heading wa-cluster wa-gap-xs" data-no-anchor><wa-icon name="github" family="brands" style="font-size: 2ch;"></wa-icon>Github</h2>
<h2 class="anchor-heading wa-cluster wa-gap-xs" data-no-anchor><wa-icon name="github" family="brands" style="font-size: 2ch;"></wa-icon>GitHub</h2>
<span class="wa-heading-m">Feature requests & bugs</span>
<p class="wa-caption-l">Notice a bug or have an idea? Open an issue on GitHub so we can triage, track, and ship fixes.</p>
</div>

View File

@@ -4,6 +4,9 @@ description: Style (and restyle) your website at will with any of Web Awesome's
layout: page
---
{% from "pro-badge.njk" import proBadge %}
{% from "free-badge.njk" import freeBadge %}
<h1>{{ title }}</h1>
<p>Themes are collections of <a href="/docs/tokens">design tokens</a> that give a cohesive look and feel to the entire Web Awesome library. Style and restyle your website at will by loading any pre-built theme.</p>
@@ -64,8 +67,9 @@ to create a project with any one of these themes.
<header class="wa-stack">
<div class="wa-cluster">
<h2 data-theme-name="name">Theme</h2>
<wa-badge data-free-badge appearance="outlined" variant="neutral" hidden>FREE</wa-badge>
<wa-badge data-pro-badge appearance="accent" hidden>PRO</wa-badge>
{{ freeBadge({ id: "free-badge", description: "This theme is available in the free version of Web Awesome." }) }}
{{ proBadge({ id: "pro-badge", description: "This theme requires access to Web Awesome Pro." }) }}
</div>
<p data-theme-description>Description</p>
</header>
@@ -162,8 +166,12 @@ Then apply the following classes to the `<html>` element:
const beforeFrame = document.querySelector('wa-zoomable-frame[slot="before"]');
const nameElement = document.querySelector('[data-theme-name]');
const descriptionElement = document.querySelector('[data-theme-description]');
const freeBadge = document.querySelector('[data-free-badge]');
const proBadge = document.querySelector('[data-pro-badge]');
const freeBadge = document.getElementById('free-badge');
const proBadge = document.getElementById('pro-badge');
// Hide both badges initially
if (freeBadge) freeBadge.hidden = true;
if (proBadge) proBadge.hidden = true;
function updateFrames(selectedValue, title, description, isPro, palette, brand) {
// Update theme classes on both frames

View File

@@ -22,7 +22,7 @@ As soon as all elements are registered _or_ after two seconds have elapsed, the
:::details Are you using Turbo in your app?
If you're using [Turbo](https://turbo.hotwired.dev/) to serve a multi-page application (MPA) as a single page application (SPA), you might notice FOUCE when navigating from page to page. This is because Turbo renders the new page's content before the autoloader has a change to register new components.
If you're using [Turbo](https://turbo.hotwired.dev/) to serve a multi-page application (MPA) as a single page application (SPA), you might notice FOUCE when navigating from page to page. This is because Turbo renders the new page's content before the autoloader has a chance to register new components.
The following function acts as a middleware to ensure components are registered _before_ the page shows, eliminating FOUCE for page-to-page navigation with Turbo.

View File

@@ -139,7 +139,7 @@ Frames have a square aspect ratio by default. You can append `:square` (1 / 1),
## Border Radius
Frames have a square border radius by default. You can add any of the following [`wa-border-radius-*`](/docs/utilities/border-radius) classes to an element with `wa-frame` to specify the border radius:
Frames have a square border radius by default. You can add any of the following [`wa-border-radius-*`](/docs/utilities/rounding) classes to an element with `wa-frame` to specify the border radius:
- `wa-border-radius-s`
- `wa-border-radius-m`

View File

@@ -14,7 +14,7 @@ tags: layoutUtilities
}
</style>
Web Awesome includes classes to set the `gap` property of flex and grid containers. They can be used alongside other Web Awesome layout utilities, like [cluster](/docs/layout/cluster) and [stack](/docs/layout/stack), to change the space between items.
Web Awesome includes classes to set the `gap` property of flex and grid containers. They can be used alongside other Web Awesome layout utilities, like [cluster](/docs/utilities/cluster) and [stack](/docs/utilities/stack), to change the space between items.
Or even by themselves — all gap properties also set `display: flex` with a specificity of 0 so that it can be trivially overridden.
Besides `wa-gap-0`, which sets `gap` to zero, each class corresponds to one of the [`--wa-space-*`](/docs/tokens/space) tokens in your theme.

View File

@@ -12,7 +12,7 @@ tags: styleUtilities
}
</style>
Web Awesome includes classes to set an element's `border-radius` property. They can be used alongside Web Awesome layout utilities, like [frame](/docs/layout/frame), to round all corners of an element.
Web Awesome includes classes to set an element's `border-radius` property. They can be used alongside Web Awesome layout utilities, like [frame](/docs/utilities/frame), to round all corners of an element.
Each class corresponds to one of the [`--wa-border-radius-*`](/docs/tokens/borders/#radius) tokens in your theme.

View File

@@ -30,7 +30,15 @@ import styles from './card.css';
export default class WaCard extends WebAwesomeElement {
static css = [sizeStyles, styles];
private readonly hasSlotController = new HasSlotController(this, 'footer', 'header', 'media');
private readonly hasSlotController = new HasSlotController(
this,
'footer',
'header',
'media',
'header-actions',
'footer-actions',
'actions',
);
/** The card's visual appearance. */
@property({ reflect: true })

View File

@@ -187,7 +187,7 @@ export default class WaIcon extends WebAwesomeElement {
}
}
@watch(['family', 'name', 'library', 'variant', 'src', 'autoWidth', 'swapOpacity'])
@watch(['family', 'name', 'library', 'variant', 'src', 'autoWidth', 'swapOpacity'], { waitUntilFirstUpdate: true })
async setIcon() {
const { url, fromLibrary } = this.getIconSource();
const library = fromLibrary ? getIconLibrary(this.library) : undefined;

View File

@@ -174,7 +174,7 @@
}
:host([appearance='button']:state(checked):focus-visible) {
outline: var(--wa-focus-ring-style) var(--wa-focus-ring-width) var(--wa-color-brand-border-loud);
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}