diff --git a/sanic/pages/base.py b/sanic/pages/base.py index b11b9c6e..a1b46e90 100644 --- a/sanic/pages/base.py +++ b/sanic/pages/base.py @@ -1,14 +1,22 @@ from abc import ABC, abstractmethod from textwrap import dedent +from sanic import __version__ as VERSION -from html5tagger import Document +from html5tagger import Document, HTML +LOGO_SVG = HTML("""""") + class BasePage(ABC): BASE_STYLE = dedent( """ - html { font-family: sans-serif; } - main { padding: 1rem; } + body { margin: 0; font: 1.2rem sans-serif; } + body > * { padding: 0 2rem; } + header { + display: flex; align-items: center; justify-content: space-between; + background: #555; color: #e1e1e1; + } + #logo { height: 2.5rem; } table { width: 100%; max-width: 1200px; } td { font-family: monospace; } span.icon { margin-right: 1rem; } @@ -35,7 +43,9 @@ class BasePage(ABC): return str(self.doc) def _head(self) -> None: - self.doc.head.title(self.TITLE).style(self.style) + self.doc.style(HTML(self.style)) + with self.doc.header: + self.doc(LOGO_SVG).div(self.TITLE, id="hdrtext").div(f"Version {VERSION}", id="hdrver") @abstractmethod def _body(self) -> None: