-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Sticky header demo code #6033
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
Sticky header demo code #6033
Changes from 13 commits
da82a1f
52c6bce
96e6d0c
983b0f0
352f87b
a3c1845
7945a22
da06573
e43a250
e47492b
b9d8523
c15c808
d329aaa
3f88ac9
7caff97
1dc7439
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<div class="demo-sticky"> | ||
<div class="centered" cdk-scrollable> | ||
<div> | ||
<h1>Sticky-header Demo</h1> | ||
</div> | ||
|
||
<div class="container"> | ||
|
||
<div> | ||
<div cdkStickyHeader class="header-style header-color3" > | ||
<h2>Unread Messages</h2> | ||
</div> | ||
<P>Min: Branch is this weekend? </P> | ||
<P>Li: Yes</P> | ||
<P>Chan: Looking</P> | ||
<P>Chan: Forward</P> | ||
<P>Chan: To It !</P> | ||
<P>Min: Branch is this weekend?</P> | ||
<P>Li: Yes</P> | ||
<P>Eat: Green Peppers</P> | ||
<P>Chan: Where? </P> | ||
<P>Min: Branch is this weekend?</P> | ||
<P>Li: Yes</P> | ||
<P>Chan: Where?</P> | ||
<P>Eat: Green Peppers</P> | ||
</div> | ||
|
||
<div cdkStickyRegion > | ||
<div cdkStickyHeader class="header-style header-color2"> | ||
<h2>Late Messages</h2> | ||
</div> | ||
<P>Min: Branch is this weekend? </P> | ||
<P>Li: Yes</P> | ||
<P>Chan: Looking</P> | ||
<P>Chan: Forward</P> | ||
<P>Chan: To It !</P> | ||
<P>Min: Branch is this weekend?</P> | ||
<P>Li: Yes</P> | ||
<P>Eat: Green Peppers</P> | ||
<P>Chan: Where? </P> | ||
<P>Min: Branch is this weekend?</P> | ||
<P>Li: Yes</P> | ||
<P>Chan: Where?</P> | ||
<P>Eat: Green Peppers</P> | ||
<P>Min: Branch is this weekend? </P> | ||
<P>Li: Yes</P> | ||
</div> | ||
|
||
<div cdkStickyRegion> | ||
<div cdkStickyHeader class="header-style header-color1" > | ||
<h2>Read Messages</h2> | ||
</div> | ||
<P>Min: Branch is this weekend? </P> | ||
<P>Li: Yes</P> | ||
<P>Chan: Looking</P> | ||
<P>Chan: Forward</P> | ||
<P>Chan: To It !</P> | ||
<P>Min: Branch is this weekend?</P> | ||
<P>Li: Yes</P> | ||
<P>Eat: Green Peppers</P> | ||
<P>Chan: Where? </P> | ||
<P>Min: Branch is this weekend?</P> | ||
<P>Li: Yes</P> | ||
<P>Chan: Where?</P> | ||
<P>Eat: Green Peppers</P> | ||
<P>Min: Branch is this weekend? </P> | ||
<P>Li: Yes</P> | ||
<P>Min: Branch is this weekend? </P> | ||
<P>Li: Yes</P> | ||
<P>Chan: Looking</P> | ||
<P>Chan: Forward</P> | ||
<P>Chan: To It !</P> | ||
<P>Min: Branch is this weekend?</P> | ||
<P>Li: Yes</P> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
.demo-sticky { | ||
.centered { | ||
text-align: left; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
height: 500px; | ||
overflow: auto;} | ||
|
||
button { | ||
position: fixed; | ||
margin: 16px; | ||
z-index: 99; | ||
} | ||
|
||
* { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
|
||
body { | ||
font: 14px/1.5 Helvetica, Arial, sans-serif; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
|
||
} | ||
|
||
h1 { | ||
font-size: 20px; | ||
padding: 20px; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
} | ||
|
||
h2 { | ||
font-size: 20px; | ||
padding: 20px; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
} | ||
|
||
p { | ||
text-indent: 4em; | ||
margin-bottom: 1.5em; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 Cool! |
||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
} | ||
|
||
div{ | ||
margin: 0; border: 0; padding: 0; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
} | ||
} | ||
|
||
.mat-radio-button { | ||
display: block; | ||
} | ||
|
||
.centered { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefix demo classes with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 Added prefix |
||
text-align: center; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
appearance: none; | ||
height: 500px; | ||
overflow: auto;} | ||
|
||
.container { | ||
margin: 0; | ||
-webkit-appearance: none; | ||
-moz-appearance: none; | ||
} | ||
|
||
.header-style{ | ||
-webkit-appearance: none; | ||
padding: 20px; | ||
} | ||
|
||
.header-color1 { | ||
background: #cecece; | ||
} | ||
|
||
.header-color2 { | ||
background: #cea7a7; | ||
} | ||
|
||
.header-color3 { | ||
background: #c2eae5; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import {Component} from '@angular/core'; | ||
import {BrowserModule} from '@angular/platform-browser'; | ||
import {CdkStickyRegion, CdkStickyHeader} from '@angular/material'; | ||
|
||
|
||
@Component({ | ||
moduleId: module.id, | ||
selector: 'sticky-header-demo', | ||
templateUrl: 'sticky-header-demo.html', | ||
styleUrls: ['sticky-header-demo.css'], | ||
}) | ||
|
||
export class StickyHeaderDemo { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add this to the
navItems
indemo-app.ts
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Added to
navItems
indemo-app.ts