storybook: add viewports

This commit is contained in:
Gauthier Roebroeck 2025-07-03 14:43:14 +08:00
parent 50dc9d143b
commit 359d5504cb
2 changed files with 42 additions and 1 deletions

View file

@ -12,6 +12,8 @@ import { vueIntl } from '@/plugins/vue-intl'
import 'virtual:uno.css'
import { availableLocales } from '@/utils/i18n/locale-helper'
import { localeDecorator } from './locale.decorator'
import { INITIAL_VIEWPORTS } from 'storybook/viewport'
import { viewports } from './viewport'
initialize(
{
@ -36,7 +38,9 @@ const preview: Preview = {
date: /Date$/i,
},
},
viewport: {
options: [...viewports],
},
a11y: {
// 'todo' - show a11y violations in the test UI only
// 'error' - fail CI on a11y violations

View file

@ -0,0 +1,37 @@
export const viewports = [
{
name: 'xs',
styles: {
width: '400px',
height: '963px',
},
},
{
name: 'sm',
styles: {
width: '950px',
height: '963px',
},
},
{
name: 'md',
styles: {
width: '1200px',
height: '963px',
},
},
{
name: 'lg',
styles: {
width: '1900px',
height: '963px',
},
},
{
name: 'xl',
styles: {
width: '2550px',
height: '963px',
},
},
]