mirror of
https://github.com/shoelace-style/webawesome.git
synced 2026-01-12 04:09:12 +00:00
Themer integration (#1635)
* remove themer from sidebar * fix themes/palettes spacing * suppress error in layouts without <wa-page> * remove broken themer link, add more helpful deets * make my last commit actually work 🙄 --------- Co-authored-by: lindsaym-fa <dev@lindsaym.design>
This commit is contained in:
@@ -383,12 +383,6 @@
|
||||
<ul>
|
||||
<li><a href="/docs/color-palettes">Color Palettes</a></li>
|
||||
<li><a href="/docs/themes">Themes</a></li>
|
||||
<li>
|
||||
<span class="wa-split">
|
||||
<a href="/themer" data-turbo="false">Theme Builder</a>
|
||||
{{ proBadge({ description: "This requires an active Web Awesome Pro subscription", shrink: true }) }}
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Design tokens -->
|
||||
|
||||
@@ -38,7 +38,7 @@ async function updateTheme(value, isInitialLoad = false) {
|
||||
// Handle site theme vs regular theme
|
||||
let href = `/dist/styles/themes/${value}.css`;
|
||||
|
||||
if (document.querySelector('wa-page').dataset.pageType === 'site') {
|
||||
if (document.querySelector('wa-page')?.dataset.pageType === 'site') {
|
||||
brand = 'orange';
|
||||
href = `/assets/styles/theme-site.css`;
|
||||
palette = 'default';
|
||||
|
||||
@@ -121,7 +121,6 @@ layout: page
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--wa-space-s);
|
||||
}
|
||||
|
||||
&::part(form-control-label) {
|
||||
|
||||
@@ -1,26 +1,28 @@
|
||||
---
|
||||
title: Themes
|
||||
description: Themes galore
|
||||
description: Style (and restyle) your website at will with any of Web Awesome's pre-built themes.
|
||||
layout: page
|
||||
---
|
||||
|
||||
<div class="wa-split">
|
||||
<h1>{{ title }}</h1>
|
||||
<wa-button variant="brand" href="/themer">
|
||||
<wa-icon slot="start" name="plus" variant="regular"></wa-icon>
|
||||
Create a Theme
|
||||
</wa-button>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
{% raw %}
|
||||
<p>See one you like?
|
||||
{%- if not session.isLoggedIn -%}
|
||||
<a href="/login">Log in</a>
|
||||
{%- else -%}
|
||||
Head over to <a href="/teams">your teams</a>
|
||||
{%- endif -%}
|
||||
to create a project with any one of these themes.
|
||||
{%- if not currentUser.hasPro -%}
|
||||
(Plus, there are even more themes to love with Web Awesome Pro. <wa-icon name="heart" style="color: var(--wa-color-red-70);"></wa-icon>)
|
||||
{%- endif -%}
|
||||
</p>
|
||||
{% endraw %}
|
||||
|
||||
<div id="theme-viewer">
|
||||
{% raw %}
|
||||
{% if not currentUser.hasPro %}
|
||||
<p>
|
||||
Additional themes are available to pro users. Please <a href="/login">login to view pro themes</a>.
|
||||
</p>
|
||||
{% endif %}
|
||||
{% endraw %}
|
||||
|
||||
<wa-radio-group id="theme-picker" label="Theme Selector" value="default" orientation="horizontal">
|
||||
{% for theme in themer.themes %}
|
||||
{% if not theme.isPro %}
|
||||
@@ -223,13 +225,14 @@ layout: page
|
||||
}
|
||||
|
||||
#theme-viewer {
|
||||
margin-block-start: 2rem;
|
||||
|
||||
#theme-picker {
|
||||
|
||||
&::part(form-control-input) {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--wa-space-s);
|
||||
}
|
||||
|
||||
&::part(form-control-label) {
|
||||
|
||||
Reference in New Issue
Block a user