Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(viewport-panes): add viewport-pane component
This gives us the ability to add a class to the top pane of the layout and have it scale based on the size of the viewport's height. [Finishes: #113681439] BREAKING CHANGE: Adds variables that will affect the header as well
- Loading branch information
1 parent
07ca050
commit 83cc78e
Showing
6 changed files
with
95 additions
and
6 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 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,8 @@ | ||
```html | ||
<div class="pane bg-dark-2 viewport-pane"> | ||
<div class="container bg-glow"> | ||
<h1 class="type-neutral-11">This is a viewport pane</h1> | ||
</div> | ||
</div> | ||
|
||
``` |
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,9 @@ | ||
{ | ||
"homepage": "http://styleguide.pivotal.io/layout.html#pane", | ||
"dependencies": { | ||
"@npmcorp/pui-css-bootstrap": "2.0.0", | ||
"@npmcorp/pui-css-panes": "2.0.0", | ||
"@npmcorp/pui-css-header": "2.0.0" | ||
}, | ||
"version": "1.0.0" | ||
} |
63 changes: 63 additions & 0 deletions
63
src/pivotal-ui/components/viewport-panes/viewport-panes.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,63 @@ | ||
@import "../pui-variables"; | ||
|
||
/*doc | ||
--- | ||
title: Viewport Pane | ||
name: viewport_pane | ||
categories: | ||
- css_utilities_panes | ||
- css_all | ||
--- | ||
<code class="pam"> | ||
<i class="fa fa-download" alt="Install the Component"> | ||
npm install @npmcorp/pui-css-viewport-panes --save | ||
</i> | ||
</code> | ||
Viewport panes are type of [pane](/pane.html) that have a height that is based upon | ||
the height of your viewport. | ||
You can add the `.viewport-pane` class to the top pane of a layout. | ||
```html_example | ||
<header> | ||
<h1>This is the header</h1> | ||
</header> | ||
<div class="pane bg-dark-2 viewport-pane"> | ||
<div class="container bg-glow"> | ||
<h1 class="type-neutral-11">This is a pane</h1> | ||
</div> | ||
</div> | ||
``` | ||
When following a transparent header, the viewport-pane class will allow the pane's color | ||
to come through | ||
``` | ||
<header class="hero-transparent"> | ||
<h1>This is the header, you can see the pane below me, through this</h1> | ||
</header> | ||
<div class="pane bg-dark-2 viewport-pane"> | ||
<div class="container bg-glow"> | ||
<h1 class="type-neutral-11">This is a pane</h1> | ||
</div> | ||
</div> | ||
``` | ||
*/ | ||
|
||
.viewport-pane { | ||
height: calc(100vh - $header-height-max-sm); | ||
} | ||
|
||
.hero-transparent + .viewport-pane { | ||
box-sizing: content-box; | ||
} | ||
|
||
@media (min-width: $screen-sm-min) { | ||
.viewport-pane { | ||
height: calc(80vh - $header-height-max-lg); | ||
} | ||
} |