From 67201978bb21ef7875ee4b145937f381661efb7d Mon Sep 17 00:00:00 2001 From: daudix Date: Sun, 21 Jul 2024 19:59:23 +0300 Subject: [PATCH] Fix broken code blocks with complex settings (again) Additionally, utilize `unset` instead of transparent in more places --- content/demo/index.md | 9 ++------- sass/_buttons.scss | 2 +- sass/_code.scss | 40 ++++++++++++++++++++++------------------ sass/_comments.scss | 4 ++-- sass/_nav.scss | 2 +- sass/_pre-container.scss | 2 +- sass/_table.scss | 20 ++++++-------------- sass/_typography.scss | 4 ++-- 8 files changed, 37 insertions(+), 46 deletions(-) diff --git a/content/demo/index.md b/content/demo/index.md index a746141..6917e80 100644 --- a/content/demo/index.md +++ b/content/demo/index.md @@ -72,19 +72,14 @@ let highlight = true; ```scss, linenos, linenostart=10, hl_lines=3-4 8-9, hide_lines=2 7 pre mark { - + // If you want your highlights to take the full width display: block; - color: currentcolor; - } - pre table td:nth-of-type(1) { - + // Select a colour matching your theme color: #6b6b6b; - font-style: italic; - } ``` diff --git a/sass/_buttons.scss b/sass/_buttons.scss index ddbe21a..6ee2df0 100644 --- a/sass/_buttons.scss +++ b/sass/_buttons.scss @@ -34,7 +34,7 @@ &.colored { box-shadow: none; - background-color: transparent; + background-color: unset; color: var(--primary-color); &:hover { diff --git a/sass/_code.scss b/sass/_code.scss index bb16ad1..be16569 100644 --- a/sass/_code.scss +++ b/sass/_code.scss @@ -24,9 +24,28 @@ pre { overflow: auto; line-height: normal; - table td { - border: none; - padding: 0; + table { + box-shadow: none; + border-radius: 0; + background-color: unset; + table-layout: auto; + overflow: hidden; + + tr { + &:nth-child(even) { + background-color: unset; + } + + th, + td { + padding: 0; + } + + th { + background-color: unset; + font-weight: normal; + } + } } // The line number cells @@ -46,21 +65,6 @@ pre { color: var(--fg-color); // Unset mark color from primary color to text color } - table { - box-shadow: none; - border-radius: 0; - border-collapse: collapse; - width: 100%; - table-layout: auto; - overflow: auto; - - tr { - &:nth-child(even) { - background-color: unset; - } - } - } - // The line numbers already provide some kind of left/right padding &[data-linenos] { padding: 1rem 0; diff --git a/sass/_comments.scss b/sass/_comments.scss index 8756604..c6e3a69 100644 --- a/sass/_comments.scss +++ b/sass/_comments.scss @@ -101,7 +101,7 @@ &.op { box-shadow: none; - background-color: transparent; + background-color: unset; color: var(--primary-color); &:hover { @@ -162,7 +162,7 @@ .faves { transition: var(--transition); border-radius: 999px; - background-color: transparent; + background-color: unset; padding: 0.25rem 0.75rem; font-variant-numeric: tabular-nums; text-decoration: none; diff --git a/sass/_nav.scss b/sass/_nav.scss index 3467d4b..f3a2792 100644 --- a/sass/_nav.scss +++ b/sass/_nav.scss @@ -156,7 +156,7 @@ cursor: pointer; border: none; border-radius: 999px; - background-color: transparent; + background-color: unset; font-weight: bold; font-size: 1rem; diff --git a/sass/_pre-container.scss b/sass/_pre-container.scss index addad43..b6698cb 100644 --- a/sass/_pre-container.scss +++ b/sass/_pre-container.scss @@ -26,7 +26,7 @@ cursor: pointer; border: none; border-radius: var(--rounded-corner-small); - background-color: transparent; + background-color: unset; padding: 0.5rem; line-height: 0; diff --git a/sass/_table.scss b/sass/_table.scss index f952d89..811dba2 100644 --- a/sass/_table.scss +++ b/sass/_table.scss @@ -8,27 +8,19 @@ table { table-layout: fixed; overflow: hidden; - th { - font-weight: bold; - } - - th, - td { - padding: 0.5rem 1rem; - } - tr { &:nth-child(even) { background-color: var(--fg-muted-1); } + th, + td { + padding: 0.5rem 1rem; + } + th { background-color: var(--fg-muted-2); + font-weight: bold; } } } - -td, -th { - padding: 0; -} diff --git a/sass/_typography.scss b/sass/_typography.scss index bd121df..35d46dc 100644 --- a/sass/_typography.scss +++ b/sass/_typography.scss @@ -115,11 +115,11 @@ progress { } &:indeterminate::-moz-progress-bar { - background-color: transparent; + background-color: unset; } &::-webkit-progress-bar { - background-color: transparent; + background-color: unset; } &::-moz-progress-bar {