Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also changed code block styles from dark to light. A dark theme would better suit a site-wide dark theme which I'm planning to implement some day.
Pros:
main.css
to the newCodeBlock.js
.```js/2,4-7,10
js/2,4-7,10
, so it doesn't format the code block```js 3,5-8,11
js
just fineCons:
Preact might seem like an overkill, but I'm planning to later replace Pug layouts with Preact layouts, so installing Preact and related libraries was inevitable. :thanos:
Btw I noticed that code block styles inside lists/quotes/etc. are broken in XS screen size. But they were broken even before this PR, so I'm going to fix them later (yeah, right 😅).
Screenshot from my latest blog post showing the indentation bug in the 11ty plugin:
I have previously circumvented this by adding extra leading spaces to those broken lines and added
<!-- prettier-ignore -->
before the code block so that Prettier won't remove the extra spaces when saving the Markdown file. Then the code block looks correct on my blog, but has the unnecessary extra spaces when copy-pasting the code elsewhere. Not always a problem, but is an actual problem when copy-pasting e.g. YAML code (which is whitespace-sensitive). 😬 Plus these workarounds are a hassle to maintain.