💄 Style: update code element style for headings and toc items

This commit is contained in:
ych817
2025-05-11 09:39:07 +12:00
committed by Cell
parent 6a1ed440df
commit 7788eded58
5 changed files with 27 additions and 23 deletions
+18
View File
@@ -63,6 +63,24 @@ img,video {
height: auto; height: auto;
} }
%code {
padding: 0.2em 0.4em;
margin: 0;
font-size: $code-font-size;
font-family: $code-font-family;
color: $code-color;
background-color: rgba(175, 184, 193, 0.2);
text-decoration: inherit;
@include border-radius($global-border-radius);
@include overflow-wrap(break-word);
@include line-break(auto);
[data-theme='dark'] & {
color: $code-color-dark;
background-color: rgba(99, 110, 123, 0.4);
}
}
@include link(true, true); @include link(true, true);
@import '../_partials/scrollbar'; @import '../_partials/scrollbar';
-5
View File
@@ -166,11 +166,6 @@
font-weight: bolder; font-weight: bolder;
} }
code {
padding: 0 .2em;
font-size: inherit;
}
&:hover, &:hover,
&:target { &:target {
> .heading-mark { > .heading-mark {
+3 -17
View File
@@ -1,20 +1,6 @@
// inline code // inline code
code { code {
padding: 0.2em 0.4em; @extend %code;
margin: 0;
font-size: $code-font-size;
font-family: $code-font-family;
color: $code-color;
background-color: rgba(175, 184, 193, 0.2);
text-decoration: inherit;
@include border-radius($global-border-radius);
@include overflow-wrap(break-word);
@include line-break(auto);
[data-theme='dark'] & {
color: $code-color-dark;
background-color: rgba(99, 110, 123, 0.4);
}
} }
// indented code // indented code
@@ -23,7 +9,7 @@ pre:not(.mermaid[data-processed='true']) {
line-height: 1.45em; line-height: 1.45em;
padding: 0.5rem; padding: 0.5rem;
overflow: auto; overflow: auto;
font-size: $code-font-size; font-size: $code-block-font-size;
font-family: $code-font-family; font-family: $code-font-family;
@include border-radius($global-border-radius); @include border-radius($global-border-radius);
@include tab-size(4); @include tab-size(4);
@@ -54,7 +40,7 @@ pre:not(.mermaid[data-processed='true']) {
.highlight, .highlight,
.gist { .gist {
font-size: $code-font-size; font-size: $code-block-font-size;
font-family: $code-font-family; font-family: $code-font-family;
.table-wrapper { .table-wrapper {
+4
View File
@@ -8,6 +8,10 @@
.toc-content { .toc-content {
font-size: $toc-content-font-size; font-size: $toc-content-font-size;
code {
@extend %code;
}
ul { ul {
text-indent: -0.8em; text-indent: -0.8em;
padding-left: 0.8em; padding-left: 0.8em;
+2 -1
View File
@@ -164,7 +164,8 @@ $code-info-color: #9c9c9c !default;
$code-info-color-dark: #b1b0b0 !default; $code-info-color-dark: #b1b0b0 !default;
// Font size of the code // Font size of the code
$code-font-size: 0.875rem !default; $code-font-size: 0.875em !default;
$code-block-font-size: 0.875rem !default;
// Font family of the code // Font family of the code
$code-font-family: Source Code Pro, Menlo, Consolas, Monaco, monospace, $global-font-family !default; $code-font-family: Source Code Pro, Menlo, Consolas, Monaco, monospace, $global-font-family !default;