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.90% 71.99% +0.08%
==========================================
Files 132 133 +1
Lines 7362 7392 +30
Branches 1637 1519 -118
==========================================
+ Hits 5294 5322 +28
- Misses 1967 2064 +97
+ Partials 101 6 -95 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dc9ae9b to
7bfd786
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.
| blockquote { | ||
| border-left: 0.25em solid #dfe2e5; | ||
| color: #6a737d; | ||
| border-left: 0.25em solid #fff; | ||
| color: var(--bs-body-bg, inherit); | ||
| padding: 0 1rem; |
| const storageKey = 'markbind-theme'; | ||
| const darkTheme = 'dark'; | ||
| const lightTheme = 'light'; | ||
| let resolvedTheme = '{{ codeTheme }}'; | ||
|
|
| <script> | ||
| (function() { | ||
| const theme = window.__MARKBIND_THEME__ || '{{ codeTheme }}'; | ||
| const lightStylesheet = document.getElementById('markbind-highlight-light'); | ||
| const darkStylesheet = document.getElementById('markbind-highlight-dark'); |
| } | ||
|
|
||
| document.documentElement.setAttribute('data-bs-theme', resolvedTheme); | ||
| window.__MARKBIND_THEME__ = resolvedTheme; | ||
| }()); |
| <script> | ||
| document.body.setAttribute('data-code-theme', window.__MARKBIND_THEME__ || '{{ codeTheme }}'); | ||
| </script> |
| [data-bs-theme="dark"] .table-active { | ||
| background-color: rgb(255 255 255 / 12.5%); | ||
| } |
| [data-bs-theme="dark"] .badge.tag-badge.select-all-toggle { | ||
| color: #e9ecef !important; | ||
| } |
| [data-bs-theme="dark"] .results-count { | ||
| color: #adb5bd; | ||
| } |
| [data-bs-theme="dark"] .printable-tab-header { | ||
| border-bottom-color: #495057; | ||
| } |
| [data-bs-theme="dark"] .alert-default { | ||
| color: #e9ecef; | ||
| background-color: #2b3035; | ||
| border-color: #495057; | ||
| } |
What is the purpose of this pull request?
Overview of changes:
This is a fully vibe coded PR with 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):