Skip to content

Commit dac9a1b

Browse files
authored
Merge pull request #12489 from quarto-dev/revert-6969-fix/mono-color-options
Revert "fix: header html tag for `monobackgroundcolor` + `monoforegroundcolor` option"
2 parents ca817b6 + d600536 commit dac9a1b

File tree

6 files changed

+12
-38
lines changed

6 files changed

+12
-38
lines changed

src/format/html/format-html-scss.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ function pandocVariablesToThemeDefaults(
481481
add(explicitVars, "font-family-base", metadata["mainfont"], asCssFont);
482482
add(explicitVars, "font-family-code", metadata["monofont"], asCssFont);
483483
add(explicitVars, "mono-background-color", metadata["monobackgroundcolor"]);
484-
add(explicitVars, "mono-foreground-color", metadata["monoforegroundcolor"]);
485484

486485
// Deal with sizes
487486
const explicitSizes = [

src/format/reveal/format-reveal-theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ function pandocVariablesToRevealDefaults(
278278
asCssNumber,
279279
);
280280
add(explicitVars, "code-block-bg", metadata["monobackgroundcolor"]);
281-
add(explicitVars, "code-block-color", metadata["monoforegroundcolor"]);
281+
282282
// Non-pandoc options from front matter
283283
add(explicitVars, "code-block-height", metadata[kCodeBlockHeight]);
284284
return explicitVars;

src/resources/formats/html/bootstrap/_bootstrap-rules.scss

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,16 @@ pre {
919919

920920
// Maps the pandoc 'monobackgroundcolor' to bootstrap
921921
// Note this only targets code outside of sourceCode blocks
922+
@if variable-exists(mono-background-color) {
923+
p code:not(.sourceCode),
924+
li code:not(.sourceCode),
925+
kbd,
926+
pre:not(.sourceCode),
927+
samp {
928+
background-color: $mono-background-color;
929+
padding: 0.2em;
930+
}
931+
}
922932

923933
p pre code:not(.sourceCode),
924934
li pre code:not(.sourceCode),
@@ -927,38 +937,21 @@ pre code:not(.sourceCode) {
927937
}
928938

929939
// Default padding if background is set
930-
h1 code:not(.sourceCode),
931-
h2 code:not(.sourceCode),
932-
h3 code:not(.sourceCode),
933-
h4 code:not(.sourceCode),
934-
h5 code:not(.sourceCode),
935-
h6 code:not(.sourceCode),
936940
p code:not(.sourceCode),
937941
li code:not(.sourceCode),
938-
td code:not(.sourceCode),
939-
kbd,
940-
pre:not(.sourceCode),
941-
samp {
942+
td code:not(.sourceCode) {
942943
@if variable-exists(mono-background-color) {
943944
background-color: $mono-background-color;
944945
} @else if variable-exists(code-bg) {
945946
background-color: $code-bg;
946947
}
947948

948-
@if variable-exists(mono-foreground-color) {
949-
color: $mono-foreground-color;
950-
} @else if variable-exists(code-color) {
951-
color: $code-color;
952-
}
953-
954949
@if variable-exists(code-padding) {
955950
padding: $code-padding;
956951
} @else if variable-exists(code-bg) {
957952
padding: 0.2em;
958953
} @else if variable-exists(mono-background-color) {
959954
padding: 0.2em;
960-
} @else if variable-exists(mono-foreground-color) {
961-
padding: 0.2em;
962955
}
963956
}
964957

src/resources/formats/html/pandoc/html.styles

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ code {
107107
$if(monobackgroundcolor)$
108108
background-color: $monobackgroundcolor$;
109109
padding: .2em .4em;
110-
$endif$
111-
$if(monoforegroundcolor)$
112-
color: $monoforegroundcolor$;
113110
$endif$
114111
font-size: 85%;
115112
margin: 0;
@@ -120,9 +117,6 @@ pre {
120117
$if(monobackgroundcolor)$
121118
background-color: $monobackgroundcolor$;
122119
padding: 1em;
123-
$endif$
124-
$if(monoforegroundcolor)$
125-
color: $monoforegroundcolor$;
126120
$endif$
127121
overflow: auto;
128122
}

src/resources/formats/html/pandoc/styles.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@
119119
$if(monobackgroundcolor)$
120120
background-color: $monobackgroundcolor$;
121121
padding: .2em .4em;
122-
$endif$
123-
$if(monoforegroundcolor)$
124-
color: $monoforegroundcolor$;
125122
$endif$
126123
font-size: 85%;
127124
margin: 0;
@@ -132,9 +129,6 @@
132129
$if(monobackgroundcolor)$
133130
background-color: $monobackgroundcolor$;
134131
padding: 1em;
135-
$endif$
136-
$if(monoforegroundcolor)$
137-
color: $monoforegroundcolor$;
138132
$endif$
139133
overflow: auto;
140134
}

src/resources/schema/document-colors.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@
2626
formats: [html, html4, html5, slidy, slideous, s5, dzslides]
2727
description: Sets the CSS `background-color` property on code elements and adds extra padding.
2828

29-
- name: monoforegroundcolor
30-
schema: string
31-
tags:
32-
formats: [html, html4, html5, slidy, slideous, s5, dzslides]
33-
description: Sets the CSS `color` property on code elements and adds extra padding.
34-
3529
- name: backgroundcolor
3630
schema: string
3731
tags:

0 commit comments

Comments
 (0)