Usage
Wrap your code-block with a code-collapse component to display a collapsible code block.
main.css
@import "tailwindcss";
@import "@bitrix24/b24ui-nuxt";
@theme static {
--font-sans: 'Public Sans', sans-serif;
--breakpoint-3xl: 1920px;
--color-green-50: #EFFDF5;
}
::code-collapse
```css [main.css]
@import "tailwindcss";
@import "@bitrix24/b24ui-nuxt";
@theme static {
--font-sans: 'Public Sans', sans-serif;
--breakpoint-3xl: 1920px;
--color-green-50: #EFFDF5;
}
```
::
API
Props
Slots
Theme
app.config.ts
export default defineAppConfig({
b24ui: {
prose: {
codeCollapse: {
slots: {
root: 'relative [&_pre]:h-[200px]',
footer: 'h-[64px] absolute inset-x-px bottom-px rounded-b-(--ui-border-radius-md) flex items-center justify-center',
trigger: 'group',
triggerIcon: 'group-data-[state=open]:rotate-180'
},
variants: {
open: {
true: {
root: '[&_pre]:h-auto [&_pre]:min-h-[200px] [&_pre]:max-h-[80vh] [&_pre]:pb-[48px]'
},
false: {
root: '[&_pre]:overflow-hidden',
footer: 'bg-gradient-to-t from-(--ui-color-gray-90) dark:from-(--ui-color-gray-90)/80'
}
}
}
}
}
}
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'
export default defineConfig({
plugins: [
vue(),
bitrix24UIPluginVite({
b24ui: {
prose: {
codeCollapse: {
slots: {
root: 'relative [&_pre]:h-[200px]',
footer: 'h-[64px] absolute inset-x-px bottom-px rounded-b-(--ui-border-radius-md) flex items-center justify-center',
trigger: 'group',
triggerIcon: 'group-data-[state=open]:rotate-180'
},
variants: {
open: {
true: {
root: '[&_pre]:h-auto [&_pre]:min-h-[200px] [&_pre]:max-h-[80vh] [&_pre]:pb-[48px]'
},
false: {
root: '[&_pre]:overflow-hidden',
footer: 'bg-gradient-to-t from-(--ui-color-gray-90) dark:from-(--ui-color-gray-90)/80'
}
}
}
}
}
}
})
]
})