Skip to content

Commit e5f7c3a

Browse files
committed
tut_spa: ensure whole page does not scroll
1 parent 56e89d6 commit e5f7c3a

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

  • tutorial/single_page_book_app/resources_singlepage

tutorial/single_page_book_app/resources_singlepage/style.css

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
/* ==========================
22
Global Styles
33
========================== */
4-
html, body {
4+
html,
5+
body {
56
height: 100%;
67
margin: 0;
78
padding: 0;
8-
overflow: hidden; /* Prevent overall page scrolling */
9+
overflow: hidden; /* no page-level scrollbars */
910
}
1011

1112
body {
1213
display: flex;
1314
flex-direction: column;
1415
font-family: Arial, sans-serif;
15-
font-size: 14px;
16-
line-height: 1.6;
17-
color: #333;
1816
}
1917

2018
/* ==========================
2119
Header and Buttons
2220
========================== */
2321
.main-header {
22+
flex-shrink: 0; /* Ensure header doesn't shrink */
23+
height: 3rem;
24+
background-color: #f9f9f9;
25+
border-bottom: 1px solid #ccc;
26+
padding: 0.5rem 1rem;
27+
2428
display: flex;
2529
justify-content: space-between;
2630
align-items: center;
27-
background-color: #f9f9f9;
2831
border-bottom: 1px solid #ccc;
29-
padding: 0.5rem 1rem;
3032
position: sticky;
3133
top: 0;
3234
z-index: 1000;
3335
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
34-
flex-shrink: 0; /* Ensure header doesn't shrink */
3536
}
3637

3738
#toggle-sidebar {
@@ -67,20 +68,21 @@ body {
6768
Layout Container
6869
========================== */
6970
.layout-container {
71+
flex: 1; /* fill the rest of the window below the header */
7072
display: grid;
71-
grid-template-columns: 200px auto 300px; /* Sidebar | Content | Canvas */
72-
grid-template-areas: "sidebar content canvas";
73+
grid-template-columns: 200px auto 300px; /* sidebar - content - breadcrumb */
74+
grid-template-areas: "sidebar content aside";
7375
gap: 1rem;
74-
height: calc(100% - 3rem); /* Remaining height after the header */
75-
overflow: hidden; /* Prevent scrolling of the layout itself */
76+
overflow: hidden; /* no scrolling for the container itself */
77+
/*height: calc(100% - 3rem); !* using flex:1 now *!*/
7678
}
7779

7880
/* ==========================
7981
Sidebar
8082
========================== */
8183
#toc-sidebar {
8284
grid-area: sidebar;
83-
background-color: #fff;
85+
background: white;
8486
border-right: 1px solid #ccc;
8587
padding: 1rem;
8688
overflow-y: auto; /* Sidebar scrolls independently */
@@ -158,6 +160,7 @@ body {
158160
padding: 1rem;
159161
height: 100%; /* Ensure it spans the full height of the container */
160162
box-sizing: border-box;
163+
background-color: #f9f9f9;
161164
}
162165

163166
#content-area {

0 commit comments

Comments
 (0)