Skip to content

default background and foreground for inline code in dark mode #13182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion news/changelog-1.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ All changes included in 1.8:
- ([#726](https://github.com/quarto-dev/quarto-cli/issues/726)): a11y - Provide `.screen-reader-only` callout type when callout text doesn't naturally include the type.
- ([#5538](https://github.com/quarto-dev/quarto-cli/issues/5538)): Fix code-copy button style so that scrolling behaves properly.
- ([#5879](https://github.com/quarto-dev/quarto-cli/issues/5879)): Improve font rendering of `kbd` shortcode on macOS. `kbd` will now also be stricter in converting keyboard shortcuts to macOS icons.
- ([#8568](https://github.com/quarto-dev/quarto-cli/issues/8568)) Default inline code background color is the same as default code block background color; foreground color is `$pre-color` in dark mode and (remains) purple in light mode.
- ([#10983](https://github.com/quarto-dev/quarto-cli/issues/10983)): Fix spacing inconsistency between paras and first section headings.
- ([#12259](https://github.com/quarto-dev/quarto-cli/issues/12259)): Fix conflict between `html-math-method: katex` and crossref popups (author: @benkeks).
- ([#12341](https://github.com/quarto-dev/quarto-cli/issues/12341)): Enable light and dark logos for html formats (sidebar, navbar, dashboard).
Expand Down Expand Up @@ -101,7 +102,7 @@ All changes included in 1.8:

- ([#12753](https://github.com/quarto-dev/quarto-cli/issues/12753)): Support change in IPython 9+ and import `set_matplotlib_formats` from `matplotlib_inline.backend_inline` in the internal `setup.py` script used to initialize rendering with Jupyter engine.
- ([#12839](https://github.com/quarto-dev/quarto-cli/issues/12839)): Support for `plotly.py` 6+ which now loads plotly.js using a cdn in script as a module.
- ([#13026](https://github.com/quarto-dev/quarto-cli/pulls/13026), [#13151](https://github.com/quarto-dev/quarto-cli/pulls/13151)): Use `jsdelivr` CDN for jupyter widgets dependencies.
- ([#13026](https://github.com/quarto-dev/quarto-cli/pulls/13026), [#13151](https://github.com/quarto-dev/quarto-cli/pulls/13151)): Use `jsdelivr` CDN for jupyter widgets dependencies.

### `knitr`

Expand Down
32 changes: 21 additions & 11 deletions src/resources/formats/html/bootstrap/_bootstrap-rules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -946,10 +946,20 @@ pre code:not(.sourceCode) {
p code:not(.sourceCode),
li code:not(.sourceCode),
td code:not(.sourceCode) {
$calculated-bg: if(
variable-exists(code-bg),
if(
$code-bg == $gray-100 and variable-exists(code-block-bg-color),
$code-block-bg-color,
$code-bg
),
null
);

@if variable-exists(mono-background-color) {
background-color: $mono-background-color;
} @else if variable-exists(code-bg) {
background-color: $code-bg;
} @else if variable-exists(calculated-bg) {
background-color: $calculated-bg;
}

@if variable-exists(code-padding) {
Expand Down Expand Up @@ -2197,12 +2207,12 @@ a {

// screen-reader-only, cf https://github.com/quarto-dev/quarto-cli/issues/726#issuecomment-1112486100
.screen-reader-only {
position: absolute;
clip: rect(0 0 0 0);
border: 0;
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
width: 1px;
}
position: absolute;
clip: rect(0 0 0 0);
border: 0;
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
width: 1px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ $code-block-theme-dark-threshhold: 40% !default;

/* Inline Code Formatting */
// $code-bg, $code-color, $code-padding
$code-color: #7d12ba !default;
$code-color: if(
variable-exists(pre-color) and $pre-color != null,
$pre-color,
#7d12ba
) !default;
// or $code-color: inherit !default;

// Set a default body emphasis color
$code-bg: $gray-100 !default;
Expand Down
Loading