From 619618e50f9c8d1b24a537dea35a7b767652e0db Mon Sep 17 00:00:00 2001 From: Aadarsha Acharya Date: Mon, 29 Apr 2024 01:29:24 +0545 Subject: [PATCH] style: blog makeup --- src/app/global.css | 24 +++++++++++++++++++++--- src/content/format-nestjs-response.mdx | 3 ++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/app/global.css b/src/app/global.css index 5f4b6d4..a9b52a3 100644 --- a/src/app/global.css +++ b/src/app/global.css @@ -42,16 +42,24 @@ } .prose pre { - @apply border border-neutral-800 bg-neutral-900; + @apply bg-neutral-50 dark:bg-neutral-900 rounded-lg overflow-x-auto border border-neutral-200 dark:border-neutral-900; } .prose code { - @apply rounded-lg border border-neutral-100 bg-neutral-100 px-1 py-0.5 text-neutral-800 dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-200; + /* @apply rounded-lg border border-neutral-100 bg-neutral-100 px-1 py-0.5 text-neutral-800 dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-200; */ + + @apply px-1 py-0.5 rounded-lg; + } .prose pre code { @apply p-0 text-neutral-800 dark:text-neutral-200; border: initial; + line-height: 1.5; +} + +.prose code span { + @apply font-medium; } .prose img { @@ -59,6 +67,16 @@ @apply m-0; } +.prose h2, +h3, +h4 { + @apply font-medium tracking-tighter !important; +} + +.prose strong { + @apply font-medium; +} + .prose > :first-child { /* Override removing top margin, causing layout shift */ margin-top: 1.25em !important; @@ -89,7 +107,7 @@ input[type="email"] { .prose .tweet a { text-decoration: inherit; - font-weight: inherit; + font-weight: 500; } table { diff --git a/src/content/format-nestjs-response.mdx b/src/content/format-nestjs-response.mdx index 1acc53e..dc4bac5 100644 --- a/src/content/format-nestjs-response.mdx +++ b/src/content/format-nestjs-response.mdx @@ -66,8 +66,9 @@ The above response is more structured and contains metadata like status, path, m ## Format Nest.js Response using Interceptors It will be very cumbersome to format the response in every controller. It will be better if we can create a function that will format the response and we can use that function in every controller. -In Nest.js, [Interceptors](https://docs.nestjs.com/interceptors) are used to intercept the request and response lifecycle. They are used to modify the request and response objects. +> In Nest.js, [Interceptors](https://docs.nestjs.com/interceptors) are used to intercept the request and response lifecycle. +> They are used to modify the request and response objects.
Image from: [Nest.js Docs](https://docs.nestjs.com/interceptors)