-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(showcase): add dedicated header to showcases
Introduces distinct headers for standalone showcases. This commit refactors the existing header, creating two variants – one without navigation and another with navigation links. The styling of the standalone showcases has been adjusted to integrate with the new header element.
- Loading branch information
Showing
8 changed files
with
106 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import githubLogoSvg from '../../../img/github-logo.svg?raw'; | ||
import srgssrLogo from '../../../img/srgssr-logo.png'; | ||
import { html, LitElement, unsafeCSS } from 'lit'; | ||
import { unsafeSVG } from 'lit/directives/unsafe-svg.js'; | ||
import '../../router/route-link-component'; | ||
import { theme } from '../../theme/theme'; | ||
import coreHeaderCss from './core-demo-header-component.scss?inline'; | ||
|
||
/** | ||
* A web component that represents the header element of the demo page. This element | ||
* contains only the branding and a link to the GitHub page, it can be extended | ||
* with a custom action. | ||
* | ||
* @element core-demo-header | ||
* | ||
* @slot actions - Allows for the insertion of custom content at the end of the header. | ||
* | ||
* @example | ||
* <core-demo-header> | ||
* <button slot="actions">Custom Action</button> | ||
* </core-demo-header> | ||
*/ | ||
export class CoreDemoHeaderComponent extends LitElement { | ||
static styles = [theme, unsafeCSS(coreHeaderCss)]; | ||
|
||
render() { | ||
return html` | ||
<header> | ||
<h1> | ||
<img class="pbw-logo" src="${srgssrLogo}"/> | ||
<span>Pillarbox</span> | ||
</h1> | ||
<div class="header-end"> | ||
<a href="https://github.com/srgssr/pillarbox-web" class="github-link" | ||
title="Source on Github"> | ||
${unsafeSVG(githubLogoSvg)} | ||
</a> | ||
<slot name="actions"></slot> | ||
</div> | ||
</header>`; | ||
} | ||
} | ||
|
||
customElements.define('core-demo-header', CoreDemoHeaderComponent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
header { | ||
display: flex; | ||
align-items: baseline; | ||
justify-content: space-between; | ||
width: 100%; | ||
margin: var(--size-4) 0; | ||
} | ||
|
||
h1 { | ||
display: flex; | ||
gap: .15em; | ||
align-items: center; | ||
margin: 0; | ||
} | ||
|
||
.pbw-logo { | ||
height: var(--size-7); | ||
} | ||
|
||
.github-link { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.github-icon { | ||
fill: var(--color-5); | ||
|
||
&:hover { | ||
fill: var(--color-2); | ||
} | ||
} | ||
|
||
.header-end { | ||
display: flex; | ||
align-items: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters