Skip to content

Commit 8d764e4

Browse files
committed
Improve styling Blog page for small screens. Make top navbar fixed.
1 parent 91698d7 commit 8d764e4

File tree

7 files changed

+60
-49
lines changed

7 files changed

+60
-49
lines changed

_layouts/blog.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717

1818
<div id="main" role="main">
1919

20-
<div class="row">
21-
{{ content }}
22-
</div>
20+
{{ content }}
2321

2422
</div><!-- /#main -->
2523

_sass/_bloghome.scss

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.blog-index-container {
2+
padding-top: 70px; /* Space for fixed navbar */
3+
4+
.container {
5+
max-width: 1200px;
6+
padding-left: 15px;
7+
padding-right: 15px;
8+
margin: 0 auto;
9+
}
10+
11+
.row {
12+
margin-left: -15px;
13+
margin-right: -15px;
14+
}
15+
16+
@media (max-width: 767.98px) {
17+
overflow-x: hidden;
18+
19+
.container {
20+
padding-left: 15px;
21+
padding-right: 15px;
22+
}
23+
24+
.col-12 {
25+
padding-left: 15px;
26+
padding-right: 15px;
27+
}
28+
}
29+
}

_sass/_nav_cleanblog.scss

+2-38
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
.navbar-custom {
1010
background: $navbar-bgcolor;
11-
position: absolute;
11+
position: fixed;
1212
top: 0;
1313
left: 0;
1414
width: 100%;
15-
z-index: 3;
15+
z-index: 1000;
1616
//.sans-serif;
1717
font-family: $heading-font;
1818
border-bottom: 1px solid transparent;
@@ -119,42 +119,6 @@
119119
transform: translate3d(0, 0, 0);
120120
-webkit-backface-visibility: hidden;
121121
backface-visibility: hidden;
122-
&.is-fixed {
123-
/* when the user scrolls down, we hide the header right above the viewport */
124-
position: fixed;
125-
top: -61px;
126-
background-color: $nav-bgcolor;
127-
border-bottom: 1px solid darken(white, 10%);
128-
-webkit-transition: -webkit-transform 0.3s;
129-
-moz-transition: -moz-transform 0.3s;
130-
transition: transform 0.3s;
131-
.navbar-brand {
132-
color: $nav-brand-fix-color;
133-
&:hover,
134-
&:focus {
135-
color: $nav-brand-fix-faded;
136-
}
137-
}
138-
.nav {
139-
li {
140-
a {
141-
color: $nav-fix-color;
142-
&:hover,
143-
&:focus {
144-
color: $nav-fix-faded;
145-
}
146-
}
147-
}
148-
}
149-
}
150-
&.is-visible {
151-
/* if the user changes the scrolling direction, we show the header */
152-
-webkit-transform: translate3d(0, 100%, 0);
153-
-moz-transform: translate3d(0, 100%, 0);
154-
-ms-transform: translate3d(0, 100%, 0);
155-
-o-transform: translate3d(0, 100%, 0);
156-
transform: translate3d(0, 100%, 0);
157-
}
158122
}
159123
}
160124

_sass/_page.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
body {
22
margin: 0;
3-
padding: $navbar-actual-height 0 0 0;
3+
padding-top: $navbar-actual-height;
44
width: 100%;
55
background-color: $body-color;
66
}

_sass/_sidebar.scss

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Sidebar specific styles
2+
.sidebar {
3+
.panel {
4+
padding: 0.5rem; // Reduced from 1.25rem
5+
6+
ul {
7+
padding-left: 0; // Remove default list padding
8+
margin-left: 0; // Remove default list margin
9+
10+
li {
11+
padding-left: 0.5rem; // Add minimal left padding for icons
12+
}
13+
}
14+
}
15+
}

_sass/_site.scss

+2
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,5 @@ b, i, strong, em, blockquote, p, q, span, figure, img, h1, h2, header, input {
204204

205205
// Import home page styles
206206
@import "home";
207+
@import "bloghome";
208+
@import "sidebar";

blog/index.html

+10-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@
77
header-img: images/blog.jpg
88
---
99

10-
<div class="row">
11-
<div class="medium-8 columns t30">
12-
{% include pagination.html %}
13-
</div>
14-
10+
<div class="blog-index-container">
11+
<div class="container">
12+
<div class="row">
13+
<div class="col-12 col-md-8 col-lg-9 t30">
14+
{% include pagination.html %}
15+
</div>
1516

16-
<div class="medium-4 columns t30">
17-
{% include sidebar.html %}
17+
<div class="col-12 col-md-4 col-lg-3 t30 d-none d-md-block">
18+
{% include sidebar.html %}
19+
</div>
20+
</div>
1821
</div>
1922
</div>

0 commit comments

Comments
 (0)