Skip to content

Commit 6676291

Browse files
committed
Improve post styling - scrollable content, clickable links, professional formatting
1 parent 58f6e05 commit 6676291

3 files changed

Lines changed: 51 additions & 10 deletions

File tree

portfolio/static/all-posts.css

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,35 @@ ul {
5555
}
5656

5757
.post__content {
58-
padding: 1rem;
58+
padding: 0.75rem;
5959
text-align: center;
6060
width: 100%;
61+
flex: 1;
62+
overflow-y: auto;
63+
scrollbar-width: thin;
64+
scrollbar-color: #ccc transparent;
65+
}
66+
67+
.post__content::-webkit-scrollbar {
68+
width: 4px;
69+
}
70+
71+
.post__content::-webkit-scrollbar-thumb {
72+
background-color: #ccc;
73+
border-radius: 2px;
6174
}
6275

6376
.post__content h3 {
64-
font-size: 1.1rem;
77+
font-size: 1rem;
6578
font-weight: 600;
6679
color: #1a1a1a;
6780
margin: 0 0 0.5rem 0;
6881
line-height: 1.3;
6982
}
7083

7184
.post__content p {
72-
font-size: 0.9rem;
85+
font-size: 0.85rem;
7386
color: #4a4a4a;
7487
margin: 0;
7588
line-height: 1.4;
76-
overflow: hidden;
77-
text-overflow: ellipsis;
78-
display: -webkit-box;
79-
-webkit-line-clamp: 3;
80-
-webkit-box-orient: vertical;
8189
}

portfolio/static/post_details.css

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,42 @@ main {
100100
max-width: 90rem;
101101
margin: 3rem auto;
102102
background-color: white;
103-
padding: 1rem;
103+
padding: 2rem;
104104
border-radius: 12px;
105105
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
106+
font-size: 1.1rem;
107+
line-height: 1.8;
108+
color: #333;
109+
}
110+
111+
main p {
112+
margin-bottom: 1.5rem;
113+
}
114+
115+
main h1, main h2, main h3 {
116+
color: #1a1a1a;
117+
margin-top: 2rem;
118+
margin-bottom: 1rem;
119+
}
120+
121+
main ul, main ol {
122+
margin: 1rem 0 1.5rem 2rem;
123+
}
124+
125+
main li {
126+
margin-bottom: 0.5rem;
127+
}
128+
129+
main a {
130+
color: #390281;
131+
text-decoration: underline;
132+
}
133+
134+
main code {
135+
background-color: #f4f4f4;
136+
padding: 0.2rem 0.4rem;
137+
border-radius: 4px;
138+
font-family: monospace;
106139
}
107140

108141
.tag {

portfolio/templates/portfolio/post_details.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h2>{{post.title}}</h2>
5757
</article>
5858
</section>
5959
<main>
60-
{{post.content|safe}}
60+
{{post.content|urlize|linebreaks}}
6161
<br><br>
6262
<a href ="{% url 'posts' %}" class="center">Back to all posts</a>
6363
</main>

0 commit comments

Comments
 (0)