Conversation
Move MarkBind onto Bootstrap 5.3.8 and the matching Bootswatch release so the site can use Bootstrap's native theme switching instead of custom one-off overrides. This establishes the asset baseline needed for runtime dark mode without changing page behavior yet.
Update the checked-in functional expectations after the Bootstrap upgrade and theme-aware page rendering changes. This records the new generated HTML and bundled assets so future CLI regressions are measured against the dark-mode-capable output.
Teach page generation to load both light and dark highlight themes, set the Bootstrap theme before styles paint, and apply dark-safe defaults to built-in templates. This keeps the initial render in sync with the chosen theme and avoids flashes of mismatched UI.
|
For dark mode support, the website looks cohesive and basic features are already present too. I guess a good step forward would be releasing this as an experimental feature and ask for bug reports for visual artifacts? Perhaps we can include a message along the lines of:
in the bottom banner of the page where we currently have "Website generated by MarkBind...` what do yall think? @MarkBind/active-3281-members |
While getting end users to do the testing is the trend now 😆, we should do our own testing first. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2856 +/- ##
==========================================
+ Coverage 71.04% 71.11% +0.07%
==========================================
Files 131 132 +1
Lines 7117 7143 +26
Branches 1683 1621 -62
==========================================
+ Hits 5056 5080 +24
- Misses 1961 1963 +2
Partials 100 100 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
7bfd786 to
f4104c5
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces dark mode support across MarkBind-generated sites by switching to Bootstrap 5.3’s data-bs-theme mechanism, updating component/template styles to be theme-aware, and adjusting page generation + test fixtures to support runtime theme selection (including code highlighting theme assets).
Changes:
- Add runtime theme resolution (system preference +
localStorage) and setdata-bs-themeduring initial page load; load both light/dark highlight stylesheets and toggle them at runtime. - Update Vue component and core-web CSS to use Bootstrap CSS variables and add dark-mode-specific overrides.
- Refresh CLI functional expected outputs and template assets to match the new generated HTML/CSS behavior.
Reviewed changes
Copilot reviewed 145 out of 203 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/vue-components/src/Tabset.vue | Add dark-mode print border override for tabset rendering. |
| packages/vue-components/src/TabGroup.vue | Add dark-mode print border override for tab groups. |
| packages/vue-components/src/Tab.vue | Add dark-mode print border override for tab headers. |
| packages/vue-components/src/Submenu.vue | Switch submenu text color to Bootstrap theme variable. |
| packages/vue-components/src/SiteNavButton.vue | Switch hamburger bar color to Bootstrap theme variable. |
| packages/vue-components/src/SiteNav.vue | Replace hardcoded nav colors with Bootstrap theme variables. |
| packages/vue-components/src/Searchbar.vue | Add dark-mode background override for .table-active rows. |
| packages/vue-components/src/panels/NestedPanel.vue | Adjust default panel background behavior and add dark-mode bg-light overrides. |
| packages/vue-components/src/panels/MinimalPanel.vue | Replace hardcoded colors with Bootstrap theme variables for dark mode. |
| packages/vue-components/src/PageNavButton.vue | Switch button dot color to Bootstrap theme variable. |
| packages/vue-components/src/Overlay.vue | Add dark-mode background for open overlay menu. |
| packages/vue-components/src/index.js | Register the new DarkModeToggle component. |
| packages/vue-components/src/cardstack/CardStack.vue | Add dark-mode text color overrides for badges/results count. |
| packages/vue-components/src/Breadcrumb.vue | Add dark-mode text color override for breadcrumb “notlink” items. |
| packages/vue-components/src/Box.vue | Add dark-mode alert overrides and align divider colors with alert border variables. |
| packages/core/test/unit/utils/data.ts | Update mocked page template assets to include both highlight stylesheets. |
| packages/core/template/project/stylesheets/main.css | Remove inline mark styling and add dark-mode template overrides. |
| packages/core/template/portfolio/stylesheets/main.css | Remove inline mark styling and add dark-mode template overrides. |
| packages/core/template/default/stylesheets/main.css | Remove inline mark styling and add dark-mode template overrides. |
| packages/core/src/Site/SitePagesManager.ts | Generate both highlight asset paths (light/dark) in page config. |
| packages/core/src/Site/LazyLiveReloadLoadingSite.html | Make loading screen colors responsive to prefers-color-scheme. |
| packages/core/src/patches/htmlparser2.ts | Treat <dark-mode-toggle> as a special tag for parsing. |
| packages/core/src/Page/PageConfig.ts | Update PageAssets to expose highlightLight/highlightDark. |
| packages/core/src/Page/page.njk | Add runtime theme resolution + dual highlight stylesheet toggling + set data-code-theme. |
| packages/core/package.json | Update Bootswatch version to match Bootstrap 5.3 series. |
| packages/core-web/src/styles/page-nav.css | Replace hardcoded nav colors with Bootstrap theme variables. |
| packages/core-web/src/styles/markbind.css | Add theme-aware mark styling and dark-mode overrides; adjust blockquote styles. |
| packages/cli/test/functional/test_site/expected/testTree.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testTooltipSpacing.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testThumbnails.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testPopoverTrigger.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testPopovers.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testPanels.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testPageNav.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testOcticonInPage.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testModals.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testMermaid.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testMath.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testMaterialIconsInPage.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testLinks.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testLayoutsOverride.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testLayouts.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testImages.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testIconsInSiteLayout.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testHr.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testGlyphiconInPage.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testFontAwesomeInPage.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testExternalScripts.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testEmptyFrontmatter.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testEmptyAltFrontMatter.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testDates.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testCodeBlocks.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/testBootstrapIconInPage.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/sub_site/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site/expected/bugs/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/userGuide/UserGuide.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/userGuide/QuickStart.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/userGuide/Features.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/userGuide/FAQ.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/team/johndoe.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/team/AboutUs.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/stylesheets/main.css | Update expected template CSS for dark-mode overrides and remove inline mark styling. |
| packages/cli/test/functional/test_site_templates/test_project/expected/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/developerGuide/TracingCode.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/developerGuide/Testing.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/developerGuide/SettingUp.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/developerGuide/Requirements.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/developerGuide/Implementation.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/developerGuide/Documentation.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/developerGuide/DevOps.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/developerGuide/DeveloperGuide.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/developerGuide/Design.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_project/expected/developerGuide/Configuration.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_portfolio/expected/stylesheets/main.css | Update expected template CSS for dark-mode overrides and remove inline mark styling. |
| packages/cli/test/functional/test_site_templates/test_portfolio/expected/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_minimal/expected/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_default/expected/stylesheets/main.css | Update expected template CSS for dark-mode overrides and remove inline mark styling. |
| packages/cli/test/functional/test_site_templates/test_default/expected/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_default/expected/contents/topic3b.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_default/expected/contents/topic3a.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_default/expected/contents/topic2.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_default/expected/contents/topic1.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_templates/test_default/expected/404.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_table_plugin/expected/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_special_tags/expected/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/test_folder/extra_3.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/test_folder/extra_2.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/test_folder/extra_1.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/README.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/Page-1.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/Home.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/contents/topic3b.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/contents/topic3a.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/contents/topic2.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/contents/topic1.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/about.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_navigation_convert/expected/404.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/Page-1.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/index.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/Home.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/contents/topic3b.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/contents/topic3a.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/contents/topic2.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/contents/topic1.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/about.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/404.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/_Sidebar.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| packages/cli/test/functional/test_site_convert/test_basic_convert/expected/_Footer.html | Update expected HTML to include theme scripts + dual highlight stylesheets + code-theme attribute script. |
| docs/njk/common.njk | Adjust docs navigation buttons styling for Bootstrap 5.3 theme compatibility. |
| docs/css/main.css | Remove inline mark styling (now handled centrally/theme-aware). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
darkmode is set to be opt in for now until mature However, if user's device is on dark mode, bootstrap will default to dark mode until javascript loads, then switch it to white mode
Handle disabling dark mode in page.njk. this avoids the stutter in the nav bar when the javascript loads
Use existing highlight color instead of --bs-hightlight-bg which affects readability.
Harjun751
left a comment
There was a problem hiding this comment.
Code-wise looks good to me!
A lot of switching from hardcoded values to variables (which is expected for something like this), and updating the few components that do have dark/light mode to use the "global" one.
Visually there's still some things to work through, documenting so we can create issues and work on it for the future:
FOUC is still a problem
show.mp4
Then after all the teething issues are worked out we can add it to the documentation and roll it out!
| } | ||
|
|
||
| [data-bs-theme="dark"] .badge.tag-badge.select-all-toggle { | ||
| color: #e9ecef !important; |
There was a problem hiding this comment.
Just curious, why is the approach for some of these components a little different?
I'm assuming this one has some color that's defined for light mode somewhere else, and this is a override once data-bs-theme="dark" is true.
Is there a reason why we can't use variables here too, like in other components?
There was a problem hiding this comment.
Hmm, for this would we not be able to dynamically load the correct stylesheet in the page.njk instead of loading both and disabling one here?
I'm unsure of the restrictions, so this might be the best way right now anyway.
I just think it would be good to (informally) document the design decision in this discussion
|
|
||
| plantumlCheck: boolean; | ||
|
|
||
| darkMode: boolean; |
There was a problem hiding this comment.
I don't remember if there was discussion on this, but should we nest this option within the "style" config option?


What is the purpose of this pull request?
Overview of changes:
This is (edit: started off as) a fully vibe coded PR with (edit: has been tweaked and optimized since) minimal manual tweak to showcase what dark mode on a markbind sites can look like. The changes made include:
cssfor Vue components to support dark modesite.json. By default, the dark mode respect user'ssystem preference.
and dark mode
Anything you'd like to highlight/discuss:
Screenshots to be added later
Testing instructions:
pull this branch, run
npm run setupand serve a markbind site to see thechanges.
Proposed commit message: (wrap lines at 72 characters)
Add Dark Mode support
Checklist: ☑️
Reviewer checklist:
Indicate the SEMVER impact of the PR:
At the end of the review, please label the PR with the appropriate label:
r.Major,r.Minor,r.Patch.Breaking change release note preparation (if applicable):