Currently there is no Astro integration and Astro Main Menu has to be installed manually.
The installation steps are:
Use your package manager to install @pbkware/astro-main-menu
. If using NPM:
npm install @pbkware/astro-main-menu
Use your package manager to install sass
. If using NPM:
npm install sass
This file is required to specify the @media breakpoint between wide and narrow. Add it with the following steps:
/src/styles/scss
_main-menu-config.scss
// Breakpoint used in media queries to determine when to use narrow main menu
$narrow-breakpoint: 24rem;
Not required in Astro 5 or later.
If you get a Dart Sass deprecation warning when building your project with Astro, modify astro.config.mjs
with the addition of a vite
property in the object passed to defineConfig()
as shown below:
export default defineConfig({
...
// Set the vite scss api property below if the following warning is displayed:
// Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.
vite: {
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler' // or "modern"
}
}
}
}
});