Skip to content

Commit

Permalink
fix: resolve padding issue for code blocks with filenames but without…
Browse files Browse the repository at this point in the history
… lang highlight (#297)

* fix: resolve padding issue for code blocks with filenames but without lang highlighting

* chore: run `npm run build:css`

* chore: update `node_modules/caniuse-lite`
  • Loading branch information
imfing authored Feb 17, 2024
1 parent 6bd2cfb commit 10907cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions assets/css/compiled/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -2186,6 +2186,10 @@ article details > summary::before {
--tw-text-opacity: 1;
color: rgb(229 231 235 / var(--tw-text-opacity));
}
.code-block .filename + pre:not(.lntable pre) {
/* Override padding for code blocks with filename but no highlight */
padding-top: 3rem;
}
.code-block pre:not(.lntable pre) {
margin-bottom: 1rem;
border-radius: 0.75rem;
Expand Down
5 changes: 5 additions & 0 deletions assets/css/highlight.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
.filename {
@apply absolute top-0 z-[1] w-full truncate rounded-t-xl bg-primary-700/5 py-2 px-4 text-xs text-gray-700 dark:bg-primary-300/10 dark:text-gray-200;
}

.filename + pre:not(.lntable pre) {
/* Override padding for code blocks with filename but no highlight */
@apply pt-12;
}
}

.code-block pre:not(.lntable pre) {
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 10907cd

Please sign in to comment.