Upgrade your theme
Move your site to the latest version of the Mint, Maple, Luma, Linden, Almond, or Sequoia theme with mint upgrade, then fix the components, page modes, and custom CSS that changed.
The latest version of the Mint, Maple, Luma, Linden, Almond, and Sequoia themes have new layouts, navigation, search, assistant, and components. New sites use the latest version. Existing sites stay on version 1 until you upgrade them.
Your site’s themeVersion setting in docs.json controls which version it uses:
If you don’t set themeVersion, your site uses version 1. Palm, Willow, and Aspen only have version 1, so they ignore themeVersion.
You don’t need to upgrade. Version 1 sites do not change and are still supported, but new features are only built for version 2.
What changes when you upgrade
Upgrade with the CLI
mint upgrade moves your site to version 2, applies fixes that have deterministic changes, , and lists what you need to manually update.
Prerequisites
Upgrade without the CLI
If you can’t run the CLI, set themeVersion to 2 in docs.json, then use the removed components and removed page modes tables to update your pages. Editing docs.json by hand skips the automatic fixes and the report of custom CSS and JavaScript to update. Preview the changes on a preview deployment before you publish.
Removed components
In the latest theme version, these components render only the content inside them, or nothing for <ApiPlayground> and <Popup>.
For example, replace a tile:
with a card:
Removed props
Removed page modes
The wide, center, and frame page modes are removed. Pages that use them get the default layout. The custom and assistant modes work the same as in version 1.
To keep a page’s layout, remove mode from the page’s frontmatter and add custom CSS that targets the page through its data-page-href attribute. Replace /your-page with the page’s path.
Update custom CSS and JavaScript
The latest theme version doesn’t render the IDs, classes, data-component-part, or data-search-item attributes from version 1. Layout elements have a data-layout-item attribute, and components have a data-component-item attribute. mint upgrade lists each version 1 selector in your custom CSS and JavaScript.
A selector in the table may match a different element than the version 1 selector did. Inspect the element in mint dev before you change spacing, size, or position. Delete rules that only worked around the version 1 layout.
These color variables work in both versions, so keep using them instead of fixed colors: --primary, --primary-light, --primary-dark, --tooltip-foreground, --background-light, --background-dark, and --gray-50 to --gray-950. Each variable holds three RGB numbers, so use it as rgb(var(--primary)).
For the full list of selectors, see Custom scripts.
Other changes to check
Go back to version 1
To go back, revert the upgrade’s changes with Git. Don’t only set themeVersion back to 1, because some values that work on version 2 don’t work on version 1. For example, mint upgrade changes badge colors such as gray to grey, which version 1 doesn’t accept.