Description
Reproduction
Couldn't get codesandbox working
Describe the bug
Couldn't get codesandbox or stackblitz env working as I had problems with both when trying to setup nuxt + shadcn-vue + accordion component. Worked fine with e.g. button component though but got mysterious errors with accordion.
Here's my nuxt.config.ts:
import tailwindcss from "@tailwindcss/vite";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
css: ["~/assets/css/tailwind.css"],
vite: {
plugins: [tailwindcss()],
},
compatibilityDate: "2024-11-01",
devtools: { enabled: false },
modules: ["@nuxt/eslint", "shadcn-nuxt"],
shadcn: {
/**
* Prefix for all the imported component
*/
prefix: "",
/**
* Directory that the component lives in.
* @default "./components/ui"
*/
componentDir: "./components/ui",
},
components: [{ path: "~/components", pathPrefix: false }],
});
I have also added @import "tw-animate-css";
in tailwind.css
(and installed said package). Btw, instructions for installing tw-animate-css
are missing from https://www.shadcn-vue.com/docs/installation/nuxt.html but are found in https://www.shadcn-vue.com/docs/installation/manual.html. Installing shadcn-nuxt
did not automatically include it.
Anyway, animation does not work when collapsing / opening accordion item. It seems that --radix-accordion-content-height
and --bits-accordion-content-height
are not computed properly as they both are undefined when I inspected accordion item's CSS using Chrome DevTools.
System Info
System:
OS: macOS 15.3.2
CPU: (12) arm64 Apple M3 Pro
Memory: 996.86 MB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.18.1 - ~/.nvm/versions/node/v20.18.1/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.18.1/bin/yarn
npm: 10.8.2 - ~/.nvm/versions/node/v20.18.1/bin/npm
Browsers:
Chrome: 135.0.7049.42
Edge: 135.0.3179.54
Safari: 18.3.1
npmPackages:
@vueuse/core: ^13.1.0 => 13.1.0
nuxt: ^3.16.2 => 3.16.2
shadcn-nuxt: ^2.0.0 => 2.0.0
vue: ^3.5.13 => 3.5.13
Contributes
- I am willing to submit a PR to fix this issue
- I am willing to submit a PR with failing tests