Skip to content

Commit c5fba25

Browse files
committed
Add wco-nav-page for pages with nav areas
1 parent 6c7b09c commit c5fba25

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/**
2+
* @license
3+
* Copyright 2022 Google LLC
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
import {html, css} from 'lit';
8+
import {customElement} from 'lit/decorators.js';
9+
import {WCOPage} from './wco-page.js';
10+
import './wco-top-bar.js';
11+
12+
/**
13+
* A page with left and right side navigation areas.
14+
*/
15+
@customElement('wco-nav-page')
16+
export class WCONavPage extends WCOPage {
17+
static styles = [
18+
WCOPage.styles,
19+
css`
20+
main {
21+
display: grid;
22+
--docs-margin-block: 32px;
23+
--docs-nav-min-width: 14em;
24+
--docs-nav-max-width: 1fr;
25+
--docs-article-min-width: 30em;
26+
--docs-article-max-width: 49em;
27+
padding-block: var(--docs-margin-block);
28+
grid-template-columns:
29+
minmax(var(--docs-nav-min-width), var(--docs-nav-max-width))
30+
minmax(0, var(--docs-article-max-width)) 1fr;
31+
}
32+
33+
nav {
34+
display: flex;
35+
justify-content: center;
36+
align-items: center;
37+
border: solid 1px red;
38+
}
39+
`,
40+
];
41+
42+
protected override renderMain() {
43+
console.log('WCONavPage renderMain');
44+
return html`
45+
<nav id="main-outline">[Docs Outline]</nav>
46+
<article>${this.renderContent()}</article>
47+
<nav id="right-nav">[Page ToC]</nav>
48+
`;
49+
}
50+
}
51+
52+
declare global {
53+
interface HTMLElementTagNameMap {
54+
'wco-nav-page': WCONavPage;
55+
}
56+
}

0 commit comments

Comments
 (0)