From 41c3033d1ac6b9596ce3ae861484e855b619705a Mon Sep 17 00:00:00 2001 From: Jimmy Cai Date: Tue, 15 Aug 2023 13:15:32 +0200 Subject: [PATCH] feat(article): add style to `` tag (#862) * fix: set `unsafe` to true for exampleSite To display `` tag correctly * feat(article): add style to `kbd` tag * feat: improve `` style --- assets/scss/partials/layout/article.scss | 10 ++++++++++ assets/scss/variables.scss | 2 ++ exampleSite/config.yaml | 2 +- exampleSite/content/post/markdown-syntax/index.md | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/assets/scss/partials/layout/article.scss b/assets/scss/partials/layout/article.scss index e030b4d..73757e4 100644 --- a/assets/scss/partials/layout/article.scss +++ b/assets/scss/partials/layout/article.scss @@ -423,4 +423,14 @@ overflow-x: auto; overflow-y: hidden; } + + kbd { + border: 1px solid var(--kbd-border-color); + font-weight: bold; + font-size: 0.9em; + line-height: 1; + padding: 2px 4px; + border-radius: 4px; + display: inline-block; + } } diff --git a/assets/scss/variables.scss b/assets/scss/variables.scss index 47b7978..6709f0c 100644 --- a/assets/scss/variables.scss +++ b/assets/scss/variables.scss @@ -123,6 +123,8 @@ $defaultTagColors: #fff, #fff, #fff, #fff, #fff; --table-border-color: #dadada; --tr-even-background-color: #efefee; + --kbd-border-color: #dadada; + &[data-scheme="dark"] { --code-background-color: #272822; --code-text-color: rgba(255, 255, 255, 0.9); diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 80f3bf0..b723dea 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -228,7 +228,7 @@ markup: goldmark: renderer: ## Set to true if you have HTML content inside Markdown - unsafe: false + unsafe: true tableOfContents: endLevel: 4 ordered: true diff --git a/exampleSite/content/post/markdown-syntax/index.md b/exampleSite/content/post/markdown-syntax/index.md index 0254cca..c584c4c 100644 --- a/exampleSite/content/post/markdown-syntax/index.md +++ b/exampleSite/content/post/markdown-syntax/index.md @@ -159,7 +159,7 @@ H2O Xn + Yn = Zn -Press CTRL+ALT+Delete to end the session. +Press CTRL + ALT + Delete to end the session. Most salamanders are nocturnal, and hunt for insects, worms, and other small creatures.