-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update page and split view components to support docking conten…
…t to the available viewport (#688)
- Loading branch information
1 parent
9b53409
commit 158b262
Showing
87 changed files
with
1,584 additions
and
282 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,13 +1,20 @@ | ||
import { Component } from '@angular/core'; | ||
import { Router } from '@angular/router'; | ||
import { SkyAppViewportService } from '@skyux/theme'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.scss'], | ||
}) | ||
export class AppComponent { | ||
title = 'code-examples'; | ||
public height = 60; | ||
|
||
constructor(public router: Router) {} | ||
constructor(public router: Router, viewportSvc: SkyAppViewportService) { | ||
viewportSvc.reserveSpace({ | ||
id: 'controls', | ||
position: 'top', | ||
size: this.height, | ||
}); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
apps/code-examples/src/app/code-examples/layout/page/layout-fit/page-demo.component.html
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,33 @@ | ||
<sky-page layout="fit"> | ||
<div class="layout-fit-demo"> | ||
<div class="layout-fit-demo-header"> | ||
<sky-fluid-grid> | ||
<sky-row> | ||
<sky-column> | ||
<h1>Fit layout demo</h1> | ||
</sky-column> | ||
</sky-row> | ||
<sky-row> | ||
<sky-column> | ||
<p class="sky-margin-stacked-xl"> | ||
Elements in a page with a layout of "fit" can be absolutely | ||
positioned inside it. This is especially powerful when combined | ||
with content that uses | ||
<a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox" | ||
>CSS flexbox</a | ||
>. This example uses flexbox to display a header with a variable | ||
height and content that fills the rest of the available viewport. | ||
</p> | ||
</sky-column> | ||
</sky-row> | ||
</sky-fluid-grid> | ||
</div> | ||
<div class="layout-fit-demo-content"> | ||
<div class="anchored-item anchored-item-left">Left</div> | ||
<div class="anchored-item anchored-item-top">Top</div> | ||
<div class="anchored-item anchored-item-right">Right</div> | ||
<div class="anchored-item anchored-item-bottom">Bottom</div> | ||
<div class="anchored-item anchored-item-center">Center</div> | ||
</div> | ||
</div> | ||
</sky-page> |
49 changes: 49 additions & 0 deletions
49
apps/code-examples/src/app/code-examples/layout/page/layout-fit/page-demo.component.scss
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,49 @@ | ||
.layout-fit-demo { | ||
display: flex; | ||
flex-direction: column; | ||
position: absolute; | ||
left: 0; | ||
top: 0; | ||
right: 0; | ||
bottom: 0; | ||
|
||
&-header { | ||
flex-grow: 0; | ||
} | ||
|
||
&-content { | ||
background-color: var(--sky-background-color-info-light); | ||
flex-grow: 1; | ||
position: relative; | ||
} | ||
} | ||
|
||
.anchored-item { | ||
position: absolute; | ||
padding: var(--sky-padding-even-md); | ||
|
||
&-left { | ||
left: 0; | ||
top: 50%; | ||
} | ||
|
||
&-top { | ||
top: 0; | ||
left: 50%; | ||
} | ||
|
||
&-right { | ||
top: 50%; | ||
right: 0; | ||
} | ||
|
||
&-bottom { | ||
bottom: 0; | ||
left: 50%; | ||
} | ||
|
||
&-center { | ||
top: 50%; | ||
left: 50%; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
apps/code-examples/src/app/code-examples/layout/page/layout-fit/page-demo.component.ts
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,8 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-page-demo', | ||
templateUrl: './page-demo.component.html', | ||
styleUrls: ['./page-demo.component.scss'], | ||
}) | ||
export class PageDemoComponent {} |
12 changes: 12 additions & 0 deletions
12
apps/code-examples/src/app/code-examples/layout/page/layout-fit/page-demo.module.ts
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,12 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { SkyFluidGridModule, SkyPageModule } from '@skyux/layout'; | ||
|
||
import { PageDemoComponent } from './page-demo.component'; | ||
|
||
@NgModule({ | ||
declarations: [PageDemoComponent], | ||
imports: [CommonModule, SkyFluidGridModule, SkyPageModule], | ||
exports: [PageDemoComponent], | ||
}) | ||
export class PageDemoModule {} |
Oops, something went wrong.