Skip to content

Commit

Permalink
fix: text bg color playground
Browse files Browse the repository at this point in the history
  • Loading branch information
mimokmt committed Oct 17, 2023
1 parent e43dcf1 commit fdd6961
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 28 deletions.
47 changes: 19 additions & 28 deletions packages/tailwind-config/src/docs/colors/TextBgColor.story.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,31 @@
import type { Story } from '../../_lib/compat'

import type { StoryObj, Meta } from '@storybook/react'
import { colors } from '.'
import { TextBgColor } from './TextBgColor'

export default {
const meta: Meta<typeof TextBgColor> = {
title: 'tailwind-config/Colors/Text bg color',
component: TextBgColor,
argTypes: {
textColorClass: {
control: {
type: 'select',
options: Object.keys(colors).map((color) => `text-${color}`),
},
defaultValue: 'text-text1',
options: Object.keys(colors).map((color) => `text-${color}`),
control: { type: 'select' },
},
bgColorClass: {
control: {
type: 'select',
options: Object.keys(colors).map((color) => `bg-${color}`),
},
defaultValue: 'bg-background1',
options: Object.keys(colors).map((color) => `bg-${color}`),
control: { type: 'select' },
},
},
}
export default meta

type Props = Readonly<{
textColorClass: string
bgColorClass: string
}>
type Story = StoryObj<typeof TextBgColor>

export const Playground: Story<Props> = ({ textColorClass, bgColorClass }) => (
<div className={`${bgColorClass} p-64 max-w-2xl`}>
<p className={`typography-20 ${textColorClass}`}>
charcoal はピクシブ株式会社のデザインシステムです。ここでは特に、Web
フロントエンドの実装に用いる npm パッケージ集のことを言います。Lorem ipsum
dolor sit amet, consectetur adipiscing elit. Aliquam at odio bibendum nisl
mollis eleifend et quis turpis. Quisque dignissim porta justo ut
convallis.dipiscing elit.
</p>
</div>
)
export const Playground: Story = {
args: {
textColorClass: 'text-text1',
bgColorClass: 'bg-background1',
},
render: ({ bgColorClass, textColorClass }) => (
<TextBgColor bgColorClass={bgColorClass} textColorClass={textColorClass} />
),
}
20 changes: 20 additions & 0 deletions packages/tailwind-config/src/docs/colors/TextBgColor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
type Props = {
textColorClass: string
bgColorClass: string
}
export const TextBgColor: React.FC<Props> = ({
textColorClass,
bgColorClass,
}) => {
return (
<div className={`${bgColorClass} p-64 max-w-2xl`}>
<p className={`typography-20 ${textColorClass}`}>
charcoal はピクシブ株式会社のデザインシステムです。ここでは特に、Web
フロントエンドの実装に用いる npm パッケージ集のことを言います。Lorem
ipsum dolor sit amet, consectetur adipiscing elit. Aliquam at odio
bibendum nisl mollis eleifend et quis turpis. Quisque dignissim porta
justo ut convallis.dipiscing elit.
</p>
</div>
)
}

0 comments on commit fdd6961

Please sign in to comment.