Merge branch 'next' into lm/fix-font-imports

This commit is contained in:
lindsaym-fa
2025-10-03 16:55:46 -04:00
38 changed files with 671 additions and 263 deletions

View File

@@ -21,7 +21,7 @@ Twitter: [@webawesomer](https://twitter.com/webawesomer)
## Developers ✨
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.
@@ -29,31 +29,29 @@ If that's not what you're trying to do, the [documentation website](https://weba
### 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.
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 a 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`.
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?
### Where do npm dependencies go?
Any dependencies intended to be used across all packages (IE: `prettier`, `eslint`) that are _NOT_ used at runtime should be in the root `devDependencies` of `package.json`.
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.
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.
Individual packages are also free to install `devDependencies` as needed as long as they are specific to that package only.
To do install a package specific to a package, change your working directory to that package's root
IE: `cd packages/webawesome && npm install <package-name>`
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
@@ -67,14 +65,14 @@ npm install
### Developing
Once you've cloned the repo, run the following command from the respective directory within `packages/*`
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
@@ -102,7 +100,7 @@ This will generate a source file, a stylesheet, and a docs page for you. When yo
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/`.
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!
@@ -112,4 +110,4 @@ Web Awesome is an open source project and contributions are encouraged! If you'r
## 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).

29
package-lock.json generated
View File

@@ -6478,6 +6478,16 @@
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
"dev": true
},
"node_modules/eleventy-plugin-git-commit-date": {
"version": "0.1.3",
"resolved": "https://registry.npmjs.org/eleventy-plugin-git-commit-date/-/eleventy-plugin-git-commit-date-0.1.3.tgz",
"integrity": "sha512-dmdkGpMuRj8apWptC1QGqAsLHCguddFlfPjbjflGCqXdJ8cdhEjrzzvI/rL0XUvzCC4ETgGl9i/wDU6ujZ94gA==",
"dev": true,
"license": "MIT",
"dependencies": {
"cross-spawn": "^7.0.3"
}
},
"node_modules/emoji-regex": {
"version": "10.4.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz",
@@ -13008,12 +13018,6 @@
"node": ">=0.8.0"
}
},
"node_modules/style-observer": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/style-observer/-/style-observer-0.0.7.tgz",
"integrity": "sha512-t75H3CRy+vd5q3yqyrf/De4tkz33hPQTiCcfh0NTesI5G7kJnZ227LEYTwqjKTtaFOCJvqZcYFHpJlF8bsk3bQ==",
"license": "MIT"
},
"node_modules/supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
@@ -13991,7 +13995,8 @@
"qr-creator": "^1.0.0"
},
"devDependencies": {
"@wc-toolkit/jsx-types": "^1.3.0"
"@wc-toolkit/jsx-types": "^1.3.0",
"eleventy-plugin-git-commit-date": "^0.1.3"
},
"engines": {
"node": ">=14.17.0"
@@ -13999,9 +14004,9 @@
},
"packages/webawesome-pro": {
"name": "@shoelace-style/webawesome-pro",
"version": "3.0.0-beta.5",
"version": "3.0.0-beta.6",
"dependencies": {
"@ctrl/tinycolor": "^4.1.0",
"@ctrl/tinycolor": "4.1.0",
"@floating-ui/dom": "^1.6.13",
"@lit/react": "^1.0.8",
"@shoelace-style/animations": "^1.2.0",
@@ -14009,11 +14014,11 @@
"composed-offset-position": "^0.0.6",
"lit": "^3.2.1",
"nanoid": "^5.1.5",
"qr-creator": "^1.0.0",
"style-observer": "^0.0.7"
"qr-creator": "^1.0.0"
},
"devDependencies": {
"@wc-toolkit/jsx-types": "^1.3.0"
"@wc-toolkit/jsx-types": "^1.3.0",
"eleventy-plugin-git-commit-date": "^0.1.3"
},
"engines": {
"node": ">=14.17.0"

View File

@@ -1,4 +1,6 @@
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';
@@ -19,6 +21,7 @@ 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() {
@@ -57,6 +60,15 @@ 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);
}
}
}
});
/**
@@ -76,7 +88,6 @@ export default async function (eleventyConfig) {
//
eleventyConfig.addGlobalData('package', packageData);
eleventyConfig.addGlobalData('layout', 'page.njk');
eleventyConfig.addGlobalData('pageType', 'docs'); // Default page type
eleventyConfig.addGlobalData('server', {
head: '',
loginOrAvatar: '',
@@ -88,12 +99,97 @@ export default async function (eleventyConfig) {
eleventyConfig.addFilter('markdown', content => markdown.render(content || ''));
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),
});
// 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 => {
return typeof content === 'string' ? content.replace(/^(\s|\|)/g, '').replace(/(\s|\|)$/g, '') : content;
});
/**
* @example
{% set foo = {foo: "bar"} %}
{% set bar = {bar: "baz"} %}
{% set merged = foo | merge(bar) %}
{{ merged | dump }}
*/
eleventyConfig.addFilter('merge', function (obj1, obj2) {
return Object.assign({}, obj1, obj2);
});
// Custom filter to sort with a priority item first, e.g.
// {{ collection | sortWithFirst('fileSlug', 'default') }} => the item with the fileSlug of 'default' will be first
eleventyConfig.addFilter('sortWithFirst', function (collection, property, firstValue) {

View File

@@ -15,16 +15,9 @@
{% if hasSidebar %}<script type="module" src="/assets/scripts/sidebar.js"></script>{% endif %}
<script defer data-domain="webawesome.com" src="https://plausible.io/js/script.js"></script>
{% if pageType == 'marketing' %}
{# Marketing styles #}
<link rel="stylesheet" href="/assets/styles/marketing.css" />
{% else %}
{# Docs styles (default) #}
{% block head %}
<link rel="stylesheet" href="/assets/styles/docs.css" />
{% endif %}
{% block head %}{% endblock %}
{% endblock %}
<script type="module">
// Set the initial color scheme before the page renders to prevent flashing
@@ -32,66 +25,45 @@
const isDark = value === 'dark' || (value === 'auto' && matchMedia('(prefers-color-scheme: dark)').matches);
document.documentElement.classList.toggle('wa-dark', isDark);
</script>
<script type="module">
// Set the initial theme before the page renders to prevent flashing
const savedTheme = localStorage.getItem('theme') || 'default';
// Update the theme stylesheet link first
const themeStylesheet = document.getElementById('theme-stylesheet');
if (themeStylesheet) {
themeStylesheet.href = `/dist/styles/themes/${savedTheme}.css`;
}
if (savedTheme !== 'default') {
document.documentElement.classList.add(`wa-theme-${savedTheme}`);
}
</script>
</head>
<body class="layout-{{ layout | stripExtension }} page-{{ page.fileSlug or 'home' }}{{ ' page-wide' if wide }} page-{{ pageType or 'docs' }}">
<!-- use view="desktop" as default to reduce layout jank on desktop site. -->
<wa-page view="desktop" disable-navigation-toggle {% if pageType == 'marketing' %}disable-sticky="header"{% endif %} mobile-breakpoint="1180">
<body class="layout-{{ layout | stripExtension }} page-{{ pageClass or page.fileSlug or 'home' }}{{ ' page-wide' if wide }}">
{% set defaultWaPageAttributes = defaultWaPageAttributes or { view: 'desktop', 'disable-navigation-toggle': true, 'mobile-breakpoint': 1180 } %}
{% set waPageAttributes = waPageAttributes or {} %}
{% set mergedWaPageAttributes = defaultWaPageAttributes | merge(waPageAttributes) %}
<wa-page
{% for key, value in mergedWaPageAttributes %}
{% if value != null and value != false %}
{{ key }}="{{ value }}"
{% endif %}
{% endfor %}
>
{% block pageHeader %}
<header slot="header" class="wa-split">
{# Logo #}
<div id="docs-branding">
{# Nav toggle #}
{# Nav toggle #}
<wa-button appearance="plain" size="small" data-toggle-nav>
<wa-icon name="bars" label="Toggle navigation"></wa-icon>
<wa-icon name="bars" label="Toggle navigation" class="icon-default icon-embiggen"></wa-icon>
<wa-icon name="burger" aria-hidden="true" class="icon-hover icon-embiggen"></wa-icon>
</wa-button>
<a href="/" aria-label="Web Awesome">
<span class="wa-desktop-only">{% include "logo.njk" %}</span>
<span class="wa-mobile-only">{% include "logo-simple.njk" %}</span>
{# Logo - Desktop #}
<a class="brand-logo wa-desktop-only" href="/" aria-label="Web Awesome">
{% include "logo.njk" %}
</a>
<small id="version-number" class="wa-desktop-only">{{ package.version }}</small>
<wa-badge variant="brand" appearance="filled" class="wa-desktop-only">Beta</wa-badge>
</div>
<div id="docs-toolbar" class="wa-cluster">
{# Desktop selectors #}
<div class="wa-desktop-only wa-cluster wa-gap-xs">
{#- Logo - mobile branding -#}
<a href="/" class="brand-logo wa-mobile-only" aria-label="Web Awesome">
{# Logo - Mobile #}
{% include "logo-simple.njk" %}
</a>
<div id="docs-toolbar" class="wa-cluster gap-s">
<div class="wa-desktop-only wa-cluster wa-gap-2xs">
{% include "theme-selector.njk" %}
{% include "color-scheme-selector.njk" %}
{% include "github-icon-buttons.njk" %}
</div>
<wa-divider orientation="vertical" class="wa-desktop-only"></wa-divider>
<div id="github-buttons" class="wa-cluster wa-gap-xs">
<wa-button id="github-repo-button" href="https://github.com/shoelace-style/webawesome" rel="noopener noreferrer" target="_blank" appearance="filled" size="small">
<wa-icon family="brands" name="github" label="GitHub"></wa-icon>
</wa-button>
<wa-tooltip for="github-repo-button" distance="2">GitHub</wa-tooltip>
<wa-button id="github-star-button" href="https://github.com/shoelace-style/webawesome/stargazers" rel="noopener noreferrer" target="_blank" appearance="filled" size="small">
<wa-icon name="star" variant="regular" label="Star this repository"></wa-icon>
</wa-button>
<wa-tooltip for="github-star-button" distance="2">Star this repository</wa-tooltip>
</div>
<wa-divider orientation="vertical"></wa-divider>
{# Login #}
{% server "loginOrAvatar" %}
{#- Login -#}
{% include "login-or-avatar.njk" ignore missing %}
</div>
</header>
{% endblock %}
@@ -100,9 +72,13 @@
{% if hasSidebar %}
{# Mobile selectors #}
<div class="wa-mobile-only" slot="navigation-header">
<div class="wa-cluster wa-gap-xs" style="flex-wrap: nowrap;">
{% include "theme-selector.njk" %}
{% include "color-scheme-selector.njk" %}
<div class="wa-cluster wa-gap-s">
<a class="brand-logo" href="/" aria-label="Web Awesome">{% include "logo-simple.njk" %}</a>
<div class="wa-cluster wa-gap-2xs" style="flex-wrap: nowrap;">
{% include "theme-selector.njk" %}
{% include "color-scheme-selector.njk" %}
{% include "github-icon-buttons.njk" %}
</div>
</div>
</div>
<div slot="navigation" id="sidebar" class="docs-aside" data-remember-scroll>

View File

@@ -1,25 +1,35 @@
<wa-select class="color-scheme-selector" appearance="filled" size="small" value="auto" title="Press \ to toggle">
<wa-icon class="only-light" slot="start" name="sun" variant="regular"></wa-icon>
<wa-icon class="only-dark" slot="start" name="moon" variant="regular"></wa-icon>
<wa-option value="light">
<wa-icon slot="start" name="sun" variant="regular"></wa-icon>
<wa-dropdown class="color-scheme-selector" title="Press \ to toggle">
<wa-button slot="trigger" id="color-scheme-selector-trigger" appearance="plain">
<wa-icon name="sun-bright" variant="regular" class="icon-embiggen only-light"></wa-icon>
<wa-icon name="moon-stars" variant="regular" class="icon-embiggen only-dark"></wa-icon>
</wa-button>
<wa-dropdown-item value="light">
<wa-icon slot="icon" name="sun-bright" variant="regular" class="icon-embiggen"></wa-icon>
Light
</wa-option>
<wa-option value="dark">
<wa-icon slot="start" name="moon" variant="regular"></wa-icon>
</wa-dropdown-item>
<wa-dropdown-item value="dark">
<wa-icon slot="icon" name="moon-stars" variant="regular" class="icon-embiggen"></wa-icon>
Dark
</wa-option>
</wa-dropdown-item>
<wa-divider></wa-divider>
<wa-option value="auto">
<wa-icon class="only-light" slot="start" name="sun" variant="regular"></wa-icon>
<wa-icon class="only-dark" slot="start" name="moon" variant="regular"></wa-icon>
<wa-dropdown-item value="auto">
<wa-icon slot="icon" name="sun-bright" variant="regular" class="only-light icon-embiggen"></wa-icon>
<wa-icon slot="icon" name="moon-stars" variant="regular" class="only-dark icon-embiggen"></wa-icon>
System
</wa-option>
</wa-select>
</wa-dropdown-item>
</wa-dropdown>
<wa-tooltip for="color-scheme-selector-trigger" id="color-scheme-tooltip">Select Color Scheme</wa-tooltip>
<script>
// Immediately set the correct value from storage
document.querySelectorAll('wa-select.color-scheme-selector').forEach(el => {
el.setAttribute('value', localStorage.getItem('color-scheme') || 'auto');
// Handle dropdown selection and trigger input event for color-scheme.js
document.querySelectorAll('wa-dropdown.color-scheme-selector').forEach(el => {
el.addEventListener('wa-select', (event) => {
const selectedValue = event.detail.item.value;
// Trigger input event for color-scheme.js
el.value = selectedValue;
el.dispatchEvent(new Event('input', { bubbles: true }));
});
});
</script>

View File

@@ -0,0 +1,8 @@
<wa-button id="github-repo-button" href="https://github.com/shoelace-style/webawesome" rel="noopener noreferrer" target="_blank" appearance="plain">
<wa-icon family="brands" name="github" label="View Repository on GitHub" class="icon-embiggen"></wa-icon>
</wa-button>
<wa-tooltip for="github-repo-button" distance="2">View on GitHub</wa-tooltip>
<wa-button id="github-star-button" href="https://github.com/shoelace-style/webawesome/stargazers" rel="noopener noreferrer" target="_blank" appearance="plain">
<wa-icon name="star" variant="regular" label="Star Repository on GitHub" class="icon-embiggen"></wa-icon>
</wa-button>
<wa-tooltip for="github-star-button" distance="2">Star on GitHub</wa-tooltip>

View File

@@ -21,9 +21,7 @@
<script type="module" src="/dist/webawesome.loader.js"></script>
<link id="theme-stylesheet" rel="stylesheet" href="/dist/styles/themes/default.css" render="blocking" fetchpriority="high" />
{% for palette in themer.palettes %}
<link rel="stylesheet" href="/dist/styles/color/palettes/{{palette.filename}}" />
{% endfor %}
<link rel="stylesheet" href="/dist/styles/webawesome.css" />
<script type="module">

View File

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

View File

@@ -0,0 +1,5 @@
<wa-button id="search-trigger" appearance="outlined" size="small" data-search>
<wa-icon slot="start" name="magnifying-glass"></wa-icon>
Search the Docs for&hellip;
<kbd slot="end" class="wa-desktop-only">/</kbd>
</wa-button>

View File

@@ -1,9 +1,6 @@
{# Search #}
<wa-button id="search-trigger" appearance="outlined" size="small" data-search>
<wa-icon slot="start" name="magnifying-glass"></wa-icon>
Search
<kbd slot="end" class="wa-desktop-only">/</kbd>
</wa-button>
{% include "search-trigger-button.njk" %}
{% from "pro-badge.njk" import proBadge %}
{# Getting started #}
<h2>Getting Started</h2>
@@ -25,6 +22,9 @@
<li><a href="/docs/resources/browser-support">Browser Support</a></li>
<li><a href="/docs/resources/contributing">Contributing</a></li>
<li><a href="/docs/resources/changelog">Changelog</a></li>
<li><a href="/license"><span class="wa-visually-hidden">Web Awesome </span>Free License</a></li>
<li><a href="/license/pro"><span class="wa-visually-hidden">Web Awesome </span>Pro License</a></li>
<li><a href="/tos">Terms of Service</a></li>
<li><a href="/docs/resources/visual-tests">Visual Tests</a></li>
</ul>
@@ -42,7 +42,7 @@
<a class="wa-cluster wa-gap-xs" href="/docs/components/page/">
Page <wa-icon name="flask" aria-hidden="true"></wa-icon>
</a>
<wa-badge class="pro" appearance="accent" attention="none">PRO</wa-badge>
{{ proBadge() }}
</span>
</li>
<li><a href="/docs/components/animated-image/">Animated Image</a></li>
@@ -183,7 +183,7 @@
<a class="wa-cluster wa-gap-xs" href="/docs/components/page/">
Page <wa-icon name="flask" aria-hidden="true"></wa-icon>
</a>
<wa-badge class="pro" appearance="accent" attention="none">PRO</wa-badge>
{{ proBadge() }}
</span>
</li>
</ul>
@@ -201,7 +201,7 @@
<li>
<span class="wa-split">
<a href="/docs/patterns/app/">App</a>
<wa-badge class="pro" appearance="accent" attention="none">PRO</wa-badge>
{{ proBadge() }}
</span>
<ul>
<li>
@@ -247,7 +247,7 @@
<li>
<span class="wa-split">
<a href="/docs/patterns/blog-news/">Blog &amp; News</a>
<wa-badge class="pro" appearance="accent" attention="none">PRO</wa-badge>
{{ proBadge() }}
</span>
<ul>
<li>
@@ -309,7 +309,7 @@
<li>
<span class="wa-split">
<a href="/docs/patterns/ecommerce/">Ecommerce</a>
<wa-badge class="pro" appearance="accent" attention="none">PRO</wa-badge>
{{ proBadge() }}
</span>
<ul>
<li>
@@ -350,7 +350,7 @@
<li>
<span class="wa-split">
<a href="/docs/patterns/layouts/">Layouts</a>
<wa-badge class="pro" appearance="accent" attention="none">PRO</wa-badge>
{{ proBadge() }}
</span>
<ul>
<li>
@@ -375,7 +375,7 @@
<li>
<span class="wa-split">
<a href="/themer" data-turbo="false">Theme Builder</a>
<wa-badge class="pro" appearance="accent" attention="none">PRO</wa-badge>
{{ proBadge("This requires an active Web Awesome Pro subscription") }}
</span>
</li>
</ul>
@@ -399,3 +399,37 @@
<li><a href="/docs/tokens/component-groups/">Component Groups</a></li>
</ul>
</wa-details>
<wa-divider style="--spacing: var(--wa-space-xl);"></wa-divider>
<div class="wa-stack wa-gap-xl" id="colophon">
<div class="wa-stack wa-gap-xs">
{% include "logo-simple.njk" %}
<div class="wa-cluster wa-gap-xs">
<h2 class="wa-heading-xs">Web Awesome</h2>
<wa-badge id="version-beta-badge" variant="orange" appearance="filled" style="font-size: var(--wa-font-size-2xs);">Beta</wa-badge>
<wa-tooltip for="version-beta-badge" distance="2" style="font-size: var(--wa-font-size-xs);">Here be freshly made Awesome&hellip; and possible dragons</wa-tooltip>
</div>
<p class="wa-caption-s">Version {{ package.version }}</p>
<p class="wa-caption-s">&copy; Fonticons, Inc.</p>
</div>
<div class="wa-cluster wa-gap-0 wa-caption-s the-socials">
<h2 class="wa-visually-hidden">Web Awesome Elsewhere</h2>
<a href="https://github.com/shoelace-style/webawesome" rel="noopener noreferrer" target="_blank" class="appearance-plain">
<wa-icon family="brands" name="github" label="GitHub"></wa-icon>
</a>
<a href="https://bsky.app/profile/webawesome.com" rel="noopener noreferrer" target="_blank" class="appearance-plain">
<wa-icon family="brands" name="bluesky" label="Bluesky"></wa-icon>
</a>
<a href="https://mastodon.social/@webawesome" rel="noopener noreferrer" target="_blank" class="appearance-plain">
<wa-icon family="brands" name="mastodon" label="Mastodon"></wa-icon>
</a>
<a href="https://x.com/webawesomer" rel="noopener noreferrer" target="_blank" class="appearance-plain">
<wa-icon family="brands" name="x-twitter" label="Twitter (X)"></wa-icon>
</a>
<a href="https://www.threads.com/@web.awesome" rel="noopener noreferrer" target="_blank" class="appearance-plain">
<wa-icon family="brands" name="threads" label="Threads"></wa-icon>
</a>
</div>
</div>

View File

@@ -1,16 +1,18 @@
<wa-select appearance="filled" size="small" value="default" class="theme-selector">
<wa-icon slot="start" name="paintbrush" variant="regular"></wa-icon>
<wa-dropdown class="theme-selector" title="Select Theme">
<wa-button slot="trigger" id="theme-selector-trigger" appearance="plain">
<wa-icon name="paintbrush" variant="regular" class="icon-embiggen"></wa-icon>
</wa-button>
{# Free themes #}
{% for theme in themer.themes %}
{% if not theme.isPro %}
<wa-option
<wa-dropdown-item
value="{{ theme.filename | stripExtension }}"
data-brand="{{ theme.colorBrand.color }}"
data-palette="{{ theme.palette.filename | stripExtension }}"
>
{{ theme.name }}
</wa-option>
</wa-dropdown-item>
{% endif %}
{% endfor %}
@@ -18,24 +20,27 @@
{% for theme in themer.themes %}
{% if loop.first %}<wa-divider></wa-divider>{% endif %}
{% if theme.isPro %}
<wa-option
<wa-dropdown-item
value="{{ theme.filename | stripExtension }}"
data-brand="{{ theme.colorBrand.color }}"
data-palette="{{ theme.palette.filename | stripExtension }}"
>
{{ theme.name }}
</wa-option>
</wa-dropdown-item>
{% endif %}
{% endfor %}
</wa-select>
</wa-dropdown>
<wa-tooltip for="theme-selector-trigger" id="theme-tooltip">Select Theme</wa-tooltip>
<script>
// Immediately set the correct values from storage
document.querySelectorAll('wa-select.theme-selector').forEach(el => {
el.setAttribute('value', localStorage.getItem('theme') || 'default');
});
// Handle dropdown selection and trigger input event for theme.js
document.querySelectorAll('wa-dropdown.theme-selector').forEach(el => {
el.addEventListener('wa-select', (event) => {
const selectedValue = event.detail.item.value;
// Apply saved brand and palette classes
document.documentElement.classList.add(`wa-brand-${localStorage.getItem('brand') || 'blue'}`);
document.documentElement.classList.add(`wa-palette-${localStorage.getItem('palette') || 'default'}`);
// Trigger input event for theme.js
el.value = selectedValue;
el.dispatchEvent(new Event('input', { bubbles: true }));
});
});
</script>

View File

@@ -4,7 +4,7 @@
{% include 'head.njk' %}
{% block head %}{% endblock %}
</head>
<body class="layout-{{ layout | stripExtension }}">
<body class="layout-{{ layout | stripExtension }} page-{{ pageClass or page.fileSlug or 'home' }}">
{% block content %}
{{ content | safe }}
{% endblock %}

View File

@@ -11,7 +11,6 @@ export function SimulateWebAwesomeApp(str) {
},
server: {
head: '',
loginOrAvatar: '',
flashes: '',
},
});

View File

@@ -3,17 +3,30 @@ import { doViewTransition } from '../scripts/view-transitions.js';
//
// Updates the color scheme when a color scheme selector changes
//
function updateTheme(value) {
async function updateTheme(value) {
localStorage.setItem('color-scheme', value);
const isDark = value === 'dark' || (value === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches);
doViewTransition(() => {
// Disable tooltip during transition
const tooltip = document.querySelector('#color-scheme-tooltip');
if (tooltip) {
tooltip.disabled = true;
}
await doViewTransition(() => {
document.documentElement.classList.toggle('wa-dark', isDark);
});
// Sync all selectors
// Sync all selectors and update tooltip
document.querySelectorAll('.color-scheme-selector').forEach(el => (el.value = value));
// Update tooltip content and re-enable after transition completes
if (tooltip) {
const schemeText = value === 'light' ? 'Light' : value === 'dark' ? 'Dark' : 'System';
tooltip.textContent = schemeText;
tooltip.disabled = false;
}
}
// Handle changes

View File

@@ -6,7 +6,20 @@ import { doViewTransition } from '../scripts/view-transitions.js';
async function updateTheme(value, isInitialLoad = false) {
const body = document.body;
// Get brand, palette, and theme name from the selected option
const themeSelector = document.querySelector('.theme-selector');
const selectedOption = themeSelector?.querySelector(`wa-dropdown-item[value="${value}"]`);
let brand = selectedOption?.getAttribute('data-brand') || 'blue';
let palette = selectedOption?.getAttribute('data-palette') || 'default';
let themeName = selectedOption?.textContent.trim() || 'Unknown';
if (!isInitialLoad) {
// Disable tooltip during theme transition
const tooltip = document.querySelector('#theme-tooltip');
if (tooltip) {
tooltip.disabled = true;
}
// Add fade-out class
body.classList.add('theme-transitioning');
@@ -22,27 +35,29 @@ async function updateTheme(value, isInitialLoad = false) {
});
}
localStorage.setItem('theme', value);
// Handle site theme vs regular theme
let href = `/dist/styles/themes/${value}.css`;
// Get brand and palette from the selected option
const themeSelector = document.querySelector('.theme-selector');
const selectedOption = themeSelector?.querySelector(`wa-option[value="${value}"]`);
const brand = selectedOption?.getAttribute('data-brand') || 'blue';
const palette = selectedOption?.getAttribute('data-palette') || 'default';
const htmlElement = document.documentElement;
localStorage.setItem('brand', brand);
localStorage.setItem('palette', palette);
if (document.querySelector('wa-page').dataset.pageType === 'site') {
brand = 'orange';
href = `/assets/styles/theme-site.css`;
palette = 'default';
value = 'site';
} else {
localStorage.setItem('brand', brand);
localStorage.setItem('palette', palette);
localStorage.setItem('theme', value);
}
// Update theme classes
const htmlElement = document.documentElement;
const classesToRemove = Array.from(htmlElement.classList).filter(
className =>
className.startsWith('wa-theme-') || className.startsWith('wa-brand-') || className.startsWith('wa-palette-'),
);
const themeStylesheet = document.getElementById('theme-stylesheet');
const href = `/dist/styles/themes/${value}.css`;
doViewTransition(() => {
await doViewTransition(() => {
// Update the theme
if (themeStylesheet) {
themeStylesheet.href = href;
@@ -56,16 +71,26 @@ async function updateTheme(value, isInitialLoad = false) {
htmlElement.classList.add(`wa-palette-${palette}`);
// Sync all theme selectors
document.querySelectorAll('.theme-selector').forEach(el => (el.value = value));
document.querySelectorAll('.theme-selector').forEach(el => {
el.value = value;
el.setAttribute('value', value);
});
// Update tooltip content to reflect the new theme
const tooltip = document.querySelector('#theme-tooltip');
if (tooltip) {
tooltip.textContent = `${themeName} Theme`;
}
});
if (!isInitialLoad) {
// Waiting for the stylesheet and all it's imports to load is tricky. Preloading doesn't work for most themes
// because applying the new stylesheet to the document, even without adding the `wa-theme-*` class, causes jank.
// Suggestions welcome.
setTimeout(() => {
body.classList.remove('theme-transitioning');
}, 500);
// Remove transition class and re-enable tooltip after view transition completes
body.classList.remove('theme-transitioning');
const tooltip = document.querySelector('#theme-tooltip');
if (tooltip) {
tooltip.disabled = false;
}
}
}
@@ -77,5 +102,11 @@ document.addEventListener('input', event => {
});
// Initialize
const savedTheme = localStorage.getItem('theme') || 'default';
updateTheme(savedTheme, true);
function initializeTheme() {
const savedTheme = localStorage.getItem('theme') || 'default';
updateTheme(savedTheme, true);
}
initializeTheme();
document.addEventListener('turbo:render', initializeTheme);

View File

@@ -5,6 +5,7 @@
@import 'search.css';
@import 'cera-typeface.css';
@import 'theme-icons.css';
@import 'utils.css';
:root {
--wa-brand-orange: #f36944;
@@ -48,6 +49,16 @@ wa-page > header {
line-height: 1;
}
.brand-logo {
color: var(--wa-color-text-normal);
line-height: 1;
}
.brand-logo svg {
width: auto;
height: 1.75rem;
}
wa-button[data-toggle-nav] {
--text-color: currentColor;
font-size: 1rem;
@@ -59,55 +70,6 @@ wa-page > header {
padding-inline: 0.875rem;
}
}
svg {
width: auto;
height: 1.75rem;
}
#docs-branding,
#docs-toolbar {
display: flex;
align-items: center;
gap: var(--wa-space-s);
.color-scheme-selector,
.theme-selector {
max-inline-size: 20ch;
}
wa-divider:last-child {
display: none;
}
}
#github-buttons {
> wa-button {
&::part(base) {
color: var(--wa-color-on-quiet);
background-color: var(--wa-color-fill-quiet);
}
> wa-icon {
font-size: round(1.25em, 1px);
}
}
> wa-tooltip {
--wa-tooltip-arrow-size: 0;
font-size: var(--wa-font-size-xs);
}
}
#version-number {
color: var(--wa-color-text-quiet);
font-size: var(--wa-font-size-xs);
line-height: 1;
margin-block-start: var(--wa-space-2xs);
}
#version-number + wa-badge {
font-size: var(--wa-font-size-2xs);
text-transform: uppercase;
}
}
#sidebar,
@@ -188,13 +150,6 @@ wa-page > header {
margin-block-end: var(--wa-space-m);
}
/* Pro badges */
wa-badge.pro {
color: white;
background-color: var(--wa-brand-orange);
border-color: var(--wa-brand-orange);
}
#sidebar {
h2 {
color: var(--wa-color-text-quiet);
@@ -230,6 +185,20 @@ wa-badge.pro {
--show-duration: 0;
--hide-duration: 0;
}
.the-socials {
/* nudge those linkies left */
margin-inline-start: calc(var(--wa-space-xs) * -1);
a[target='_blank'] {
color: var(--wa-color-text-quiet);
padding-inline: var(--wa-space-xs);
&:hover {
color: var(--wa-color-text-normal);
}
}
}
}
wa-button.delete {
@@ -270,6 +239,20 @@ wa-page::part(menu) {
scrollbar-width: thin;
}
/* smaller viewports-based navigation */
wa-page > [slot='navigation-header'] {
padding: 0;
.brand-logo svg {
height: 1.25rem;
}
/* resetting font-weight of dropdown items in .title */
wa-dropdown {
font-weight: var(--wa-font-weight-normal);
}
}
wa-page[view='mobile'] :is([slot='navigation-header'], [slot='navigation']) {
padding: 0;
@@ -280,7 +263,7 @@ wa-page[view='mobile'] :is([slot='navigation-header'], [slot='navigation']) {
/* Main content */
wa-page > main {
max-width: 80ch;
max-width: var(--content-width-s);
padding: var(--wa-space-xl);
margin-inline: auto;
}
@@ -386,27 +369,9 @@ h1.title {
}
}
/* Search trigger */
wa-button#search-trigger {
&::part(base) {
background-color: var(--wa-form-control-background-color);
border: var(--wa-form-control-border-width) var(--wa-form-control-border-style) var(--wa-form-control-border-color);
box-shadow: none;
}
&::part(label) {
text-align: start;
width: 100%;
}
}
#search-trigger kbd {
font-size: var(--wa-font-size-2xs);
line-height: var(--wa-form-control-value-line-height);
padding-inline: 0.33em;
}
/* Search list pages */
wa-page > main:has(> .search-list) {
max-width: 120ch;
max-width: var(--content-width-l);
margin-inline: auto;
}
@@ -621,7 +586,7 @@ wa-scroller:has(.component-table) {
.table-arguments,
.table-description {
min-width: 40ch;
min-width: var(--line-length-xs);
}
.table-reflect {
@@ -670,10 +635,10 @@ wa-scroller:has(.component-table) {
.page-wide {
wa-page > main {
max-width: 140ch;
max-width: var(--content-width-l);
.max-line-length {
max-width: 80ch;
max-width: var(--line-length-l);
}
}
}

View File

@@ -0,0 +1,149 @@
/* Monorepo Styles
* These styles include elements that are shared across this repo as well as others included in the Web Awesome monorepo
*/
@layer wa-utils {
:root {
/* max-width for fixed width app-based pages
* We round() these to avoid obscure component rendering bugs caused by widths with fractional pixels */
--content-width-l: round(up, 132ch, 1px);
--content-width-m: round(up, 110ch, 1px);
--content-width-s: round(up, 80ch, 1px);
--content-width-xs: round(up, 50ch, 1px);
--content-padding-inline: 4ch;
--content-flow-spacing: 8ch;
--line-length-xs: 30ch;
--line-length-s: 45ch;
--line-length-m: 66ch;
--line-length-l: 77ch;
--line-length-xl: 90ch;
--line-length-none: none;
}
/* #region brand utilities */
.logo-webawesome {
color: var(--wa-brand-orange);
}
/* #endregion */
/* #region layout utilities */
.content-container {
margin-inline: auto;
max-width: var(--max-width, var(--content-width-l));
padding-inline: var(--content-padding-inline);
}
/* #endregion */
/* #region Text utilities */
.text-truncate {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* line-length */
.line-length {
max-width: var(--line-length, none);
}
.line-length-xs {
--line-length: var(--line-length-xs);
}
.line-length-s {
--line-length: var(--line-length-s);
}
.line-length-m {
--line-length: var(--line-length-m);
}
.line-length-l {
--line-length: var(--line-length-l);
}
.line-length-xl {
--line-length: var(--line-length-xl);
}
.line-length-none {
--line-length: none;
}
/* #endregion */
/* #region shared UI */
/* pro badge */
wa-badge.pro {
color: white;
background-color: var(--wa-brand-orange);
border-color: var(--wa-brand-orange);
text-transform: uppercase;
+ wa-tooltip {
font-size: var(--wa-font-size-xs);
--max-width: unset;
}
}
/* search trigger */
wa-button#search-trigger {
&::part(base) {
background-color: var(--wa-form-control-background-color);
border: var(--wa-form-control-border-width) var(--wa-form-control-border-style)
var(--wa-form-control-border-color);
box-shadow: none;
}
&::part(label) {
text-align: start;
width: 100%;
}
}
#search-trigger kbd {
font-size: var(--wa-font-size-2xs);
line-height: var(--wa-form-control-value-line-height);
padding-inline: 0.33em;
}
/* #endregion */
/* #region funsies */
/* buttons with icon toggle on hover */
wa-button .icon-hover {
display: none;
}
wa-button:hover .icon-default {
display: none;
}
wa-button:hover .icon-hover {
display: inline-flex;
}
/* #endregion */
/* #region resets */
code.appearance-plain {
background: transparent;
border: none;
}
a.appearance-plain {
--wa-color-text-link: var(--wa-color-text-normal);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
ul,
ol {
&.appearance-plain {
list-style: none;
padding-inline-start: 0;
li {
padding-inline-start: 0;
}
}
}
/* increasing visual size of icons in certain contexts (such as in plain buttons) */
wa-icon.icon-embiggen {
font-size: round(1.125em, 1px);
}
/* #endregion */
}

View File

@@ -8,7 +8,7 @@ category: Utilities
Localization is handled by the browser's [`Intl.RelativeTimeFormat` API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat). No language packs are required.
```html {.example}
<!-- Web Awesome 2 release date 🎉 -->
<!-- Shoelace 2 release date 🎉 -->
<wa-relative-time date="2020-07-15T09:17:00-04:00"></wa-relative-time>
```

View File

@@ -212,4 +212,4 @@ declare module 'react' {
:::details React 18 and below
React 18 and below have [poor support](https://custom-elements-everywhere.com/#react) for custom elements. For legacy versions of React, we provide React wrappers for every component. You can find the import instructions by selecting the _React_ tab from the _Importing_ section of each
component's documentation.
:::
:::

View File

@@ -4,14 +4,18 @@ description: Changes to each version of the project are documented here.
layout: page-outline
---
<p class="wa-caption-m">Last updated: <wa-format-date month="long" day="numeric" year="numeric" date="{{ lastUpdatedISO }}"></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.
Components with the <wa-badge variant="warning">Experimental</wa-badge> badge should not be used in production. They are made available as release candidates for development and testing purposes. As such, changes to experimental components will not be subject to semantic versioning.
## Next
- Added the Kazakh translation [pr:1496]
- Fixed a bug in `<wa-button>` where slotted badges weren't properly positioned in buttons with an `href` [issue:1377]
- Fixed focus outline styles in `<wa-details>` and native `<details>` [issue:1456]
- Fixed focus outline styles in `<wa-scroller>`, `<wa-dialog>`, and `<wa-drawer>` [issue:1484]
## 3.0.0-beta.6
@@ -455,4 +459,4 @@ Many of these changes and improvements were the direct result of feedback from u
</details>
Did we miss something? [Let us know!](https://github.com/shoelace-style/webawesome/discussions)
Did we miss something? [Let us know!](https://github.com/shoelace-style/webawesome/discussions)

View File

@@ -36,13 +36,27 @@ The [community chat](https://discord.gg/mg8f26C) is open to the public and power
Join the Chat
</wa-button>
## Twitter
## Social Networks
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.
Follow Web Awesome on [Bluesky](https://bsky.app/profile/webawesome.com), [X (Twitter)](https://x.com/webawesomer), [Mastodon](https://mastodon.social/@webawesome), or [Threads](https://www.threads.com/@web.awesome) for general updates and announcements. 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/webawesome/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.
**Please avoid using Social Networks for support questions.** The [discussion forum](https://github.com/shoelace-style/webawesome/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.
<wa-button variant="brand" href="https://twitter.com/webawesomer" target="_blank" style="margin-block-end: var(--wa-content-spacing);">
<wa-icon name="twitter" family="brands" slot="start"></wa-icon>
Follow on Twitter
</wa-button>
<div class="wa-cluster wa-gap-l">
<wa-button variant="brand" href="https://bsky.app/profile/webawesome.com" rel="noopener noreferrer" target="_blank">
<wa-icon name="bluesky" family="brands" slot="start"></wa-icon>
Bluesky
</wa-button>
<wa-button variant="brand" href="https://twitter.com/webawesomer" rel="noopener noreferrer" target="_blank">
<wa-icon name="x-twitter" family="brands" slot="start"></wa-icon>
X (Twitter)
</wa-button>
<wa-button variant="brand" href="https://mastodon.social/@webawesome" rel="noopener noreferrer" target="_blank">
<wa-icon name="mastodon" family="brands" slot="start"></wa-icon>
Mastodon
</wa-button>
<wa-button variant="brand" href="https://www.threads.com/@web.awesome" rel="noopener noreferrer" target="_blank">
<wa-icon name="threads" family="brands" slot="start"></wa-icon>
Threads
</wa-button>
</div>

View File

@@ -296,6 +296,7 @@ Then use the following syntax for comments so they appear in the generated docs.
* @cssproperty --color: The component's text color.
* @cssproperty --background-color: The component's background color.
*/
@customElement('wa-example')
export default class WaExample {
// ...
}
@@ -396,7 +397,7 @@ Guidelines for writing tests:
### Running tests
Right now, tests run both "hydrated" (SSR -> client hydrated) and "client only". If you're debugging only one specific kind you can set an environment variable. For example, to run only the client tests, you can do:
Right now, tests run both "hydrated" (SSR client hydrated) and "client only". If you're debugging only one specific kind you can set an environment variable. For example, to run only the client tests, you can do:
```bash
CSR_ONLY="true" npm run test

View File

@@ -257,11 +257,22 @@ layout: page
{% if currentUser.hasPro %}
<span style="text-align: center; width: 100%; font-size: var(--wa-font-size-l);">Thanks for being a Web Awesome Pro subscriber!</span>
{% else %}
<span><em>Psst!</em> You can pre-order Web Awesome Pro at a low, guaranteed-for-life price &mdash; but not for long. Get in while the gettins good.</span>
<wa-button class="wa-dark" size="small" href="https://www.kickstarter.com/projects/fontawesome/web-awesome">
<wa-icon slot="start" name="person-running"></wa-icon>
Pre-order WA Pro
</wa-button>
{% if App.flags.stripeEnabled %}
<div class="wa-stack wa-gap-xs">
<h3 class="wa-heading-s">Get More with Web Awesome Pro!</h3>
<p>Unlock Pro-only themes, components, patterns, and great services like the Theme Builder.</p>
</div>
<wa-button class="wa-dark" size="small" href="/purchase">
<wa-icon slot="start" name="rocket-launch"></wa-icon>
Purchase Pro
</wa-button>
{% else %}
<span><em>Psst!</em> You can pre-order Web Awesome Pro at a low, guaranteed-for-life price &mdash; but not for long. Get in while the gettins good.</span>
<wa-button class="wa-dark" size="small" href="https://www.kickstarter.com/projects/fontawesome/web-awesome">
<wa-icon slot="start" name="person-running"></wa-icon>
Pre-order WA Pro
</wa-button>
{% endif %}
{% endif %}
{% endraw %}
</div>
@@ -385,7 +396,7 @@ layout: page
<wa-icon name="hashtag" style="color: var(--wa-brand-orange);"></wa-icon>
<span>Stay in the know</span>
</h2>
<div class="wa-grid">
<div class="wa-grid" style="--min-column-size: 30ch;">
<wa-button href="https://bsky.app/profile/webawesome.com" rel="noopener noreferrer" target="_blank" appearance="filled" class="tile">
<div class="wa-split">
<div class="wa-cluster icon-heading">
@@ -395,6 +406,15 @@ layout: page
<wa-icon name="arrow-up-right"></wa-icon>
</div>
</wa-button>
<wa-button href="https://mastodon.social/@webawesome" rel="noopener noreferrer" target="_blank" appearance="filled" class="tile">
<div class="wa-split">
<div class="wa-cluster icon-heading">
<wa-icon family="brands" name="mastodon"></wa-icon>
<h3>Mastodon</h3>
</div>
<wa-icon name="arrow-up-right"></wa-icon>
</div>
</wa-button>
<wa-button href="https://x.com/webawesomer" rel="noopener noreferrer" target="_blank" appearance="filled" class="tile">
<div class="wa-split">
<div class="wa-cluster icon-heading">

View File

@@ -89,6 +89,7 @@
]
},
"devDependencies": {
"@wc-toolkit/jsx-types": "^1.3.0"
"@wc-toolkit/jsx-types": "^1.3.0",
"eleventy-plugin-git-commit-date": "^0.1.3"
}
}

View File

@@ -111,6 +111,15 @@
padding: var(--spacing);
overflow: auto;
-webkit-overflow-scrolling: touch;
&:focus {
outline: none;
}
&:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
}
.footer {

View File

@@ -37,6 +37,7 @@ import styles from './dialog.css';
* behavior such as data loss.
* @event wa-after-hide - Emitted after the dialog closes and all animations are complete.
*
* @csspart dialog - The dialog's internal `<dialog>` element.
* @csspart header - The dialog's header. This element wraps the title and header actions.
* @csspart header-actions - Optional actions to add to the header. Works best with `<wa-button>`.
* @csspart title - The dialog's title.

View File

@@ -175,6 +175,15 @@
padding: var(--spacing);
overflow: auto;
-webkit-overflow-scrolling: touch;
&:focus {
outline: none;
}
&:focus-visible {
outline: var(--wa-focus-ring);
outline-offset: var(--wa-focus-ring-offset);
}
}
.footer {

View File

@@ -38,6 +38,7 @@ import styles from './drawer.css';
* the drawer has been closed programmatically. Avoid using this unless closing the drawer will result in destructive
* behavior such as data loss.
*
* @csspart dialog - The drawer's internal `<dialog>` element.
* @csspart header - The drawer's header. This element wraps the title and header actions.
* @csspart header-actions - Optional actions to add to the header. Works best with `<wa-button>`.
* @csspart title - The drawer's title.

View File

@@ -64,7 +64,7 @@ export default class WaIcon extends WebAwesomeElement {
@property({ reflect: true }) variant: string;
/** Sets the width of the icon to match the cropped SVG viewBox. This operates like the Font `fa-width-auto` class. */
@property({ attribute: 'auto-width', type: Boolean, reflect: true }) autoWidth: false;
@property({ attribute: 'auto-width', type: Boolean, reflect: true }) autoWidth = false;
/** Swaps the opacity of duotone icons. */
@property({ attribute: 'swap-opacity', type: Boolean, reflect: true }) swapOpacity = false;

View File

@@ -10,7 +10,6 @@
position: relative;
max-width: 100%;
isolation: isolate;
overflow: hidden;
}
:host([orientation='vertical']) {

View File

@@ -1,4 +1,5 @@
@import url('base.css');
@import url('../variants.css');
@layer wa-color-palette {
.wa-palette-bright {

View File

@@ -1,4 +1,5 @@
@import url('base.css');
@import url('../variants.css');
@layer wa-color-palette {
:where(:root),

View File

@@ -1,4 +1,5 @@
@import url('base.css');
@import url('../variants.css');
@layer wa-color-palette {
.wa-palette-shoelace,

View File

@@ -1,3 +1,6 @@
@import url('utilities/size.css');
@import url('utilities/variants.css');
@layer wa-native {
/* #region General ~~~~~~~~~~~~~~~~~~~~~~~~~ */
html {

View File

@@ -1,5 +1,5 @@
@import url('https://fonts.bunny.net/css2?family=Quicksand:wght@300..700&display=swap');
@import url('https://fonts.bunny.net/css2?family=Crimson+Pro:ital,wght@0,200..900;1,200..900&display=swap');
@import url('../color/palettes/bright.css'); /* To use this palette, add class="wa-palette-bright" to the <html> element */
@import url('https://fonts.bunny.net/css2?family=Crimson+Pro:ital,wght@0,200..900;1,200..900&family=Quicksand:wght@300..700&display=swap');
@layer wa-theme {
.wa-theme-awesome,

View File

@@ -1,5 +1,4 @@
@import url('../color/palettes/default.css');
@import url('../color/variants.css');
@layer wa-theme {
:where(:root),

View File

@@ -1,3 +1,5 @@
@import url('../color/palettes/shoelace.css'); /* To use this palette, add class="wa-palette-shoelace" to the <html> element */
@layer wa-theme {
.wa-theme-shoelace,
.wa-theme-shoelace.wa-light,

View File

@@ -0,0 +1,45 @@
import { registerTranslation } from '@shoelace-style/localize';
import type { Translation } from '../utilities/localize.js';
const translation: Translation = {
$code: 'kk',
$name: 'Қазақ',
$dir: 'ltr',
carousel: 'Карусель',
clearEntry: 'Жазбаны жою',
close: 'Жабу',
copied: 'Көшірілді',
copy: 'Көшіру',
currentValue: 'Қазіргі мән',
error: 'Қате',
goToSlide: (slide, count) => `${slide}/${count} слайдқа өту`,
hidePassword: 'Құпиясөзді жасыру',
loading: 'Жүктелуде',
nextSlide: 'Келесі слайд',
numOptionsSelected: num => {
if (num === 0) return 'Ештеңе таңдалмады';
if (num < 6 || num === 7) return `${num}-еу таңдалды`;
if (num === 6) return `${num}-ау таңдалды`;
return `${num} таңдалды`;
},
pauseAnimation: 'Анимацияны тоқтату',
playAnimation: 'Анимацияны ойнату',
previousSlide: 'Алдыңғы слайд',
progress: 'Прогресс',
remove: 'Жою',
resize: 'Өлшемін өзгерту',
scrollableRegion: 'Көтеру/түсіруге болатын аймақ (скролл)',
scrollToEnd: 'Соңына түсіру',
scrollToStart: 'Басына көтеру',
selectAColorFromTheScreen: 'Экраннан түсті таңдаңыз',
showPassword: 'Құпиясөзді көрсету',
slideNum: slide => `${slide}-слайд`,
toggleColorFormat: 'Түс пішімін ауыстыру',
zoomIn: 'Жақындату',
zoomOut: 'Алыстату',
};
registerTranslation(translation);
export default translation;