Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update visual snapshots: feat(telekom-header): updated app shell, fixed position ;) #1546

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# scale-shell



<!-- Auto Generated Below -->


## Properties

| Property | Attribute | Description | Type | Default |
| -------- | --------- | ------------------------------ | -------- | ----------- |
| `styles` | `styles` | (optional) Injected CSS styles | `string` | `undefined` |


## Shadow Parts

| Part | Description |
| ----------- | ----------- |
| `"base"` | |
| `"content"` | |


----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* @license
* Scale https://github.com/telekom/scale
*
* Copyright (c) 2021 Egor Kirpichev and contributors, Deutsche Telekom AG
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

:host {
--background: var(--telekom-color-background-canvas, #fff);
--spacing-x: 0;
--min-height: 100vh;
}

[part~='base'] {
display: flex;
min-height: var(--min-height);
flex-direction: column;
}

[part~='content'] {
box-sizing: border-box;
align-self: center;
width: 100%;
background: var(--background);
padding-left: var(--spacing-x);
padding-right: var(--spacing-x);
flex: 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* @license
* Scale https://github.com/telekom/scale
*
* Copyright (c) 2021 Egor Kirpichev and contributors, Deutsche Telekom AG
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/

import { Component, h, Prop, Host, Element } from '@stencil/core';
import { HTMLStencilElement } from '@stencil/core/internal';

@Component({
tag: 'scale-telekom-app-shell',
styleUrl: 'telekom-app-shell.css',
shadow: true,
})
export class Shell {
@Element() hostElement: HTMLStencilElement;

/** (optional) Injected CSS styles */
@Prop() styles?: string;

render() {
return (
<Host>
{this.styles && <style>{this.styles}</style>}

<div part="base">
<slot name="header"></slot>
<main part="content">
<slot></slot>
</main>
<slot name="footer"></slot>
</div>
</Host>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
| `"bottom-bar"` | |
| `"bottom-body"` | |
| `"container"` | |
| `"fixed-wrapper"` | |
| `"top-app-name"` | |
| `"top-bar"` | |
| `"top-body"` | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,15 @@ slot[name='functions'] {

[part~='base'] {
height: var(--_height);
background-color: var(--background);
box-shadow: var(--shadow);
width: 100%;
}

[part~='fixed-wrapper'] {
position: fixed;
top: 0;
z-index: 99;
width: 100%;
background-color: var(--background);
box-shadow: var(--shadow);
transition: height var(--telekom-motion-duration-immediate)
var(--telekom-motion-easing-standard);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,55 +55,57 @@ export class TelekomHeader {
'scrolled-back': this.scrolledBack,
})}
>
<div part="container">
<slot name="logo">
<scale-logo part="app-logo" variant="white"></scale-logo>
</slot>
<div part="fixed-wrapper">
<div part="container">
<slot name="logo">
<scale-logo part="app-logo" variant="white"></scale-logo>
</slot>

<div part="body">
<div part="top-bar">
{this.appName ? (
<div part="top-app-name">
{this.appNameLink ? (
<a
part="app-name-text"
onClick={this.appNameClick}
href={this.appNameLink}
>
{this.appName}
</a>
) : (
<span part="app-name-text">{this.appName}</span>
)}
</div>
) : null}
<div part="body">
<div part="top-bar">
{this.appName ? (
<div part="top-app-name">
{this.appNameLink ? (
<a
part="app-name-text"
onClick={this.appNameClick}
href={this.appNameLink}
>
{this.appName}
</a>
) : (
<span part="app-name-text">{this.appName}</span>
)}
</div>
) : null}

<div part="top-body">
<slot name="meta-nav-external"></slot>
<slot name="meta-nav"></slot>
<slot name="lang-switcher"></slot>
<div part="top-body">
<slot name="meta-nav-external"></slot>
<slot name="meta-nav"></slot>
<slot name="lang-switcher"></slot>
</div>
</div>
</div>

<div part="bottom-bar">
{this.appName ? (
<div part="bottom-app-name">
{this.appNameLink ? (
<a
part="app-name-text"
onClick={this.appNameClick}
href={this.appNameLink}
>
{this.appName}
</a>
) : (
<span part="app-name-text">{this.appName}</span>
)}
<div part="bottom-bar">
{this.appName ? (
<div part="bottom-app-name">
{this.appNameLink ? (
<a
part="app-name-text"
onClick={this.appNameClick}
href={this.appNameLink}
>
{this.appName}
</a>
) : (
<span part="app-name-text">{this.appName}</span>
)}
</div>
) : null}
<div part="bottom-body">
<slot name="main-nav"></slot>
<slot name="functions"></slot>
</div>
) : null}
<div part="bottom-body">
<slot name="main-nav"></slot>
<slot name="functions"></slot>
</div>
</div>
</div>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.