Skip to content

Commit 0cbf0af

Browse files
pfultonRajdeep Chandracursoragent
authored
chore: remove platform scale toggle from Storybook UI (#6230)
* chore: remove platform scale toggle from Storybook UI This removes the medium/large platform scale toggle option from the Storybook UI * chore: remove leftover scale references from Storybook config Remove the scale initial global from preview.ts and the scale-related logic from the contexts decorator, completing the scale toggle removal. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Rajdeep Chandra <rajdeepc@adobe.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 10faac0 commit 0cbf0af

2 files changed

Lines changed: 1 addition & 23 deletions

File tree

2nd-gen/packages/swc/.storybook/decorators/contexts.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ import { html } from 'lit';
1414
import type { DecoratorFunction } from '@storybook/types';
1515

1616
/**
17-
* Decorator that applies selected theme and scale
17+
* Decorator that applies selected theme context.
1818
*/
1919
export const withContext: DecoratorFunction = (Story, context) => {
2020
const theme = context.globals.theme;
21-
const scale = context.globals.scale;
2221

2322
document.documentElement.classList.remove(
2423
'swc-theme--light',
@@ -27,12 +26,6 @@ export const withContext: DecoratorFunction = (Story, context) => {
2726
);
2827
document.documentElement.classList.add(`swc-theme--${theme}`);
2928

30-
if (scale === 'large') {
31-
document.documentElement.classList.add('swc-theme--sizeL');
32-
} else {
33-
document.documentElement.classList.remove('swc-theme--sizeL');
34-
}
35-
3629
return html`
3730
${Story(context)}
3831
`;

2nd-gen/packages/swc/.storybook/preview.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,20 +67,6 @@ const preview = {
6767
dynamicTitle: true,
6868
},
6969
},
70-
scale: {
71-
name: 'Scale',
72-
description: 'Global scale for components',
73-
defaultValue: 'medium',
74-
type: 'string',
75-
toolbar: {
76-
title: 'Scale',
77-
items: [
78-
{ value: 'medium', title: 'Medium' },
79-
{ value: 'large', title: 'Large' },
80-
],
81-
dynamicTitle: true,
82-
},
83-
},
8470
lang: {
8571
name: 'Language',
8672
description:
@@ -137,7 +123,6 @@ const preview = {
137123
},
138124
initialGlobals: {
139125
theme: 'light',
140-
scale: 'medium',
141126
lang: 'en-US',
142127
textDirection: 'auto',
143128
},

0 commit comments

Comments
 (0)