mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 20:19:13 +00:00
* 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
179 lines
7.1 KiB
Plaintext
179 lines
7.1 KiB
Plaintext
<!DOCTYPE html>
|
|
<html lang="en" data-fa-kit-code="b10bfbde90" data-cdn-url="{% cdnUrl %}">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="description" content="{{ description }}">
|
|
<meta name="theme-color" content="#f36944">
|
|
{% if noindex %}<meta name="robots" content="noindex">{% endif %}
|
|
|
|
<title>{{ title }}</title>
|
|
|
|
<link rel="icon" href="/assets/images/webawesome-logo.svg" />
|
|
<link rel="apple-touch-icon" href="/assets/images/app-icon.png">
|
|
|
|
{# Scripts #}
|
|
{# Hydration stuff #}
|
|
<script src="/assets/scripts/hydration-errors.js"></script>
|
|
<link rel="stylesheet" href="/assets/styles/hydration-errors.css">
|
|
<link rel="preconnect" href="https://cdn.jsdelivr.net">
|
|
<script type="module" src="https://cdn.jsdelivr.net/npm/@hotwired/turbo@8.0.4/+esm"></script>
|
|
|
|
<script type="module" src="/assets/scripts/code-examples.js"></script>
|
|
<script type="module" src="/assets/scripts/color-scheme.js"></script>
|
|
<script type="module" src="/assets/scripts/copy-code.js"></script>
|
|
<script type="module" src="/assets/scripts/preset-theme.js"></script>
|
|
<script type="module" src="/assets/scripts/scroll.js"></script>
|
|
<script type="module" src="/assets/scripts/turbo.js"></script>
|
|
<script type="module" src="/assets/scripts/search.js"></script>
|
|
<script type="module" src="/assets/scripts/outline.js"></script>
|
|
<script defer data-domain="backers.webawesome.com" src="https://plausible.io/js/script.js"></script>
|
|
|
|
{# Web Awesome #}
|
|
<script type="module" src="/dist/webawesome.ssr-loader.js"></script>
|
|
<link rel="stylesheet" id="theme-stylesheet" />
|
|
<link rel="stylesheet" href="/dist/themes/applied.css" />
|
|
<link id="color-stylesheet" rel="stylesheet" href="/dist/themes/layout.css" />
|
|
<link id="color-stylesheet" rel="stylesheet" href="/dist/themes/utilities.css" />
|
|
<link rel="stylesheet" href="/dist/themes/forms.css" />
|
|
|
|
{# Docs styles #}
|
|
<link rel="stylesheet" href="/assets/styles/docs.css" />
|
|
|
|
{# Set the theme to prevent flashing #}
|
|
<script>
|
|
function getColorScheme() {
|
|
return localStorage.getItem('colorScheme') || 'auto';
|
|
}
|
|
|
|
function getPresetTheme () {
|
|
return localStorage.getItem('presetTheme') || 'default';
|
|
}
|
|
|
|
function isDark() {
|
|
const colorScheme = getColorScheme()
|
|
if (colorScheme === 'auto') {
|
|
return window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
}
|
|
return colorScheme === 'dark';
|
|
}
|
|
|
|
const stylesheet = document.getElementById("theme-stylesheet")
|
|
let preset = getPresetTheme()
|
|
|
|
stylesheet.href = `/dist/themes/${preset}.css`
|
|
|
|
document.documentElement.classList.toggle(
|
|
`wa-theme-${preset}-dark`,
|
|
isDark()
|
|
);
|
|
</script>
|
|
</head>
|
|
<body class="layout-{{ layout | stripExtension }}">
|
|
<!-- use view="desktop" as default to reduce layout jank on desktop site. -->
|
|
<wa-page view="desktop">
|
|
<header slot="header">
|
|
{# Logo #}
|
|
<div id="docs-branding">
|
|
{# Nav toggle #}
|
|
<wa-button appearance="text" data-toggle-nav>
|
|
<wa-icon name="bars" label="Toggle navigation"></wa-icon>
|
|
</wa-button>
|
|
<a href="/" aria-label="Web Awesome">
|
|
<span class="only-desktop">{% include "logo.njk" %}</span>
|
|
<span class="only-mobile">{% include "logo-simple.njk" %}</span>
|
|
</a>
|
|
<small id="version-number" class="only-desktop">{{ package.version }}</small>
|
|
<wa-badge variant="warning" class="only-desktop">Alpha</wa-badge>
|
|
</div>
|
|
|
|
<div id="docs-toolbar">
|
|
{# Preset theme selector #}
|
|
<wa-dropdown id="preset-theme-selector">
|
|
<wa-button slot="trigger" appearance="tinted" size="small" pill caret>
|
|
<wa-icon slot="prefix" name="paintbrush" variant="regular"></wa-icon>
|
|
<span id="preset-theme-selector__text" class="only-desktop">Default</span>
|
|
</wa-button>
|
|
<wa-menu>
|
|
<wa-menu-item type="checkbox" value="default">Default</wa-menu-item>
|
|
<wa-menu-item type="checkbox" value="classic">Classic</wa-menu-item>
|
|
<wa-menu-item type="checkbox" value="fa">Font Awesome</wa-menu-item>
|
|
|
|
<wa-menu-item type="checkbox" value="active">Active</wa-menu-item>
|
|
<wa-menu-item type="checkbox" value="brutalist">Brutalism</wa-menu-item>
|
|
<wa-menu-item type="checkbox" value="glassy">Glassy</wa-menu-item>
|
|
<wa-menu-item type="checkbox" value="migration">Migration</wa-menu-item>
|
|
<wa-menu-item type="checkbox" value="playful">Playful</wa-menu-item>
|
|
<wa-menu-item type="checkbox" value="premium">Premium</wa-menu-item>
|
|
</wa-menu>
|
|
</wa-dropdown>
|
|
{# Color scheme selector #}
|
|
<wa-dropdown id="color-scheme-selector">
|
|
<wa-button slot="trigger" appearance="tinted" size="small" pill caret title="Press \ to toggle">
|
|
<wa-icon class="only-light" slot="prefix" name="sun" variant="regular"></wa-icon>
|
|
<wa-icon class="only-dark" slot="prefix" name="moon" variant="regular"></wa-icon>
|
|
<span class="only-light only-desktop">Light</span>
|
|
<span class="only-dark only-desktop">Dark</span>
|
|
</wa-button>
|
|
<wa-menu>
|
|
<wa-menu-item type="checkbox" value="light">Light</wa-menu-item>
|
|
<wa-menu-item type="checkbox" value="dark">Dark</wa-menu-item>
|
|
<wa-divider></wa-divider>
|
|
<wa-menu-item type="checkbox" value="auto">System</wa-menu-item>
|
|
</wa-menu>
|
|
</wa-dropdown>
|
|
|
|
{# Search #}
|
|
<wa-button id="search-trigger" appearance="outlined" size="small" data-search>
|
|
<wa-icon slot="prefix" name="magnifying-glass"></wa-icon>
|
|
Search
|
|
<kbd slot="suffix" class="only-desktop">/</kbd>
|
|
</wa-button>
|
|
</div>
|
|
</header>
|
|
|
|
{# Sidebar #}
|
|
{% if hasSidebar %}
|
|
<aside slot="navigation" id="sidebar" class="docs-aside" data-remember-scroll>
|
|
<wa-icon-button id="sidebar-close-button" name="xmark" label="Close" data-drawer="close"></wa-icon-button>
|
|
<nav>
|
|
{% include "sidebar.njk" %}
|
|
</nav>
|
|
</aside>
|
|
{% endif %}
|
|
|
|
{# Outline #}
|
|
{% if hasOutline %}
|
|
<aside slot="aside" id="outline" class="docs-aside">
|
|
<nav id="outline-standard" class="outline-links">
|
|
<h2><a href="#content">{{ title }}</a></h2>
|
|
</nav>
|
|
</aside>
|
|
{% endif %}
|
|
|
|
{# Main #}
|
|
<main id="content">
|
|
{# Expandable outline #}
|
|
<nav id="outline-expandable">
|
|
<details class="outline-links">
|
|
<summary>On this page</summary>
|
|
</details>
|
|
</nav>
|
|
|
|
{% block beforeContent %}{% endblock %}
|
|
|
|
{% block content %}
|
|
<h1 class="title">{{ title }}</h1>
|
|
|
|
{{ content | safe }}
|
|
{% endblock %}
|
|
|
|
{% block afterContent %}{% endblock %}
|
|
</main>
|
|
|
|
{% include 'search.njk' %}
|
|
</wa-page>
|
|
|
|
</body>
|
|
</html>
|