1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-29 15:11:58 +00:00

feat: dark mode toggle, tailwind viewports

This commit is contained in:
Ben Basten 2024-06-05 12:23:19 -04:00
parent daab866f06
commit ec645c06cc
No known key found for this signature in database
GPG key ID: 844371678EC3728B
5 changed files with 75 additions and 2 deletions

View file

@ -8,6 +8,7 @@ const config: StorybookConfig = {
'@chromatic-com/storybook', '@chromatic-com/storybook',
'@storybook/addon-interactions', '@storybook/addon-interactions',
'@storybook/addon-svelte-csf', '@storybook/addon-svelte-csf',
'@storybook/addon-themes',
], ],
framework: { framework: {
name: '@storybook/sveltekit', name: '@storybook/sveltekit',

View file

@ -1,6 +1,17 @@
import { withThemeByClassName } from '@storybook/addon-themes';
import type { Preview } from '@storybook/svelte'; import type { Preview } from '@storybook/svelte';
import '../src/app.css'; import '../src/app.css';
export const decorators = [
withThemeByClassName({
themes: {
light: 'light',
dark: 'dark',
},
defaultTheme: 'light',
}),
];
const preview: Preview = { const preview: Preview = {
parameters: { parameters: {
controls: { controls: {
@ -9,6 +20,52 @@ const preview: Preview = {
date: /Date$/i, date: /Date$/i,
}, },
}, },
viewport: {
viewports: {
'639': {
name: 'mobile',
styles: {
width: '639px',
height: '100%',
},
},
'640': {
name: 'sm',
styles: {
width: '640px',
height: '100%',
},
},
'768': {
name: 'md',
styles: {
width: '768px',
height: '100%',
},
},
'1024': {
name: 'lg',
styles: {
width: '1024px',
height: '100%',
},
},
'1280': {
name: 'xl',
styles: {
width: '1280px',
height: '100%',
},
},
'1536': {
name: '2xl',
styles: {
width: '1536px',
height: '100%',
},
},
},
},
}, },
}; };

View file

@ -1,8 +1,8 @@
import { create } from '@storybook/theming/create'; import { create } from '@storybook/theming/create';
import brandImage from '../../design/immich-logo-inline-light.png'; import brandImage from '../../design/immich-logo-inline-dark.svg';
export default create({ export default create({
base: 'light', base: 'dark',
brandTitle: 'immich', brandTitle: 'immich',
brandUrl: 'https://immich.app/', brandUrl: 'https://immich.app/',
brandImage, brandImage,

14
web/package-lock.json generated
View file

@ -36,6 +36,7 @@
"@storybook/addon-interactions": "^8.1.5", "@storybook/addon-interactions": "^8.1.5",
"@storybook/addon-links": "^8.1.5", "@storybook/addon-links": "^8.1.5",
"@storybook/addon-svelte-csf": "^4.1.3", "@storybook/addon-svelte-csf": "^4.1.3",
"@storybook/addon-themes": "^8.1.5",
"@storybook/blocks": "^8.1.5", "@storybook/blocks": "^8.1.5",
"@storybook/svelte": "^8.1.5", "@storybook/svelte": "^8.1.5",
"@storybook/sveltekit": "^8.1.5", "@storybook/sveltekit": "^8.1.5",
@ -4267,6 +4268,19 @@
} }
} }
}, },
"node_modules/@storybook/addon-themes": {
"version": "8.1.5",
"resolved": "https://registry.npmjs.org/@storybook/addon-themes/-/addon-themes-8.1.5.tgz",
"integrity": "sha512-B+qJW52ZATuH57SWHIAw4S8bxrLoWKKKTtMeEmhgtlsLYZL31/i+uYpsTTqpkkLx9JK6ofZAV/cjGKWDbsh3Eg==",
"dev": true,
"dependencies": {
"ts-dedent": "^2.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/storybook"
}
},
"node_modules/@storybook/addon-toolbars": { "node_modules/@storybook/addon-toolbars": {
"version": "8.1.5", "version": "8.1.5",
"resolved": "https://registry.npmjs.org/@storybook/addon-toolbars/-/addon-toolbars-8.1.5.tgz", "resolved": "https://registry.npmjs.org/@storybook/addon-toolbars/-/addon-toolbars-8.1.5.tgz",

View file

@ -32,6 +32,7 @@
"@storybook/addon-interactions": "^8.1.5", "@storybook/addon-interactions": "^8.1.5",
"@storybook/addon-links": "^8.1.5", "@storybook/addon-links": "^8.1.5",
"@storybook/addon-svelte-csf": "^4.1.3", "@storybook/addon-svelte-csf": "^4.1.3",
"@storybook/addon-themes": "^8.1.5",
"@storybook/blocks": "^8.1.5", "@storybook/blocks": "^8.1.5",
"@storybook/svelte": "^8.1.5", "@storybook/svelte": "^8.1.5",
"@storybook/sveltekit": "^8.1.5", "@storybook/sveltekit": "^8.1.5",