Skip to content

Commit

Permalink
refactor old components
Browse files Browse the repository at this point in the history
  • Loading branch information
dbushell committed Nov 8, 2024
1 parent 84023d9 commit 8230afc
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 269 deletions.
44 changes: 19 additions & 25 deletions components/pw-header.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
<patchwork-header>
<header class="Grid | Header">
<div class="Header__main">
<ssr-slot name="primary">
<a class="Header__logo" href="/">
<span class="Header__name">{{heading}}</span>
<ssr-if condition="tag">
<span class="Header__tag">{{tag}}</span>
</ssr-if>
</a>
</ssr-slot>
<ssr-slot name="secondary">
<ssr-if condition="menu.length">
<pw-button icon label="Toggle Menu" classes="{{['Hamburger']}}" popovertarget="nav" popovertargetaction="toggle">
<ssr-fragment slot="icon"><icon-menu /></ssr-fragment>
</pw-button>
<pw-nav menu="{{menu}}" />
<header class="Grid | Header">
<div class="Header__main">
<ssr-slot name="primary">
<a class="Header__logo" href="/">
<span class="Header__name">{{heading}}</span>
<ssr-if condition="tag">
<span class="Header__tag">{{tag}}</span>
</ssr-if>
</ssr-slot>
</div>
</header>
</patchwork-header>

<ssr-fragment portal="head">
<script type="module" src="/scripts/patchwork-header.js?v={{deployHash}}"></script>
</ssr-fragment>
</a>
</ssr-slot>
<ssr-slot name="secondary">
<ssr-if condition="menu.length">
<pw-button icon label="Toggle Menu" classes="{{['Hamburger']}}" popovertarget="nav" popovertargetaction="toggle">
<ssr-fragment slot="icon"><icon-menu /></ssr-fragment>
</pw-button>
<pw-nav menu="{{menu}}" />
</ssr-if>
</ssr-slot>
</div>
</header>
32 changes: 13 additions & 19 deletions components/pw-hero.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
<patchwork-hero>
<div class="Grid | Hero">
<div class="Hero__main">
<ssr-slot name="image" />
<ssr-slot name="main">
<ssr-slot name="heading">
<h1 class="Hero__heading">{{heading}}</h1>
</slot>
<ssr-slot name="intro">
<div class="Hero__intro">
<p>{{description}}</p>
</div>
</ssr-slot>
<div class="Grid | Hero">
<div class="Hero__main">
<ssr-slot name="image" />
<ssr-slot name="main">
<ssr-slot name="heading">
<h1 class="Hero__heading">{{heading}}</h1>
</slot>
<ssr-slot name="intro">
<div class="Hero__intro">
<p>{{description}}</p>
</div>
</ssr-slot>
</div>
</ssr-slot>
</div>
</patchwork-hero>

<ssr-fragment portal="head">
<script type="module" src="/scripts/patchwork-hero.js?v={{deployHash}}"></script>
</ssr-fragment>
</div>
18 changes: 10 additions & 8 deletions components/pw-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@
</nav>
</patchwork-nav>

<template id="settings-template">
<div id="settings" popover>
<div class="Button-group jc-end">
<p class="small space-xs mi-end">Theme</p>
<pw-button disabled id="settings-light" label="Light" />
<pw-button disabled id="settings-dark" label="Dark" />
<ssr-fragment portal="foot">
<template id="settings-template">
<div id="settings" popover>
<div class="Button-group jc-end">
<p class="small space-xs mi-end">Theme</p>
<pw-button disabled id="settings-light" label="Light" />
<pw-button disabled id="settings-dark" label="Dark" />
</div>
</div>
</div>
</template>
</template>
</ssr-fragment>

<ssr-fragment portal="head">
<script type="module" src="/scripts/patchwork-nav.js?v={{deployHash}}"></script>
Expand Down
2 changes: 1 addition & 1 deletion static/app.min.css

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions static/css/base/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ patchwork-body {
}

patchwork-dialog,
patchwork-header,
patchwork-hero,
patchwork-nav {
display: contents;
}
8 changes: 4 additions & 4 deletions static/css/base/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,22 @@ h6 {

h1 {
--font-size: var(--font-size-5);
line-height: 1;
--line-height: 1;
}

h2 {
--font-size: var(--font-size-4);
line-height: 1.1;
--line-height: 1.1;
}

h3 {
--font-size: var(--font-size-3);
line-height: 1.2;
--line-height: 1.2;
}

h4 {
--font-size: var(--font-size-2);
line-height: 1.3;
--line-height: 1.3;
}

h5 {
Expand Down
2 changes: 1 addition & 1 deletion static/css/components/button.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
body {
:root {
--button-height: calc(
(var(--font-size-0) * 1.5) + (var(--size-2) * 2) +
(var(--border-size-1) * 2)
Expand Down
2 changes: 1 addition & 1 deletion static/css/components/header.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
body {
:root {
--header-space: var(--size-5);
--header-height: calc((var(--header-space) * 2) + var(--button-height));
}
Expand Down
Loading

0 comments on commit 8230afc

Please sign in to comment.