Skip to content

Commit f537325

Browse files
committed
style: improve layout with fixed header and footer
- Add flexbox layout to keep footer at bottom of page - Make header and footer fixed, only content area scrolls - Add Gemfile for Jekyll dependencies - Set proper min-height and overflow for scrollable content
1 parent 951ed22 commit f537325

2 files changed

Lines changed: 26 additions & 2 deletions

File tree

Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source "https://rubygems.org"
2+
3+
gem "jekyll", "~> 4.3"
4+
gem "webrick", "~> 1.8"
5+
gem "jekyll-relative-links"
6+
gem "jekyll-toc"

assets/css/style.css

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,28 @@
22
box-sizing: border-box;
33
}
44

5+
html, body {
6+
height: 100%;
7+
margin: 0;
8+
padding: 0;
9+
}
10+
511
body {
612
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
713
line-height: 1.6;
814
color: #24292e;
9-
margin: 0;
10-
padding: 0;
1115
background-color: #f6f8fa;
16+
display: flex;
17+
flex-direction: column;
1218
}
1319

1420
.wrapper {
1521
max-width: 1200px;
1622
margin: 0 auto;
1723
padding: 0 16px;
24+
flex: 1;
25+
display: flex;
26+
flex-direction: column;
1827
}
1928

2029
.site-header {
@@ -49,16 +58,23 @@ body {
4958

5059
.page-content {
5160
padding: 32px 0;
61+
flex: 1;
62+
display: flex;
63+
flex-direction: column;
5264
}
5365

5466
.page-content .wrapper {
5567
display: flex;
5668
gap: 32px;
69+
flex: 1;
70+
min-height: 0;
5771
}
5872

5973
.sidebar {
6074
width: 260px;
6175
flex-shrink: 0;
76+
overflow-y: auto;
77+
max-height: calc(100vh - 200px);
6278
}
6379

6480
.content {
@@ -68,6 +84,8 @@ body {
6884
padding: 24px;
6985
border-radius: 6px;
7086
box-shadow: 0 1px 3px rgba(0,0,0,0.12);
87+
overflow-y: auto;
88+
max-height: calc(100vh - 200px);
7189
}
7290

7391
.content h1 {

0 commit comments

Comments
 (0)