Skip to content

Commit

Permalink
Merge pull request #13260 from cone56/next
Browse files Browse the repository at this point in the history
Addon-backgrounds: Fix grid offset always using default value
  • Loading branch information
shilman committed Nov 29, 2020
2 parents 1a42703 + deb1a8c commit bfc0ed0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/backgrounds/src/decorators/withGrid.ts
Expand Up @@ -33,8 +33,8 @@ export const withGrid = (StoryFn: StoryFunction, context: StoryContext) => {
const isLayoutPadded = parameters.layout === undefined || parameters.layout === 'padded';
// 16px offset in the grid to account for padded layout
const defaultOffset = isLayoutPadded ? 16 : 0;
const offsetX = gridParameters.offsetX || isInDocs ? 20 : defaultOffset;
const offsetY = gridParameters.offsetY || isInDocs ? 20 : defaultOffset;
const offsetX = gridParameters.offsetX ?? (isInDocs ? 20 : defaultOffset);
const offsetY = gridParameters.offsetY ?? (isInDocs ? 20 : defaultOffset);

const gridStyles = useMemo(() => {
const selector =
Expand Down

0 comments on commit bfc0ed0

Please sign in to comment.