diff --git a/gallery/src/components/page-description.ts b/gallery/src/components/page-description.ts index 8e449195a6..e9680e59b3 100644 --- a/gallery/src/components/page-description.ts +++ b/gallery/src/components/page-description.ts @@ -12,7 +12,14 @@ class PageDescription extends HaMarkdown { if (!PAGES[this.page].description) { return html``; } + return html` +
+
+ ${PAGES[this.page].metadata.title || this.page.split("/")[1]} +
+
${PAGES[this.page].metadata.subtitle}
+
${until( PAGES[this.page] .description() @@ -25,9 +32,22 @@ class PageDescription extends HaMarkdown { static styles = [ HaMarkdown.styles, css` + .heading { + padding: 16px; + border-bottom: 1px solid var(--secondary-background-color); + } + .title { + font-size: 42px; + line-height: 56px; + padding-bottom: 8px; + } + .subtitle { + font-size: 18px; + line-height: 24px; + } .root { max-width: 800px; - margin: 0 auto; + margin: 16px auto; } .root > *:first-child { margin-top: 0; diff --git a/gallery/src/ha-gallery.ts b/gallery/src/ha-gallery.ts index 86e64e8d35..e602a1916d 100644 --- a/gallery/src/ha-gallery.ts +++ b/gallery/src/ha-gallery.ts @@ -5,6 +5,7 @@ import { html, css, LitElement, PropertyValues } from "lit"; import { customElement, property, query } from "lit/decorators"; import "../../src/components/ha-icon-button"; import "../../src/managers/notification-manager"; +import "../../src/components/ha-expansion-panel"; import { haStyle } from "../../src/resources/styles"; import { PAGES, SIDEBAR } from "../build/import-pages"; import { dynamicElement } from "../../src/common/dom/dynamic-element-directive"; @@ -53,10 +54,9 @@ class HaGallery extends LitElement { sidebar.push( group.header ? html` -
- ${group.header} + ${links} -
+ ` : links ); @@ -92,27 +92,34 @@ class HaGallery extends LitElement { ${dynamicElement(`demo-${this._page.replace("/", "-")}`)} @@ -186,27 +193,16 @@ class HaGallery extends LitElement { padding: 4px; } - .sidebar details { - margin-top: 1em; - margin-left: 1em; - } - - .sidebar summary { - cursor: pointer; - font-weight: bold; - margin-bottom: 8px; - } - .sidebar a { color: var(--primary-text-color); display: block; - padding: 4px 12px; + padding: 12px; text-decoration: none; position: relative; } .sidebar a[active]::before { - border-radius: 4px; + border-radius: 12px; position: absolute; top: 0; right: 2px; @@ -237,14 +233,32 @@ class HaGallery extends LitElement { .page-footer { text-align: center; - margin: 16px 0; - padding-top: 16px; - border-top: 1px solid rgba(0, 0, 0, 0.12); + margin: 16px; + padding: 16px; + border-radius: 12px; + background-color: var(--primary-background-color); + } + + .page-footer div { + margin-top: 4px; + } + + .page-footer .header { + font-size: 16px; + font-weight: 500; + line-height: 28px; + text-align: center; + } + + .page-footer .secondary { + line-height: 23px; + text-align: center; } .page-footer a { display: inline-block; margin: 0 8px; + text-decoration: none; } `, ]; diff --git a/gallery/src/pages/components/ha-alert.markdown b/gallery/src/pages/components/ha-alert.markdown index 2488b83090..e37a205481 100644 --- a/gallery/src/pages/components/ha-alert.markdown +++ b/gallery/src/pages/components/ha-alert.markdown @@ -1,5 +1,6 @@ --- title: Alerts +subtitle: An alert displays a short, important message in a way that attracts the user's attention without interrupting the user's task. --- # Alert ``