diff --git a/lib/components/src/blocks/ArgsTable/ArgsTable.tsx b/lib/components/src/blocks/ArgsTable/ArgsTable.tsx index f5651b6f9255..f353984140e5 100644 --- a/lib/components/src/blocks/ArgsTable/ArgsTable.tsx +++ b/lib/components/src/blocks/ArgsTable/ArgsTable.tsx @@ -1,6 +1,6 @@ import React, { FC } from 'react'; import pickBy from 'lodash/pickBy'; -import { styled, ignoreSsrWarning } from '@storybook/theming'; +import { styled } from '@storybook/theming'; import { opacify, transparentize, darken, lighten } from 'polished'; import { includeConditionalArg } from '@storybook/csf'; import { once } from '@storybook/client-logger'; @@ -111,20 +111,20 @@ export const TableWrapper = styled.table<{ marginLeft: inAddonPanel ? 0 : 1, marginRight: inAddonPanel ? 0 : 1, - [`tr:first-child${ignoreSsrWarning}`]: { - [`td:first-child${ignoreSsrWarning}, th:first-child${ignoreSsrWarning}`]: { + [`tr:first-child`]: { + [`td:first-child, th:first-child`]: { borderTopLeftRadius: inAddonPanel ? 0 : theme.appBorderRadius, }, - [`td:last-child${ignoreSsrWarning}, th:last-child${ignoreSsrWarning}`]: { + [`td:last-child, th:last-child`]: { borderTopRightRadius: inAddonPanel ? 0 : theme.appBorderRadius, }, }, - [`tr:last-child${ignoreSsrWarning}`]: { - [`td:first-child${ignoreSsrWarning}, th:first-child${ignoreSsrWarning}`]: { + [`tr:last-child`]: { + [`td:first-child, th:first-child`]: { borderBottomLeftRadius: inAddonPanel ? 0 : theme.appBorderRadius, }, - [`td:last-child${ignoreSsrWarning}, th:last-child${ignoreSsrWarning}`]: { + [`td:last-child, th:last-child`]: { borderBottomRightRadius: inAddonPanel ? 0 : theme.appBorderRadius, }, }, @@ -172,7 +172,7 @@ export const TableWrapper = styled.table<{ : lighten(0.05, theme.background.content), } : { - [`&:not(:first-child${ignoreSsrWarning})`]: { + [`&:not(:first-child)`]: { borderTopWidth: 1, borderTopStyle: 'solid', borderTopColor: diff --git a/lib/components/src/blocks/Source.tsx b/lib/components/src/blocks/Source.tsx index c71429c020e5..4d79f1807b04 100644 --- a/lib/components/src/blocks/Source.tsx +++ b/lib/components/src/blocks/Source.tsx @@ -1,5 +1,5 @@ import React, { ComponentProps, FunctionComponent } from 'react'; -import { styled, ThemeProvider, convert, themes, ignoreSsrWarning } from '@storybook/theming'; +import { styled, ThemeProvider, convert, themes } from '@storybook/theming'; import { EmptyBlock } from './EmptyBlock'; import { SyntaxHighlighter } from '../syntaxhighlighter/lazy-syntaxhighlighter'; @@ -52,7 +52,7 @@ const SourceSkeletonPlaceholder = styled.div<{}>(({ theme }) => ({ marginTop: 1, width: '60%', - [`&:first-child${ignoreSsrWarning}`]: { + [`&:first-child`]: { margin: 0, }, })); diff --git a/lib/components/src/spaced/Spaced.tsx b/lib/components/src/spaced/Spaced.tsx index 8ce2e6274b61..90460605a6aa 100644 --- a/lib/components/src/spaced/Spaced.tsx +++ b/lib/components/src/spaced/Spaced.tsx @@ -1,5 +1,5 @@ import React, { FunctionComponent } from 'react'; -import { styled, ignoreSsrWarning } from '@storybook/theming'; +import { styled } from '@storybook/theming'; const toNumber = (input: any) => (typeof input === 'number' ? input : Number(input)); @@ -19,7 +19,7 @@ const Container = styled.div( marginLeft: col * theme.layoutMargin, verticalAlign: 'inherit', }, - [`& > *:first-child${ignoreSsrWarning}`]: { + [`& > *:first-child`]: { marginLeft: 0, }, } @@ -27,7 +27,7 @@ const Container = styled.div( '& > *': { marginTop: row * theme.layoutMargin, }, - [`& > *:first-child${ignoreSsrWarning}`]: { + [`& > *:first-child`]: { marginTop: 0, }, }, diff --git a/lib/components/src/tabs/tabs.tsx b/lib/components/src/tabs/tabs.tsx index 8152a8837425..57065e9dfe9f 100644 --- a/lib/components/src/tabs/tabs.tsx +++ b/lib/components/src/tabs/tabs.tsx @@ -15,9 +15,6 @@ import { Placeholder } from '../placeholder/placeholder'; import { FlexBar } from '../bar/bar'; import { TabButton } from '../bar/button'; -const ignoreSsrWarning = - '/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */'; - export interface WrapperProps { bordered?: boolean; absolute?: boolean; @@ -87,7 +84,7 @@ const Content = styled.div( bottom: 0 + (bordered ? 1 : 0), top: 40 + (bordered ? 1 : 0), overflow: 'auto', - [`& > *:first-child${ignoreSsrWarning}`]: { + [`& > *:first-child`]: { position: 'absolute', left: 0 + (bordered ? 1 : 0), right: 0 + (bordered ? 1 : 0), diff --git a/lib/ui/src/index.tsx b/lib/ui/src/index.tsx index b7a5ea065479..45ee6f86a45a 100644 --- a/lib/ui/src/index.tsx +++ b/lib/ui/src/index.tsx @@ -7,13 +7,21 @@ import ReactDOM from 'react-dom'; import { Location, LocationProvider, useNavigate } from '@storybook/router'; import { Provider as ManagerProvider, Combo } from '@storybook/api'; -import { ThemeProvider, ensure as ensureTheme } from '@storybook/theming'; +import { + ThemeProvider, + ensure as ensureTheme, + CacheProvider, + createCache, +} from '@storybook/theming'; import { HelmetProvider } from 'react-helmet-async'; import App from './app'; import Provider from './provider'; +const emotionCache = createCache({ key: 'sto' }); +emotionCache.compat = true; + const { DOCS_MODE } = global; // @ts-ignore @@ -66,15 +74,17 @@ const Main: FC<{ provider: Provider }> = ({ provider }) => { : !state.storiesFailed && !state.storiesConfigured; return ( - - - + + + + + ); }}