Problem/Motivation
scss/_bootstrap-variables.scss line 35 sets $font-family-monospace to 'EB Garamond', 'Garamond', 'Times New Roman', 'Liberation Serif', 'Georgia', serif. That compiles to --bs-font-monospace, which Bootstrap applies in code, kbd, samp { font-family: var(--bs-font-monospace); }, so all genuine code markup renders in a proportional serif and loses its alignment. There is no real monospace stack anywhere in the theme, no SFMono, Menlo, Consolas or Courier.
The overload was deliberate. Bootstrap ships no $font-family-serif utility, and components/foundation/typography/typography.stories.twig used the resulting .font-monospace class to display the secondary typeface sample. So any fix has to keep that story working.
The Figma stylesheet defines only a heading font (Rubik) and a body font (EB Garamond) and says nothing about a monospace face, so nothing in the design calls for this. Everything else in the Figma foundation matches the theme correctly.
Steps to reproduce
- Build the theme front end on 1.0.x (verified at commit 566661c).
- Open any page or story containing
code,kbdorsampmarkup. - Inspect the computed font family: EB Garamond, a proportional serif, not a monospace face.
- The compiled CSS confirms it:
--bs-font-monospacecarries the serif stack.
Proposed resolution
$font-family-monospacebecomes a real stack:'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace.components/base/root/root.scssgains--vb-font-serifand a.font-serifutility carrying$font-family-serif. The--vb-prefix follows the theme's existing convention for theme-owned tokens, stated in that same file, so it is never confused with a Bootstrap token.- The Typography story uses
.font-serifinstead of.font-monospace.
Verified: the theme front-end build is clean, and the compiled root.css publishes both --bs-font-monospace (real monospace) and --vb-font-serif (EB Garamond).
A merge request will follow.
Remaining tasks
- ✅ File an issue
- ❌ Addition/Change/Update/Fix
- ❌ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support
- ➖ User Guide Documentation support
- ➖ UX/UI designer responsibilities
- ➖ Accessibility and Readability
- ❌ Reviewed by a human
- ❌ Code review by maintainers
- ❌ Full testing and approval
- ❌ Credit contributors
- ❌ Review with the product owner
- ❌ Update Release Notes
- ❌ Release
User interface changes
code,kbdandsamprender in a monospace face instead of EB Garamond.
API changes
- A sub-theme overriding
$font-family-monospace, or relying on.font-monospaceto get the serif face, is affected and should move to.font-serif.
Data model changes
- N/A
Release notes snippet
$font-family-monospacenow carries a real monospace stack. The serif face moved to a new--vb-font-seriftoken and a.font-serifutility.
Issue fork vartheme_bs5_rightup-3627181
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
rajab natshahComment #5
rajab natshah