Skip to content

Commit 4bcc6be

Browse files
authored
improve blog post font (#2902)
1 parent a689eb4 commit 4bcc6be

6 files changed

Lines changed: 45 additions & 28 deletions

File tree

106 KB
Loading

resources/blog/posts/2025/2025-03-03-how-to-strangle-your-project-with-strangle-anti-pattern.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Let's say we have an old CakePHP, CodeIgniter, Yii, or plain PHP project and you
2222
In practice, it can look something like:
2323

2424
<div class="text-center mb-5">
25-
<img src="https://accesto.com/blog/static/d20bbd2696d22557b2048fb00c8fc598/3c492/code-refactoring.png" style="max-width: 30em" class="img-thumbnail">
25+
<img src="/assets/images/blog/2025/code-refactoring.png" class="img-thumbnail">
2626
<br>
2727
<small class="text-secondary">
2828
From <a href="https://accesto.com/blog/monolith-to-microservices/">Monolith to Microservices</a>

resources/css/app.scss

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,44 @@ h4 {
294294
.text-body {
295295
font-size: 1.1em;
296296
}
297+
298+
.perex {
299+
margin-top: 1em;
300+
margin-bottom: 1em;
301+
font-size: 1.4em;
302+
padding: .7em 0;
303+
}
304+
305+
.text-body {
306+
font-size: 1.2em;
307+
}
308+
309+
@media (max-width: 750px) {
310+
h1 {
311+
font-size: 1.5em;
312+
line-height: 1.5em;
313+
}
314+
315+
h2 {
316+
font-size: 1.2em;
317+
line-height: 1.4em;
318+
}
319+
320+
.perex {
321+
font-size: 1.1em;
322+
}
323+
324+
.text-body {
325+
font-size: 1.1em;
326+
}
327+
}
328+
}
329+
330+
#blog {
331+
h2 {
332+
font-size: 1.4em;
333+
}
334+
297335
}
298336

299337
#homepage {
@@ -451,17 +489,6 @@ label.required:before {
451489
h2 {
452490
margin-top: 1em;
453491
}
454-
455-
.perex {
456-
margin-top: 1em;
457-
margin-bottom: 1em;
458-
font-size: 1.4em;
459-
padding: .7em 0;
460-
}
461-
462-
.text-body {
463-
font-size: 1.2em;
464-
}
465492
}
466493

467494
#documentation {

resources/views/blog/blog.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
@section('main')
44
<div id="blog">
5-
<h1>{{ $page_title }}</h1>
5+
<h1 style="text-wrap: balance">{{ $page_title }}</h1>
66

77
@php /** @var \App\Entity\Post[] $posts */ @endphp
88

99
@foreach ($posts as $post)
1010
<div class="mb-4">
11-
<h2 style="font-size: 1.4em" class="mb-0">
11+
<h2 class="mb-0">
1212
<a href="{{ action(\App\Controller\Blog\PostController::class, [
1313
'postSlug' => $post->getSlug(),
1414
]) }}">

src/Controller/Blog/BlogController.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,11 @@
1010

1111
final class BlogController extends Controller
1212
{
13-
public function __construct(
14-
private readonly PostRepository $postRepository,
15-
) {
16-
}
17-
18-
public function __invoke(): View
13+
public function __invoke(PostRepository $postRepository): View
1914
{
2015
return \view('blog/blog', [
2116
'page_title' => 'Learn about Rector, Upgrades and Planning',
22-
'posts' => $this->postRepository->getPosts(),
17+
'posts' => $postRepository->getPosts(),
2318
]);
2419
}
2520
}

src/Controller/Blog/PostController.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,9 @@
1212

1313
final class PostController extends Controller
1414
{
15-
public function __construct(
16-
private readonly PostRepository $postRepository,
17-
) {
18-
}
19-
20-
public function __invoke(string $postSlug): View
15+
public function __invoke(string $postSlug, PostRepository $postRepository): View
2116
{
22-
$post = $this->postRepository->findBySlug($postSlug);
17+
$post = $postRepository->findBySlug($postSlug);
2318
if (! $post instanceof Post) {
2419
$message = sprintf("Post with slug '%s' not found", $postSlug);
2520
throw new NotFoundHttpException($message);

0 commit comments

Comments
 (0)