Skip to content

Commit

Permalink
fix(brand): Apply monospace-inline and monospace-block font family (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie authored Nov 7, 2024
1 parent 415ced0 commit a35f3a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED]

### Bug fixes

* Branded theming via `ui.Theme.from_brand()` now correctly applies monospace inline and block font family choices. (#1762)


## [1.2.0] - 2024-10-29
Expand Down
16 changes: 10 additions & 6 deletions shiny/ui/_theme_brand.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,10 @@ def _add_sass_ensure_variables(self):
"added variables",
**{
"code-font-weight": None,
"font-family-monospace-inline": None,
"code-inline-font-weight": None,
"code-inline-font-size": None,
"font-family-monospace-block": None,
"code-block-font-weight": None,
"code-block-font-size": None,
"code-block-line-height": None,
Expand Down Expand Up @@ -481,23 +483,25 @@ def _add_sass_brand_rules(self):
// *---- brand: brand rules to augment Bootstrap rules ----* //
// https://github.com/twbs/bootstrap/blob/5c2f2e7e/scss/_root.scss#L82
:root {
--#{$prefix}link-bg: #{$link-bg};
--#{$prefix}link-weight: #{$link-weight};
--#{$prefix}link-bg: #{$link-bg};
--#{$prefix}link-weight: #{$link-weight};
}
// https://github.com/twbs/bootstrap/blob/5c2f2e7e/scss/_reboot.scss#L244
a {
background-color: var(--#{$prefix}link-bg);
font-weight: var(--#{$prefix}link-weight);
background-color: var(--#{$prefix}link-bg);
font-weight: var(--#{$prefix}link-weight);
}
code {
font-weight: $code-font-weight;
font-weight: $code-font-weight;
}
code {
code:not(pre > code) {
font-family: $font-family-monospace-inline;
font-weight: $code-inline-font-weight;
font-size: $code-inline-font-size;
}
// https://github.com/twbs/bootstrap/blob/30e01525/scss/_reboot.scss#L287
pre {
font-family: $font-family-monospace-block;
font-weight: $code-block-font-weight;
font-size: $code-block-font-size;
line-height: $code-block-line-height;
Expand Down

0 comments on commit a35f3a8

Please sign in to comment.