Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
21 changes: 17 additions & 4 deletions src/core/sass/brand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,14 @@ const brandTypographyBundle = (
["family", "font-family-base"],
["size", "font-size-base"],
["line-height", "line-height-base"],
["weight", "font-weight-base"],

// revealjs
["family", "mainFont"],
["size", "presentation-font-size-root"],
["line-height", "presentation-line-height"],
// TBD?

// ["style", "font-style-base"],
// ["weight", "font-weight-base"],
],
Expand All @@ -351,6 +353,13 @@ const brandTypographyBundle = (
["family", "font-family-monospace"],
// bootstrap
["size", "code-font-size"],
// forward explicitly to both `code` and `pre`
// because that interacts less with the default bootstrap styles
["color", "code-color"],
["color", "pre-color"],

["weight", "font-weight-monospace"],

// revealjs
["size", "code-block-font-size"],
],
Expand All @@ -361,6 +370,8 @@ const brandTypographyBundle = (
["line-height", "pre-line-height"],
["color", "pre-color"],
["background-color", "pre-bg"],
["size", "code-block-font-size"],
["weight", "font-weight-monospace-block"],
// revealjs
["line-height", "code-block-line-height"],
["color", "code-block-color"],
Expand All @@ -373,18 +384,20 @@ const brandTypographyBundle = (
["background-color", "code-bg"],
// bootstrap
["size", "code-inline-font-size"],
["weight", "font-weight-monospace-inline"],
// revealjs
["size", "code-block-font-size"],
// ["size", "code-block-font-size"],
],
};

for (
const kind of [
"base",
"headings",
"monospace",
// more specific entries go first
"monospace-block",
"monospace-inline",
"monospace",
"headings",
"base",
]
) {
const fontInformation = resolveHTMLFontInformation(
Expand Down
18 changes: 18 additions & 0 deletions src/resources/formats/html/_quarto-rules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,24 @@ ul.task-list {
padding-left: 1em;
}

// override _reboot.scss

// code blocks
pre code {
font-family: $font-family-monospace-block;
// I'm really not confident that this is correct
@include font-size($code-block-font-size);
font-weight: $font-weight-monospace-block;
}

// code inlines
p code {
font-family: $font-family-monospace-inline;
// I'm really not confident that this is correct
@include font-size($code-inline-font-size);
font-weight: $font-weight-monospace-inline;
}

// tippy

[data-tippy-root] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,8 @@ $font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberati
// stylelint-enable value-keyword-case
$font-family-base: $font-family-sans-serif !default;
$font-family-code: $font-family-monospace !default;
$font-family-monospace-block: $font-family-monospace !default;
$font-family-monospace-inline: $font-family-monospace !default;

// $font-size-root affects the value of `rem`, which is used for as well font sizes, paddings, and margins
// $font-size-base affects the font size of the body text
Expand All @@ -633,6 +635,9 @@ $font-weight-bold: 700 !default;
$font-weight-bolder: bolder !default;

$font-weight-base: $font-weight-normal !default;
$font-weight-monospace: $font-weight-base !default;
$font-weight-monospace-block: $font-weight-monospace !default;
$font-weight-monospace-inline: $font-weight-monospace !default;

$line-height-base: 1.5 !default;
$line-height-sm: 1.25 !default;
Expand Down Expand Up @@ -1758,6 +1763,8 @@ $offcanvas-backdrop-opacity: $modal-backdrop-opacity !default;
// Code

$code-font-size: $small-font-size !default;
$code-block-font-size: $code-font-size !default;
$code-inline-font-size: $code-font-size !default;
// Amount intentionally matches mixture amount of shiny::inputPanel()
// https://github.com/rstudio/shiny/blob/4eeb4a1/inst/www/shared/shiny_scss/bootstrap.scss#L25
$code-bg: $body-emphasis-color !default;
Expand Down
Loading