Storybook: Fix decorator height (#41468)

* fix(storybook): make sure story background fills available height

* fix(storybook): add decorator to prevent badge filling all available height

* docs(badge): use centered story

* revert(badge): remove obsolete Meta typing
This commit is contained in:
Jack Westbrook 2021-11-10 10:51:10 +01:00 committed by GitHub
parent 8adefa32fd
commit cd5277befd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 4 deletions

View File

@ -0,0 +1,6 @@
<!-- Make sure iframe dom elements fill all available space for background consistency -->
<style>
#root {
height: 100%;
}
</style>

View File

@ -2,11 +2,12 @@ import React from 'react';
import { Story } from '@storybook/react';
import { Badge, BadgeProps } from '@grafana/ui';
import { iconOptions } from '../../utils/storybook/knobs';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
export default {
title: 'Data Display/Badge',
component: Badge,
decorators: [],
decorators: [withCenteredStory],
parameters: {
docs: {},
},

View File

@ -11,7 +11,7 @@ const PaddedStory: React.FunctionComponent<{}> = ({ children }) => {
width: '100%',
padding: '20px',
display: 'flex',
minHeight: '80vh',
minHeight: '100%',
background: `${theme.colors.background.primary}`,
}}
>

View File

@ -5,7 +5,7 @@ const RightAlignedStory: React.FunctionComponent<{}> = ({ children }) => {
return (
<div
style={{
height: '100vh ',
minHeight: '100%',
display: 'flex',
alignItems: 'flex-start',
justifyContent: 'flex-end',

View File

@ -21,7 +21,7 @@ const ThemeableStory: React.FunctionComponent<{ handleSassThemeChange: SassTheme
width: '100%',
padding: '20px',
display: 'flex',
minHeight: '80vh',
minHeight: '100%',
background: `${theme.colors.background.primary}`,
}}
>