From 5e69db19765dcea39c4fbca40066e77d979aab79 Mon Sep 17 00:00:00 2001 From: Ioanna Kokkini Date: Tue, 14 May 2024 17:38:14 +0100 Subject: [PATCH] Remove darkmode example stories We don't need them anymore. We have completed the work: https://github.com/guardian/dotcom-rendering/issues/9110 --- .../components/HeadlineExample.stories.tsx | 60 ------------------- .../src/components/HeadlineExample.tsx | 16 ----- 2 files changed, 76 deletions(-) delete mode 100644 dotcom-rendering/src/components/HeadlineExample.stories.tsx delete mode 100644 dotcom-rendering/src/components/HeadlineExample.tsx diff --git a/dotcom-rendering/src/components/HeadlineExample.stories.tsx b/dotcom-rendering/src/components/HeadlineExample.stories.tsx deleted file mode 100644 index 0b78988b89a..00000000000 --- a/dotcom-rendering/src/components/HeadlineExample.stories.tsx +++ /dev/null @@ -1,60 +0,0 @@ -// ----- Imports ----- // - -import { css } from '@emotion/react'; -import { ArticleDesign, ArticleDisplay, ArticlePillar } from '@guardian/libs'; -import type { Decorator, Meta, StoryObj } from '@storybook/react'; -import { paletteDeclarations } from '../palette'; -import { HeadlineExample } from './HeadlineExample'; - -// ----- Meta ----- // - -const meta: Meta = { - title: 'components/HeadlineExample', - component: HeadlineExample, -}; - -export default meta; - -// ----- Decorators ----- // - -/** - * Creates storybook decorator used to wrap components in an element - * containing the light or dark mode palette colours. - * - * @param colourScheme Choose whether to use the light or darPerformanceNavigation.type palette. - * @returns A decorator that wraps the component in a `div` containing the - * palette colours as CSS custom properties. - */ -const colourSchemeDecorator = - (colourScheme: 'light' | 'dark') => - (format: ArticleFormat): Decorator => - (Story) => ( -
- -
- ); - -const lightMode = colourSchemeDecorator('light'); -const darkMode = colourSchemeDecorator('dark'); - -// ----- Stories ----- // - -type Story = StoryObj; - -const articleFormat: ArticleFormat = { - design: ArticleDesign.Standard, - display: ArticleDisplay.Standard, - theme: ArticlePillar.News, -}; - -export const LightHeadline: Story = { - args: { - text: 'A short example headline', - }, - decorators: [lightMode(articleFormat)], -}; - -export const DarkHeadline: Story = { - args: LightHeadline.args, - decorators: [darkMode(articleFormat)], -}; diff --git a/dotcom-rendering/src/components/HeadlineExample.tsx b/dotcom-rendering/src/components/HeadlineExample.tsx deleted file mode 100644 index 91d2b522417..00000000000 --- a/dotcom-rendering/src/components/HeadlineExample.tsx +++ /dev/null @@ -1,16 +0,0 @@ -// ----- Imports ----- // - -import { css } from '@emotion/react'; -import { headlineMedium42 } from '@guardian/source-foundations'; -import { palette } from '../palette'; - -// ----- Component ----- // - -export const HeadlineExample = ({ text }: { text: string }) => { - const styles = css` - color: ${palette('--headline-colour')}; - background-color: ${palette('--headline-background')}; - ${headlineMedium42} - `; - return

{text}

; -};